Skip to content

PMREM: Simplify GGX VNDF importance sampling.#32737

Merged
Mugen87 merged 1 commit into
mrdoob:devfrom
Mugen87:dev5
Jan 13, 2026
Merged

PMREM: Simplify GGX VNDF importance sampling.#32737
Mugen87 merged 1 commit into
mrdoob:devfrom
Mugen87:dev5

Conversation

@Mugen87
Copy link
Copy Markdown
Collaborator

@Mugen87 Mugen87 commented Jan 13, 2026

Related issue: #32692

Description

The PR simplifies importanceSampleGGX_VNDF() for both renderers since the second parameter V always has the value of (0, 0, 1). That makes certain computations redundant. By removing them, we also fix one of the DirectX warnings reported in #32692.

warning X4008: floating point division by zero

I've tested the fix on a Windows system and the warning is indeed gone.

@github-actions
Copy link
Copy Markdown

📦 Bundle size

Full ESM build, minified and gzipped.

Before After Diff
WebGL 355.41
84.51
355.15
84.44
-253 B
-69 B
WebGPU 621.21
172.51
621.09
172.46
-118 B
-49 B
WebGPU Nodes 619.82
172.27
619.7
172.22
-118 B
-51 B

🌳 Bundle size after tree-shaking

Minimal build including a renderer, camera, empty scene, and dependencies.

Before After Diff
WebGL 487.36
119.29
487.11
119.23
-253 B
-64 B
WebGPU 691.86
187.79
691.75
187.75
-118 B
-46 B
WebGPU Nodes 641.66
174.96
641.55
174.91
-118 B
-45 B

@mrdoob mrdoob added this to the r183 milestone Jan 13, 2026
@Mugen87 Mugen87 merged commit 8380531 into mrdoob:dev Jan 13, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants