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

[How to] Two-sided(double-sided) material binding #120

Open
1 task
syoyo opened this issue Jan 26, 2024 · 0 comments
Open
1 task

[How to] Two-sided(double-sided) material binding #120

syoyo opened this issue Jan 26, 2024 · 0 comments
Labels
documentation Improvements or additions to documentation

Comments

@syoyo
Copy link
Owner

syoyo commented Jan 26, 2024

What is two-sided material?

https://docs.chaos.com/display/VMAX/VRay2SidedMtl

Assign different material to front face and back face, respectively.

doubleSided attribute in USD(control the face culling)

https://openusd.org/dev/api/class_usd_geom_gprim.html#a63367a54086e014dda98cc79ad5f8602

doubleSided attribute indicates whether to use front-side only or use both sides of mesh surface. Thus doubleSided != two-sided(double-sided) material in USD!

So how to do two-sided material mapping in USD?

Bind material

Two-sided material mapping could be achieved by using purpose in material binding. Something like...

rel material:binding:preview = </frontMat>
rel material:binding:back:preview = </backMat>

We need a user's instruction which purpose name is treated as back-face material.

per-face material by GeomSubset

Possible solution would be describing multiple material bindings as the above in GeomSubset

uniform token subsetFamily:materialBind:familyType = "partition"

def GeomSubset "dbl_mat"
{
      uniform token elementType = "face"
      uniform token familyName = "materialBind"
      int[] indices = [0, 1, 5, ...]
      rel material:binding:preview = </frontMat>
      rel material:binding:back:preview = </backMat>
}

TODO

  • Consider it is possible to utilize Collection API for two-sided material assignment.
  • [] Move to wiki
@syoyo syoyo added the documentation Improvements or additions to documentation label Jan 26, 2024
@syoyo syoyo changed the title Two-sided(double-sided) material binding [How to] Two-sided(double-sided) material binding Jan 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

1 participant