Advertisement Jump to content
Sign in to follow this  

shooting ray in a cone shape

This topic is 4989 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, I'm implementing blurred reflection in my ray tracer, but I'm not sure how to generate the rays. What I think is the following: Suppose that R is the reflected ray. X = A*(0,1,0); y = A*X; Now X and Y describe a plane perpendicular to R. What I can do now is finding PP = P+R.dir; Now I can generate n random points near PP (i.e. PP+X*Random()+Y*Random()). The rays can then be created by doing RAY = (P, PPRandom - p); That is the way I do for primary rays generation, and I do the same thing for Anti-aliasing and area lights. My problem is that this seems a bit slow for reflections, because for primary rays and area lights I can calculate some values only once (X,Y,UP), here I should redo it every time. In addition, I have always to check if R == (0,1,0) and in this case switch to (0,0,1) (for example). How would you henerate rays for blurred reflections? Thank you

Share this post

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

  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!