Light_Shaft
Hi, guys, I read Jason Mitchell's paper [Light Shafts], and something i misunderstood.
first, in the vertex shader, the pos is cal like this
float4 pos = vMinBounds * vPosition + vMaxBounds * (1-vPosition);
so, here i assume vMinBouns & vMaxBounds are light frustum's near plane dis & far plane dis.
second, in the pixel shader,
cookie = tex2Dproj(CookieSampler, tcproj);
here: tcproj, is it in the light view space,
and float atten = 0.25f + 20000.0f / dot(lsPos_depth.xyz, lsPos_depth.xyz);
how can i get the lsPos_depth ?
thx for any help!
[Edited by - wmonash on October 21, 2006 10:30:26 PM]
Sorry for that, i have modified. :)
Why there is no answer, because my poor english? i will try to explain it in more detail.
1. i create a series planes facing to the viewer in dedifferent depth,
2. trilerp these vertex within view-space-AABB of light's frustum.
3. in pixel shader i sampler texture using tex2D
float2 vProj = (In.proj.xy/In.proj.w);( In.proj is cal in the vertex shader, which is perspective by light_view_proj )
cookie = tex2D(CookieSampler, vProj);
4. calculate atten base on the paper, but i don't really know what is lsPos_depht stand for? Is light position? or something else?
[Edited by - wmonash on October 21, 2006 11:26:43 PM]
Why there is no answer, because my poor english? i will try to explain it in more detail.
1. i create a series planes facing to the viewer in dedifferent depth,
2. trilerp these vertex within view-space-AABB of light's frustum.
3. in pixel shader i sampler texture using tex2D
float2 vProj = (In.proj.xy/In.proj.w);( In.proj is cal in the vertex shader, which is perspective by light_view_proj )
cookie = tex2D(CookieSampler, vProj);
4. calculate atten base on the paper, but i don't really know what is lsPos_depht stand for? Is light position? or something else?
[Edited by - wmonash on October 21, 2006 11:26:43 PM]
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement