plotoptix
plotoptix copied to clipboard
PBR Materials Support
Do you have any examples on how to use PBR materials in plotoptix? I'm working on transitioning rendering a trimesh scene from pyrender to plotoptix and trying to figure out the easiest way to map materials
There is a sample notebook; cell 4. has a few examples on how to use make_material()
function. Function is documented here, and here are available shaders.
For a better performance there are separate shaders for each basic case of materials, so e.g. transparency is handled only with Transparent...
shaders.
Other not obvious parameters are:
- RGB colors in
Transmissive
(glass, etc) materials are interpreted as the attenuation length. The range is 0 to inf., e.g. red glass color would be [100, 0, 0] and the actual color depends on the size of object, just like in the real world. - Roughness is a parameter of Oren-Nayar model, small values work well (~0.01). Base roughness can be modulated with the texture values.
Let me know if you need to setup something specific.
Ah.. there was a message from @skiler07 that I didn't manage to answer.
Yes, materials setup is still ugly in plotoptix. And right, now it is not possible to use e.g. metalness texture on a glass. These two have different radiance program codes, which makes them faster but less universal.
I'll add something more standard. Now I have some work in queue, but I'll arrive to this shader at some point as well. :)
Hm, with separate shaders as currently implemented, I wonder if there can be an easy way to load meshes with predefined material data (i.e. like in a glb). Could be useful to use assimp for loading geometries & materials such that plotoptix can support a ton of file formats out of the box.
Yes, that is on the list. I'll work on all the materials related issues after the noise-balanced work distribution and support for the micromesh displacement. Work distribution is practicaly ready, then displacement can take ~2 weekends :)