Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PBR Materials Support #49

Open
tonyf opened this issue Jun 14, 2023 · 4 comments
Open

PBR Materials Support #49

tonyf opened this issue Jun 14, 2023 · 4 comments

Comments

@tonyf
Copy link

tonyf commented Jun 14, 2023

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

@tonyf tonyf changed the title PBR Materials? PBR Materials Support Jun 14, 2023
@robertsulej
Copy link
Member

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.

@robertsulej
Copy link
Member

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. :)

@tonyf
Copy link
Author

tonyf commented Jul 26, 2023

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.

@robertsulej
Copy link
Member

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 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants