Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

RajanSky

Refraction in ray tracing

This topic is 5584 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 trying to write a ray tracer and I am having trouble getting refraction to work. Part of the problem is that I''m really not sure what a proper refraction is supposed to look like! I have some screenshots, could someone tell me if these look right? Here''s the first one: at the edges, the refraction suddenly stretches outwards in a really weird way.. http://www.ews.uiuc.edu/~rsharma/easter1.gif The second one: a lot like the first, except you can see it better http://www.ews.uiuc.edu/~rsharma/easter2.gif The third: this one just looks weird.. the yellowish sphere at the top seems to be occluded by the refracting sphere, but I don''t see why it should occlude anything since it''s transparent! http://www.ews.uiuc.edu/~rsharma/easter3.gif Well if anyone knows what might be messed up with these (or- if they''re correct even!) please let me know! Thanks a lot! Raj

Share this post


Link to post
Share on other sites
Advertisement
Well, the first two pictures are looking right. I think you are using IOR''s for refraction, an those ''outward stretches'' are because inner reflection-> the ray enters the sphere and is refracted depending on the IOR of the sphere then it hits te border of the sphere, but it doesnt leave the sphere, because the angle ray/normal iss too little..so it is reflected

But the third picture looks wrong also to me........

Share this post


Link to post
Share on other sites

  • 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!