Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CSMShader: Add missing getPointShadow() argument. #30771

Merged
merged 1 commit into from
Mar 20, 2025

Conversation

brentyi
Copy link
Contributor

@brentyi brentyi commented Mar 20, 2025

#28588 adds an intensity argument to the getPointShadow() function, but this wasn't updated in the CSM add-on.

If we add a point light into the CSM example:

diff --git a/examples/webgl_shadowmap_csm.html b/examples/webgl_shadowmap_csm.html
index 41bb816..7d00a08 100644
--- a/examples/webgl_shadowmap_csm.html
+++ b/examples/webgl_shadowmap_csm.html
@@ -95,6 +95,11 @@
                                const ambientLight = new THREE.AmbientLight( 0xffffff, 1.5 );
                                scene.add( ambientLight );

+                               const pointLight = new THREE.PointLight( 0xffffff, 5, 500, 0 );
+                               pointLight.castShadow = true;
+                               pointLight.position.set(-200, 150, 100);
+                               scene.add( pointLight );
+
                                const additionalDirectionalLight = new THREE.DirectionalLight( 0x000020, 1.5 );
                                additionalDirectionalLight.position.set( params.lightX, params.lightY, params.lightZ ).normalize().multiplyScalar( - 200 );
                                scene.add( additionalDirectionalLight );

Previously, we'd get a blank viewport:

image

And this error:

ERROR: 0:968: 'getPointShadow' : no matching overloaded function found

After this change, we can render all lights/shadows:

image

@Mugen87 Mugen87 added this to the r175 milestone Mar 20, 2025
@Mugen87 Mugen87 merged commit bf4e6fc into mrdoob:dev Mar 20, 2025
11 checks passed
@Mugen87 Mugen87 changed the title Add missing getPointShadow() argument in CSM Shader CSMShader: Add missing getPointShadow() argument. Mar 20, 2025
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