three.js icon indicating copy to clipboard operation
three.js copied to clipboard

SpotLightMap v3

Open mbredif opened this issue 3 years ago • 8 comments

rebase of #20290

mbredif avatar Jun 02 '21 18:06 mbredif

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.

mbredif avatar Jun 04 '21 11:06 mbredif

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 👍

mrdoob avatar Jun 04 '21 14:06 mrdoob

Okay, reverted the changes to webgl_shadowmap_viewer.

Mugen87 avatar Jun 06 '21 08:06 Mugen87

Let's get this done, I'm dreaming of this 🙏 😭 Are there any blockers at the moment ? Can I help in any way ?

crubier avatar Dec 19 '21 19:12 crubier

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.

inear avatar Mar 21 '22 20:03 inear

this would be really useful for me for an upcoming project, I would be happy to handle the merge conflicts

AdaRoseCannon avatar Jun 25 '22 14:06 AdaRoseCannon

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?

usefulthink avatar Aug 02 '22 18:08 usefulthink

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.

Mugen87 avatar Aug 02 '22 19:08 Mugen87

@usefulthink @Mugen87 , I just rebased this PR !

mbredif avatar Aug 23 '22 09:08 mbredif

Thanks! Sorry that it took... 4 years... 🫣

mrdoob avatar Aug 24 '22 16:08 mrdoob

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

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

Makes me wonder if SpotLight is the right place for this... Maybe we should create RectLight/RectangularLight?

mrdoob avatar Aug 24 '22 16:08 mrdoob

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)

image

mbredif avatar Aug 24 '22 17:08 mbredif

That looks much better!

@WestLangley What do you think?

mrdoob avatar Aug 24 '22 18:08 mrdoob

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

WestLangley avatar Aug 24 '22 18:08 WestLangley

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 :)

mbredif avatar Aug 25 '22 10:08 mbredif