Jump to content

  • Log In with Google      Sign In   
  • Create Account

#ActualAndrey.Mesheryakov

Posted 29 September 2013 - 07:54 AM

Hello!

I'm trying to make something on wp8 using dx11. And I have one bug. I'm trying to draw a picture with transparency.gpApp->m_deviceContext->IASetVertexBuffers( 0, 1, vertexbuffer.GetAddressOf(), &stride, &offset );
gpApp->m_deviceContext->PSSetShaderResources( 0, 1, pImage->m_texture.GetAddressOf() );
gpApp->m_deviceContext->IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST);
gpApp->m_deviceContext->Draw( 3 * trianglesCount, 0 );
 

And all looks ok - 

runjpg_5973997_9210037.jpg.

I see transparent square on a picture.

 

But then I minimizing the app the transparent part is going black - 

suspendjpg_3882626_9210046.jpg

 

vertex shader----------------------------------------------------
struct VertexShaderInput
{
  float4 pos : POSITION;
  float4 color : COLOR0;
  float2 texcoord : TEXCOORD;
};


struct VertexShaderOutput
{
  float4 pos : SV_POSITION;
  float4 color : COLOR0;
  float2 texcoord : TEXCOORD;
};


VertexShaderOutput main(VertexShaderInput input)
{
  VertexShaderOutput output;


  output.pos = input.pos;
    output.texcoord = input.texcoord;
  output.color = input.color;


  return output;
}
----------------------------------------------------
 
pixel shader----------------------------------------
Texture2D Texture;
SamplerState ss;


struct PixelShaderInput
{
  float4 pos : SV_POSITION;
  float4 color : COLOR0;
  float2 texcoord : TEXCOORD;
};


float4 main(PixelShaderInput input) : SV_TARGET
{
  return Texture.Sample(ss, input.texcoord);
  //return input.color * Texture.Sample(ss, input.texcoord);
}
----------------------------------------------------
 

 

Please give me a direction that I have done wrong. Any ideas! Thanks!


#1Andrey.Mesheryakov

Posted 29 September 2013 - 06:23 AM

Hello!

 

I'm trying to make something on wp8 using dx11. And I have one bug. I'm trying to draw a picture with transparency.

gpApp->m_deviceContext->IASetVertexBuffers( 0, 1, vertexbuffer.GetAddressOf(), &stride, &offset );
gpApp->m_deviceContext->PSSetShaderResources( 0, 1, pImage->m_texture.GetAddressOf() );
gpApp->m_deviceContext->IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST);
gpApp->m_deviceContext->Draw( 3 * trianglesCount, 0 );
 

And all looks ok - 

runjpg_5973997_9210037.jpg.

I see transparent square on a picture.

 

But then I minimizing the app the transparent part is going black - 

suspendjpg_3882626_9210046.jpg

 

vertex shader----------------------------------------------------
struct VertexShaderInput
{
  float4 pos : POSITION;
  float4 color : COLOR0;
  float2 texcoord : TEXCOORD;
};
 
struct VertexShaderOutput
{
  float4 pos : SV_POSITION;
  float4 color : COLOR0;
  float2 texcoord : TEXCOORD;
};
 
VertexShaderOutput main(VertexShaderInput input)
{
  VertexShaderOutput output;
 
  output.pos = input.pos;
    output.texcoord = input.texcoord;
  output.color = input.color;
 
  return output;
}
----------------------------------------------------
 
pixel shader----------------------------------------
Texture2D Texture;
SamplerState ss;
 
struct PixelShaderInput
{
  float4 pos : SV_POSITION;
  float4 color : COLOR0;
  float2 texcoord : TEXCOORD;
};
 
float4 main(PixelShaderInput input) : SV_TARGET
{
  return Texture.Sample(ss, input.texcoord);
  //return input.color * Texture.Sample(ss, input.texcoord);
}
----------------------------------------------------
 

 

Please give me a direction that I have done wrong. Any ideas! Thanks!


PARTNERS