Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 27 Dec 2004
Offline Last Active Feb 03 2014 03:25 PM

Topics I've Started

directional shadow in reflection map

06 January 2014 - 05:02 PM



i'm trying to implement directional shadow in cube reflection map.  I'm trying to avoid the case where i have to re-render reflected objects into separate shadow map.  Here is what i'm thinking ...


- render cube reflectionmap along with cube depth map

- for each pixel in reflectionmap, (all cube texture) cast a ray to the sun, and use cube depth map to check if ray is obstructed by object

- if it's obstructed, then shade a pixel.


i'm not quite sure about step 2, is it possible to use the ray vector as reflection vector into cubemap ref. texture? 

Improving cascade shadow

02 December 2013 - 05:32 PM



I'm working on improving cascade shadows for my project.  The main problem is that for cascades that are distant (i have 4 cascades) i see some kind of 'chain-saw' looking edge.  i thought about implementing SDSM, but my project doesn't allow GPU-generated data to be used for cascade bounds ... (we have two threads, one doing all update and the other doing all the rendering)  


Is there any other way of countering this kinds of visual problem in cascade shadow?

how to copy depthstencil rendertarget

04 September 2013 - 05:38 PM

... without using copyresource/copysubresource?


i need to copy depth/stencil from one depth target to another using blitting screen aligned rectangle (via shader). i'm able to copy depth info, but somehow stencil info is lost.  (i'm guessing it's prolly source shader resource view is R24_X8 type ... )


any idea?

uniform bool shader function arguments not working!

28 February 2013 - 04:43 PM



i'm trying to update old shader codes.  When i try to use uniform bool shader arguments, i found that shader function is not getting correct value.  So, for example,


technique abc


pass 0


SetVertexShader( CompileShader( vs_4_0, vs(true) ) );




vsout vs(vsin IN, uniform bool bCheck)


if (bCheck)






it seems bCheck is always false, and i'm not sure what's preventing bool value to be passed to vs function.  Any idea?



need help with doing viewport transformation in vertex shader

27 November 2012 - 02:22 PM


I'm trying to do manual viewport transformation in vertex shader ...

first, i'm setting an identity viewport matrix by doing the following

vp.Width = 2;
vp.Height = -2;
vp.TopLeftX = -1;
vp.TopLeftY = 1;
vp.MaxDepth = 1.0f;
vp.MinDepth = 0.0f;
g_grcCurrentContext->RSSetViewports( 1, &vp );

and then, in vertex shader, after doing world/view/projection transformation, i do the following (given that i want to render into 1024x1024 viewport with 1.0 maxz and 0.0 minz)

OUT.pos.x = OUT.pos.x * 512.0f + 512.0f * OUT.pos.w;
OUT.pos.y = OUT.pos.y * -512.0f + 512.0f * OUT.pos.w;

I can't think of anything else that i need to do to get this working .... i'd appreciate any help, thx