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

What are all the shader options in Open3D? #3530

Open
hhuang81 opened this issue Jun 2, 2021 · 2 comments
Open

What are all the shader options in Open3D? #3530

hhuang81 opened this issue Jun 2, 2021 · 2 comments
Assignees
Labels

Comments

@hhuang81
Copy link

hhuang81 commented Jun 2, 2021

When creating a mat = open3d.visualization.rendering.Material(), we usually assign a shader. So far I only saw and used "defaultLit"/"defaultUnlit"/"unlitLine", and I noticed that I can't find any documentation on the material shader options.

Can you please provide a full list of shader options here (and maybe a short explanation on what it does/how to use) or add it to the documentation? Thanks

@aklingsporn
Copy link

aklingsporn commented Jan 16, 2023

I'm not qualified to speak to functionality in the C++ language yet, but I've tracked down some possible shader options in order to create a list that others might find helpful. Hopefully, someone more knowledgeable in the art of rendering can build a full definition for each in iteration on this post.

"defaultLit"
"defaultUnlit"
"defaultLitSSR"
defaultLitTransparency
"unlitLine"
"normals"
"depth"

Give them a shot! I've used some of them successfully with .stl exports of STEP file models.

Source: Open3D/open3d/visualization/visualizer/O3DVisualizer.cpp


Edit: After looking into the site-packages portion of the Open3D python distribution, I see that these formats are all collected in the ".filamat" filetype. I've added my best guess at these parameters, based on those files. I have not differentiated these between mesh and point cloud applications.

"unlitSolidColor"
"unlitPolygonOffset"
"unlitLine"
"unlitGradient"
"unlitBackground"
"normals"
"infiniteGroundPlane"
"pointcloud"
"defaultUnlitTransparency"
"defaultLitSSR"
"defaultUnlit"
"defaultLit"
"colorMap"

Source: C:\Users\localUserName\AppData\Local\Programs\Python\Python3x\Lib\site-packages\open3d\resources

Test prior to using in your application. There are a few other .filamat filenames, but they appear to have different formatting.

@xjiangan
Copy link

xjiangan commented Apr 26, 2024

The .filamat files are compiled from .mat files in cpp/open3d/visualization/gui/Materials, which define what they do.

Only some of them are actually available, which are listed in defaults_mapping::shader_mappings. Others will fall back to kColorOnlyMesh as shown in FilamentScene::AssignMaterialToFilamentGeometry, which is actually kDefaultUnlit.

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

No branches or pull requests

6 participants