"derived from the u-v coordinates"
how exactly is the bitangent direction derived?
Not Telling
Posted by lomateron
on 04 May 2013 - 10:51 PM
"derived from the u-v coordinates"
how exactly is the bitangent direction derived?
Posted by lomateron
on 08 March 2013 - 04:06 PM
can someone try this to see if its really a bug, it's simple:
create a texture with 1 texel....create it's render target..create its depthstencil with this DXGI_FORMAT_D24_UNORM_S8_UINT
create depthstencil state with this description:
D3D10_DEPTH_STENCIL_DESC dSDd; dSDd.DepthEnable = FALSE; dSDd.DepthWriteMask = D3D10_DEPTH_WRITE_MASK_ZERO; dSDd.DepthFunc = D3D10_COMPARISON_ALWAYS; dSDd.StencilEnable = TRUE; dSDd.StencilReadMask = D3D10_DEFAULT_STENCIL_READ_MASK; dSDd.StencilWriteMask = D3D10_DEFAULT_STENCIL_WRITE_MASK; dSDd.FrontFace.StencilDepthFailOp = D3D10_STENCIL_OP_KEEP; dSDd.FrontFace.StencilFailOp = D3D10_STENCIL_OP_INCR; dSDd.FrontFace.StencilPassOp = D3D10_STENCIL_OP_INCR; dSDd.FrontFace.StencilFunc = D3D10_COMPARISON_EQUAL; dSDd.BackFace.StencilDepthFailOp = D3D10_STENCIL_OP_KEEP; dSDd.BackFace.StencilFailOp = D3D10_STENCIL_OP_KEEP; dSDd.BackFace.StencilPassOp = D3D10_STENCIL_OP_KEEP; dSDd.BackFace.StencilFunc = D3D10_COMPARISON_NEVER;
create 2 techniques with this shaders, first technique uses VS1 and second technique uses VS2
struct VS_A
{
float4 Pos : POSITION;
uint Id : SV_InstanceID;
};
struct PS_A
{
float4 Pos : SV_POSITION;
float4 Texl : TTTTT;
};
PS_A VS1( VS_A i )//stencil will not work as it should
{
PS_A output;
output.Pos=float4(0.0f,0.0f,0.0f,1.0f);
output.Texl=float4(1.0f,1.0f,1.0f,1.0f);
return output;
}
PS_A VS2( float4 Pos : POSITION )//stencil will work correctly
{
PS_A output;
output.Pos=float4(0.0f,0.0f,0.0f,1.0f);
output.Texl=float4(1.0f,1.0f,1.0f,1.0f);
return output;
}
float4 PS( PS_A a) : SV_Target
{
return a.Texl;
}
now to render
set the render target with its depthstencil, set its viewport and layout, point list and finally render it like this:
g_pd3dDevice->OMSetDepthStencilState(g_pDepthStencilState,1); g_pd3dDevice->ClearDepthStencilView( g_pDepthStencilViewSpace3D, D3D10_CLEAR_STENCIL, 0.0f, 0 ); g_pTechnique1->GetPassByIndex( 0 )->Apply( 0 ); g_pd3dDevice->DrawInstanced( 1, 1, 0, 0); g_pd3dDevice->ClearDepthStencilView( g_pDepthStencilViewSpace3D, D3D10_CLEAR_STENCIL, 0.0f, 0 ); g_pTechnique1->GetPassByIndex( 0 )->Apply( 0 ); g_pd3dDevice->DrawInstanced( 1, 1, 0, 0);
the first draw will fail the stencil test and will not draw nothing,
the second draw will pass the stencil test and will draw ----------->This is the problem, i don't know why it passes the test
Now change the technique so it uses the VS2 and render using: g_pd3dDevice->Draw( 1, 0);
The two draws will fail the stencil test, thats how it should work
The use of SV_Instance in VS1 i think is the cause of the problem, i dont know more
Posted by lomateron
on 25 November 2012 - 03:48 PM
Posted by lomateron
on 06 November 2012 - 01:47 PM
Posted by lomateron
on 17 September 2012 - 09:38 PM
Posted by lomateron
on 26 June 2012 - 03:39 PM
Posted by lomateron
on 27 March 2012 - 01:15 PM
Posted by lomateron
on 10 February 2012 - 09:34 PM
Find content