Sign in to follow this  
Caesar

Raytracer - 1 basic question

Recommended Posts

Caesar    126
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
Caesar    126
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
prh99    520
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

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