KhronosGroup / ANARI-Docs

ANARI Documentation
Other
31 stars 8 forks source link

Two-sided Surface extension #110

Open progschj opened 1 year ago

progschj commented 1 year ago

Inspired by this: https://github.com/NVIDIA/VisRTX/issues/63

To accomodate face culling an extension could add additional material parameters materialFront, materialBack for surface objects. They would override the stock material parameter for that side of the surface.

Back/front face culling would then be achieved by setting a fully transparent material on that side. Additionally the extension could specify that setting no material is valid and define the behavior to transparency.

jeffamstutz commented 1 year ago

After today's WG discussion, this is what I would propose:

jeffamstutz commented 1 year ago

@johguenther There was reasonable consensus on today's call with the formulation of the extension listed above. Unless you have any other dissenting opinions, we can change the status to ready for proposal. I'm planning to implement it anyway in VisRTX to get some initial experience.

johguenther commented 1 year ago

I would really like to not intertwine the extension "backface culling" with the feature to have two different (solid) materials front and back. Just focusing on the latter, that request can be solved by e.g. keeping the material mandatory and optionally add a materialBack (or materialInside) parameter plus stating that "handling of transparency is implementation defined" (or stronger defining that material are treated opaque). The "Physically Based" material already implicitly treats a surface as inside/outside via properties ior and attenuation. This has the benefit that more implementations can support this extension. For example, backface culling is hard to impossible to implement for photonmapping, or BiDir path tracing.

materialFront and materialBack behave where viewing the surface from the front or back uses the respective material, and remains true for any effect that may "see" the surface (e.g. shadow rays)

There is no defined direction for shadow rays (from light to surface or vice versa).