Repository navigation
[vmm] Using a single lobe for the isotropic HG phase function - #49
Open
wantonsushi wants to merge 1 commit into
Open
wantonsushi wants to merge 1 commit into
wantonsushi wants to merge 1 commit into
Conversation
sherholz
requested changes
Nov 8, 2026
| representations[0].weights[2] = 0.0f; | ||
| representations[0].meanCosines[2] = 0.0f; | ||
| representations[0].kappas[2] = 0.0f; | ||
| representations[0].normalizations[2] = 0.07957747154594767f; |
Contributor
There was a problem hiding this comment.
The normalization factor should still be the one for a kappa of zero VMF lobe to be valid.
Only the weights of the other components need to be set to 0.0.
Contributor
Author
There was a problem hiding this comment.
Fixed. For the record, I did it that way because all the slot [3] entries do
Signed-off-by: Euan Hughes <realeuanhughes@gmail.com>
wantonsushi
force-pushed
the
perf-isotropic-phase-lobe
branch
from
November 9, 2026 20:10
84ff895 to
c2b52fd
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This change is a small performance improvement suggestion.
The isotropic entry of the HG phase function table ($\lvert g \rvert \approx 0$ ) holds three identical uniform lobes. So
representations[0], used forApplySingleLobeHenyeyGreensteinProductcomputes the same product three times, andSamplePDFandPDFevaluate the same mixture three times.This unnecessarily slows down guiding in isotropic media. The same distribution can be represented with one uniform lobe of weight 1.
On my PC a guided scatter at g = 0 takes 430 ns, vs 262 ns after this proposed change.