Skip to content

Conversation

@sunag
Copy link
Collaborator

@sunag sunag commented Nov 24, 2025

Related issue: #32295

Description

Add built-in support for SSS using pass context and update the example.

SSS Pre-Pass
SSS No Pre-Pass

@github-actions
Copy link

github-actions bot commented Nov 24, 2025

📦 Bundle size

Full ESM build, minified and gzipped.

Before After Diff
WebGL 358.3
86.96
358.3
86.96
+0 B
+0 B
WebGPU 620.54
174.18
620.64
174.2
+103 B
+25 B
WebGPU Nodes 619.14
173.92
619.25
173.95
+103 B
+25 B

🌳 Bundle size after tree-shaking

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

Before After Diff
WebGL 490.25
121.78
490.25
121.78
+0 B
+0 B
WebGPU 691.41
189.78
691.52
189.81
+103 B
+30 B
WebGPU Nodes 632.86
172.96
632.96
172.99
+103 B
+29 B

@Mugen87 Mugen87 added this to the r182 milestone Nov 24, 2025
@sunag sunag marked this pull request as ready for review November 24, 2025 21:18

const sssSample = sssPass.getTextureNode().sample( screenUV ).r;

const sssContext = context( {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the future, do you think we could simplify this bit somehow? Maybe:

scenePass.contextNode = context( {
    sss: sssPass.getTextureNode().sample( screenUV ).r
} );

The instance of SSSNode has a reference to the directional main light so maybe you could hide some of this code in AnalyticLightNode.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I still have to think of a way to simplify this utilization.

@sunag sunag merged commit 47e0b18 into mrdoob:dev Nov 24, 2025
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