Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!


1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


Ray tracer minor issue


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
3 replies to this topic

#1 george7378   Members   -  Reputation: 1328

Like
0Likes
Like

Posted 03 March 2014 - 06:44 PM

Hi everyone,

 

Here's a picture from my ray tracer:

 

pyramid1.png

 

It looks mostly find but if you zoom in on the top sphere in the pyramid (a glass one with a refractive index of 1.5), you can see that there are some dark pixels which shouldn't be there. These don't show up if I remove the glass sphere and they don't show up on any of the reflective ones.

 

I've tried replacing it with another sphere with a refractive index of 1 (so no deviation to the light's path) but I still get these weird artefact pixels (in different places though). Has anyone else come across the same problem while creating a ray tracer? I tried changing my maximum ray depth to be larger but it made no difference.

 

Thanks!



Sponsor:

#2 Bacterius   Crossbones+   -  Reputation: 11357

Like
3Likes
Like

Posted 03 March 2014 - 06:54 PM

Are you pushing your rays in/out sufficiently to prevent self-intersection? What does your refraction code look like? It's possible it has a bug that causes light paths refracted at some height/angle to get stuck inside the sphere and never escaping, so increasing the ray depth would not change anything (think getting stuck between two mirrors, different geometry but similar problem).

 

Just a guess, though. It's hard to tell. Maybe try removing the Fresnel for now to try and isolate the bug.


“If I understand the standard right it is legal and safe to do this but the resulting value could be anything.”


#3 Krypt0n   Crossbones+   -  Reputation: 3451

Like
4Likes
Like

Posted 03 March 2014 - 08:40 PM

enable floating point exceptions, that way you'll usually hunt down most of those issues (even some more hidden that you might not even notice visually).

 

in my tracers I've usually added a ray picking for debugging, at the place you click with the mouse cursor, I simply cast a ray. in the debugger you setup a breakpoint at the trace function and then you can easily track down the source of the problem.



#4 george7378   Members   -  Reputation: 1328

Like
4Likes
Like

Posted 04 March 2014 - 02:02 AM

Thanks very much for the replies, Bacterius was correct - my bias was too small. I don't know why I didn't think of that, it's sitting there right underneath my ray depth constant, in big capital letters!

 

Krypt0n - I also enabled floating point exceptions (at least I think I did!) and ran my program in debug in VS2012 and nothing showed up. Thanks for the suggestion :)






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS