OpenSubDiv is an open soure library developed by Pixar (yes, that Pixar) to efficiently subdivide meshes. Its a really cool piece of software that greatly simplified my quest to pretty up meshes in Gaia.
Subdivision is, in a nutshell, the process of taking a mesh and splitting each quad or triangle that its made of into many more, which makes the mesh look much smoother when rendered. OpenSubDiv provides two algorithms for this: Catmull-Clark (“Catmark”) and Loop subdivision. Catmark is more commonly used (many CAD programs use this), however for triangle-based meshes Loop subdivision is preferable. Gaia triangulates all meshes when loaded to prevent any errors anyway, so it made sense to pick Loop.
Subdivision is done recursively, and you can set a limit as to how many times the scene should be subdivided. In an ideal world we’d go for as many subdivisions as possible, but each subdivision greatly increases the memory required by the scene and massively slows down the render due to the increased complexity of the bvh.
After subdivision, the triangles are assigned the material of thier ‘parent’ object; which I’m very glad that OpenSubDiv keeps track of as that would be a pain to deal with otherwise. This allows me to easily propagate down the existing material assignments to the new triangles.
Due to the performance, I’m probably going to keep subdivision off in test scenes going forward. But when looking for beauty shots I’ll probably stick to ~2-3 iterations, depending on the mesh being used. Four subdivisions of the Mini mesh takes up over 4GB in memory, meaning it is infeasible to go above this on my laptop with a paltry 8GB of RAM. But given how long it would take to render at that point I’m not too upset at that – I like being able to use my laptop for other things as well.
For now though I’m pretty happy with where the mesh system in Gaia has got to – it’s a bit clunky for the most part but does the job nicely. Next I want to try and tackle Monte Carlo rendering again, hopefully cracking this should allow for far less noisy images in the future.
Release 0.2
Rendering methods:
- Distributed (stochastic) path tracing
- Monte Carlo path tracing (in-progress)
- Edge Line pass
- Z-Depth pass
Objects:
- Spheres
- Quads (buggy)
- Triangles
- Triangle meshes from .obj files (with subdivision)
Material BRDFs:
- Ideal Lambertian, dielectric, metallic
- Oren-Nayar reflectance model (buggy)
- Blinn-Phong shading model (in-progress)
- Diffuse area lights
- Gooch shading
Acceleration structures:
- In-core multithreading support
- Bounding volume hierarchies
- Axis-aligned bounding boxes
Output file types:
- .hdr
- .ppm