three.js
three.js copied to clipboard
SpotLightMap v3
rebase of #20290
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.
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^^.
Agreed 👍
Okay, reverted the changes to webgl_shadowmap_viewer
.
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.
this would be really useful for me for an upcoming project, I would be happy to handle the merge conflicts
Unless @mbredif is up to that, I would like to rebase this so it can finally land for a future version. I checked and the overall conflicts are really minimal, but doing a proper rebase of the individual comments would be pretty painful.
Would it be ok for me to squash rebase this and push the new commit with proper Co-authored-by
attributions? Or does anyone know a good strategy to keep the individual commits intact for a rebase?
What do you think @Mugen87?
Would it be ok for me to squash rebase this and push the new commit with proper Co-authored-by attributions?
That sounds good to me.
@usefulthink @Mugen87 , I just rebased this PR !
Thanks! Sorry that it took... 4 years... 🫣
After playing a bit with it, I find it strange that penumbra
doesn't interact with it...
![Screen Shot 2022-08-24 at 9 28 41 AM](https://user-images.githubusercontent.com/97088/186472700-2597a461-1cd9-4de4-bcef-232c4b2091ca.png)
Also, if you set penumbra
to 0
you can see the spotlight and the map on top:
![Screen Shot 2022-08-24 at 9 30 38 AM](https://user-images.githubusercontent.com/97088/186473047-9c661673-3b4b-472c-b78b-2f2c87f553fe.png)
Makes me wonder if SpotLight
is the right place for this... Maybe we should create RectLight
/RectangularLight
?
That is a matter of taste
-
mix( directLight.color, spotLight.color * spotColor.rgb, spotColor.a )
is how it is implemented : the spot texture alpha mixes the cone of penumbra and the rgb values of the texture. -
directLight.color * spotLight.color * spotColor.rgb
is maybe the kind of modulation you have in mind (alpha is unused), however that modulation does not allow to deactivate entirely the penumbra (which can now be done with a texture with alpha=1)
That looks much better!
@WestLangley What do you think?
directLight.color * spotLight.color * spotColor.rgb is maybe the kind of modulation you have in mind
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 :)