Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Alongside the rest of the initialization for
subpixel_radiance, an emptyMediumStackis initialized. Its behavior is conceptually similar to the existingCompositeBSDF. Media are stored in a statically allocatedcharpool, with pointers maintained inmediums[MaxMediums]. In processing medium closures, eitherHomogeneousMediumorEmptyMediumare 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 withMxDielectricorMxGeneralizedSchlickmay only be added whenpriority < current_priorityor are both 0 (the precious priority). Attached to theMediumStack, anintegratemethod transmittance samples each medium and scatters using the phase function of the highest priority medium. As of now, onlyHenyeyGreensteinis implemented and inherits fromBSDF.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-anisotropicwith OptiX references of the latter two. The images forrender-mx-generalized-schlick-glassandrender-mx-dielectric-schlick-glasshave been updated as well.Checklist:
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.