Help optimizing my raytracing

Started by
9 comments, last by cignox1 14 years, 1 month ago
Quote:Original post by svnstrk
im not quite understand the antialiasing part. can you give me a hint? well yes there is not much difference between 10, 20, or 100 except the soft shadow at 10 or 20 sample looks 'ugly'. and yes im doing it on release build :D
what is the definition of large light? is there some kind of measurement?


Look at the two Sponza renders: IIRC I did use 32 samples per pixel for antialiasing, and something between 15-25 samples for the two area lights (sky and sun). Another poin light provides an ambient term (one more shadow ray). 10 minutes each, for a 640x480 resolution. If I had a 1900 x 1200 this would have required more than an hour, close to 5 hours if I used only 1 core on a 2.6Ghz CPU. If I also had reflective/transmissive objects, the rendering times would have been even higher. Doing antialiasing means shooting more primary rays per pixel, as you do with lights, and 'averaging' the result. This reduces aliasing in the image. From your code is not clear if you do this or not, but if you do and use 100 spp, then you have way too many rays.

Quote:
im curious why 3d apps renderer is so damn fast, rendering stuff within 2 minutes with such amount of triangle, and mine is like hours to build. any advice


The numberr of triangles becomes less of a problem once you have an acceleration structure (BIH/BVH/Kd-tree), but 21 triangles is not so far from the number of triangles you would test in a medium sized scene anyway, so it could be considered a good test. And 12 hours are simply too much. Post more code, perhaps the problem is elsewere (i.e. your intersection code).

EDIT: try by setting sample=1. This should be really fast to render. What timing do you get?

EDIT: to answer your last question, raytracers often use advanced techniques to speed up the computations. They heavily optimize the core routines up to the assembly level, making use of vector instructions (i.e. SSE) where available. In addition, the optimize cache behaviour, and sometimes trace more rays at the same time when CPU instructions make them able to process them in parallel.
Another trick is adaptive AA (you trace AA rays only where required).

I'm currently fighting against my BIH builder because no matter what I do, I can't speed it up even while it is clearly quite slow :-(

[Edited by - cignox1 on March 8, 2010 9:26:03 AM]

This topic is closed to new replies.

Advertisement