Optimization

Ray tracing vs Rasterization

Rasterization performance is affected mostly by triangle counts. Ray tracing performance is affected mostly by output resolution.

Ray Queries

A hardware bounding volume hierarchy (BVH) is built for each mesh. BVH's are used for intersecting rays with meshes. A BVH has a location represented by an AABB. Rays are checked against every AABB the ray passes through until a mesh surface is hit. The fewer BVH's a ray is checked against, the faster the scene. In areas where the player is, be conscious of where rays can pass through one ore more AABB's without hitting a mesh surface. Divide big meshes into smaller meshes when modeling to reduce open space in the AABB. Avoid the player being inside a mesh AABB. Scene performance will benefit from following these guidelines, but it's not always possible and performance can still be ok.

Reflection/Refraction

Reflection and refraction can bump ray counts quickly. Use only where most visually impactful.

Materials

Material counts and sizes impact GPU bandwith which can quickly affect game performance. Rayve does not currently offer texture compression/mip-mapping with filtering because just using materials 1k or smaller wherever visually tolerable before using 2k or 4k is very performant and meshes well with the temporal antialiasing.