Computer graphics in Game development - summer 2023
In the case of 1 ray per pixel without additional ray casting the complexity of ray tracing is
rays number * (triangles number * MT algorithm cost + Closest Hit cost)
Computer graphics in Game development - summer 2023
In the case of 1 ray per pixel without additional ray casting the complexity of ray tracing is
rays number * (triangles number * MT algorithm cost + Closest Hit cost)
Obj file was parsed to a vector of shapes. Each shape has its own vertex and index buffers. Let’s use the each shape as a single chunk for traversing. How we can find the shape-ray intersection?
float3 invRaydir = float3(1.0) / ray.direction;
float3 t0 = (aabb_max - ray.position) * invRaydir;
float3 t1 = (aabb_min - ray.position) * invRaydir;
float3 tmin = min(t0, t1);
float3 tmax = max(t0, t1);
return maxelem(tmin) <= minelem(tmax);
[3]
Surface area heuristic (SAH):
C(A,B)=ttrav+pAi=1∑NAtint(ai)+pBi=1∑NBtint(bi)
where C - cost of traversing the node, pA and pB are the probabilities that the ray passes through the subvolumes A and B [4]
Principles: create an image in the most effective way, immersive experience principle
Laws: rendering quation, Lambertian shading law
Variables: num of rays, num of triangles, num of acceleration structures, traversal cost
aabb
classbuild_acceleration_structure
method of raytracer
classtrace_ray
method of raytracer
class to traverse the acceleration structureray_tracing_renderer
class to build the acceleration structureTODO: Lab: 2.05 Axis-aligned bounding boxes
Why TLAS won’t speed up the Cornell box scene?
1. Lefrançois M.-K., Gautron P. DX12 raytracing tutorial - part 2 [Electronic resource]. URL: https://developer.nvidia.com/rtx/raytracing/dxr/DX12-Raytracing-tutorial-Part-2.
2. Parker S.G. et al. OptiX: A general purpose ray tracing engine // ACM SIGGRAPH 2010 papers. New York, NY, USA: Association for Computing Machinery, 2010.
3. McGuire M. The graphics codex. 2.14 ed. Casual Effects, 2018.
4. Pharr M., Jakob W., Humphreys G. Physically based rendering: From theory to implementation [Electronic resource]. 2021. URL: https://pbr-book.org/.