OpenShadingLanguage icon indicating copy to clipboard operation
OpenShadingLanguage copied to clipboard

Add testrender volumes

Open ThyOwen opened this issue 1 month ago • 0 comments

Description

Alongside the rest of the initialization for subpixel_radiance, an empty MediumStack is initialized. Its behavior is conceptually similar to the existing CompositeBSDF. Media are stored in a statically allocated char pool, with pointers maintained in mediums[MaxMediums]. In processing medium closures, either HomogeneousMedium or EmptyMedium are inserted into the medium stack. There is a simple priority handling scheme that will shuffle the incumbent medium pointers to give high priority mediums lower indices. They both inherit from a shared CRTP interface, Medium. When processing BSDF closures, intersections with MxDielectric or MxGeneralizedSchlick may only be added when priority < current_priority or are both 0 (the precious priority). Attached to the MediumStack, an integrate method transmittance samples each medium and scatters using the phase function of the highest priority medium. As of now, only HenyeyGreenstein is implemented and inherits from BSDF.

With this being both a sizable update and my first commit to the project, I’m more than happy to iterate on this.

Tests

render-mx-medium-glass, render-mx-medium-vdf, render-mx-medium-anisotropic with OptiX references of the latter two. The images for render-mx-generalized-schlick-glass and render-mx-dielectric-schlick-glass have been updated as well.

Checklist:

  • [x] I have read the contribution guidelines.
  • [ ] I have updated the documentation, if applicable.
  • [x] I have ensured that the change is tested somewhere in the testsuite (adding new test cases if necessary).
  • [x] My code follows the prevailing code style of this project. If I haven't already run clang-format v17 before submitting, I definitely will look at the CI test that runs clang-format and fix anything that it highlights as being nonconforming.

ThyOwen avatar Nov 30 '25 23:11 ThyOwen