Jump to content
  • Advertisement
Sign in to follow this  
Caesar

Raytracer - 1 basic question

This topic is 4998 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

I'd like to write a very basic raytracer. I've read one or two tutors but what I'm still unsure about is how to get what object (I guess I'd need that to calculate the intersetion of the object/primitve/whatever with the ray I'm casting) corresponds to a texel on my scene. Shall I first render the whole thing into a buffer (each object = one color in the buffer) or are there better ways?

Share this post


Link to post
Share on other sites
Advertisement
thanks for pointing me to the article. Haven't read it yet, but will do so pretty soon. As you say, I can determine where the ray itnersects with the obejct, that's no prob. The problem is that for each pixel in the output image, I need to cast a ray. But how do I know which way to cast him from the light source? (I guess I'll find out in the article, still your answer is appreciated)

Share this post


Link to post
Share on other sites
Quote:
Original post by Caesar
I'd like to write a very basic raytracer. I've read one or two tutors but what I'm still unsure about is how to get what object (I guess I'd need that to calculate the intersetion of the object/primitve/whatever with the ray I'm casting) corresponds to a texel on my scene. Shall I first render the whole thing into a buffer (each object = one color in the buffer) or are there better ways?


In a previous thread about raytracers someone recommended this tutorial[http://www.permadi.com/tutorial/raycast/].

hope it helps, and happy coding.

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!