computer graphics & visualization
Raytracing … or where did my performance go? M.G. Chajdas
Ray-tracing Name says it all: Trace rays – Lots of rays – And some more Hardware vendors love it!
Ray-tracing
Goal
The rendering equation 5D: BRDF 5D: BRDF 4D: Light Result
Rendering equation If you think it‘s complex … It doesn‘t capture: – Phosphoresence – Flurorescence – Intereference – Subsurface scattering
Solving the equation Maple? Matlab?
Rendering equation What makes it complicated to evaluate? Outgoing light depends on incoming light I.e. it‘s recursive
Direct illumination
Global illumination … Loss of energy with more bounces!
Global illumination Mirror-BRDF:
Global illumination Diffuse-BRDF:
How to get it fast? Clever sampling Clever intersections
Sampling
Intersections
Classic search problem Trees to the rescue – Space partitioning: Subdivide the space – Object partitioning: Group objects
BSP
struct Plane { float normal [3]; float dist; }; struct Node { int plane; int children [2]; int boundingBoxMin [3]; int boundingBoxMax [3]; }; struct Leaf { int cluster; int area; int boundingBoxMin [3]; int boundingBoxMax [3]; int firstFaceIndex; int faceCount; int firstBrushIndex; int brushCount; }; Use the source, Luke!
BVH
Raytracing, recap Raytracing can solve the rendering equation – It can simulate all light transport paths Requires lots of rays – Sample the important directions only, so less rays are wasted – Build acceleration structures so each individual ray is cheap
Raytracing, limitations