-
-
Notifications
You must be signed in to change notification settings - Fork 35.5k
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
SpotLightMap v3 #21944
SpotLightMap v3 #21944
Conversation
679ed5c
to
3f79a4f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The PR seems to work fine! I've just simplified webgl_lights_spotlight
a bit.
However, I do not vote to change webgl_shadowmap_viewer
. IMO, the additional light with its camera helper make the visuals crowded. @mrdoob Please double check^^.
I agree that examples should be simplified (removing the video from webgl_lights_spotlight and leaving webgl_shadowmap_viewer untouched). They were there only to show/test the PR. |
Agreed 👍 |
Okay, reverted the changes to |
Let's get this done, I'm dreaming of this 🙏 😭 Are there any blockers at the moment ? Can I help in any way ? |
Is this PR under consideration to be included in the future, or is the milestones automatically increased? Would love this feature :) Wish I could help, but would just mess things up. |
|
||
#if defined(USE_SHADOWMAP) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) | ||
spotLightShadow = spotLightShadows[ i ]; | ||
directLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
directLight.visible && receiveShadow
is better than all( bvec2( directLight.visible, receiveShadow ) )
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe, I am just following the same pattern as the other tests in this file.
Thanks! Sorry that it took... 4 years... 🫣 |
That is a matter of taste
|
That looks much better! @WestLangley What do you think? |
Do you mean directLight.color = spotLight.color * spotColor.rgb |
I gave a try in #24539 to enable the use of spotlight textures with and without the cone of light effect. Let's switch the discussion there :) |
* SpotLightMap * Update webgl_lights_spotlight.html Simplify spot light example. * Update WebGLProgram.js * Update lights_fragment_begin.glsl.js * Update WebGLLights.js * Update SpotLight.html * Update SpotLight.html * Update SpotLight.js * Update shadowmap_vertex.glsl.js * Update SpotLight.js * Update lights_fragment_begin.glsl.js * Update SpotLight.html * Update SpotLight.html * Update shadowmap_vertex.glsl.js * Update shadowmap_vertex.glsl.js * Update WebGLLights.js * Update WebGLLights.js * Update shadowmap_vertex.glsl.js * Update WebGLLights.js Co-authored-by: Michael Herzog <[email protected]> Co-authored-by: mrdoob <[email protected]>
* SpotLightMap * Update webgl_lights_spotlight.html Simplify spot light example. * Update WebGLProgram.js * Update lights_fragment_begin.glsl.js * Update WebGLLights.js * Update SpotLight.html * Update SpotLight.html * Update SpotLight.js * Update shadowmap_vertex.glsl.js * Update SpotLight.js * Update lights_fragment_begin.glsl.js * Update SpotLight.html * Update SpotLight.html * Update shadowmap_vertex.glsl.js * Update shadowmap_vertex.glsl.js * Update WebGLLights.js * Update WebGLLights.js * Update shadowmap_vertex.glsl.js * Update WebGLLights.js Co-authored-by: Michael Herzog <[email protected]> Co-authored-by: mrdoob <[email protected]>
rebase of #20290