When you are creating triangle meshes for ray tracing or reusing meshes that have been successfully used in rasterization-based rendering, there are some pitfalls that can cause surprising performance issues.
Some mesh properties that have been acceptable in rasterization can be problematic in ray tracing or require specific handling to work as expected. This post reveals those pitfalls and gives practical advice to get around them.
- Avoid elongated triangles in meshes
- Rebuild deformable meshes when needed
- Be careful with degenerate triangles
- Merge and split meshes judiciously
- Optimize alpha tested meshes
Avoid elongated triangles in meshes
Thin and long, elongated triangles are rarely optimal in computer graphics, but they can be especially challenging for ray tracing acceleration structure building.
The acceleration structures are hierarchies of bounding volumes. The bounding volume of a long, thin mesh triangle contains a lot of empty space around the triangle and easily overlaps with many other triangles in the mesh. When tracing a ray against the mesh and traversing the acceleration structure, this leads to many failed intersection tests before finding the triangle that is hit by the ray (Figure 1).
Read the full post on the NVIDIA Developer Blog.