Skip to main content
GameDev.net gamedev.net

PRO Tired of ads? Read GameDev.net ad-free and help keep the community independent with GameDev Pro — $3/month.

Ray Tracer pt2

Ray Tracer pt2

_the_phantom_
Not dead... · · 1 min read
414 0
So, I've fixed the graphical artifacts in the code, it was as suspected something todo with the refraction code;


However, while it "fixes" it I'm not too happy about the fix.

The problem was of course that it was saturating the colours leading to white spots on the image; now the clamping was handled before the conversion from floating point to 8Bit RGB in the main loop, however if I moved it from there to the RayTrace() function everything seems to work fine.

This bothers me on three levels;
1) why does it work when its there but no when it's in the main loop? Conceptually it's the same difference.
2) The code I'm using as a guide clamps in the main loop and works fine. Sure my code isn't 100% the same, but layout and maths wise it is.
3) This removes HDR abilities for now [sad] A nice HDR-tone mapped output is a future 'want' for this. However I'll worry about that later.

I'll ponder that while pushing on wards, chances are things are going to get re-written soon anyways to support things such as textures et al

Discussion

Loading comments...