Sign in to follow this  

Light_Shaft

This topic is 4072 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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]

Share this post


Link to post
Share on other sites
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]

Share this post


Link to post
Share on other sites

This topic is 4072 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this