Jump to content
  • Advertisement
Sign in to follow this  
YixunLiu

How to get a ray in view space in volume rendering

This topic is 578 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,

In PS, I want to get a ray in view space to do volume rendering.

Let's say I have the camera position in the view space. I want to get the other end of the ray corresponding with the screen position. So I can define the ray.

My question is how to convert the screen position to view space in PS?

 

Thanks a lot.

 

YL

Share this post


Link to post
Share on other sites
Advertisement
The camera position in view space ? It is the origin : float3(0,0,0) :)

The viewspace ray can be determine from the screen coordinate normalize to -1..1, add a fake z that represent something like the far plane (value depends on the kind of projection you use), w set to 1 and multiply by the inverse projection. Divide the result by w, normalize the float3, and you have your viewdirection

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!