-
-
Notifications
You must be signed in to change notification settings - Fork 35.4k
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
Textured lighting as a spotLight.map property #14621
Conversation
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.
Build files should not be part of the PR.
good to know ! |
7dfc774
to
8d683b8
Compare
(Rebased on dev after shadowmap/fog was fixed by #14617) The second commit ( 5ccf289 ) adds :
This PR is now ready for review. |
fd5282c
to
5ccf289
Compare
@mrdoob @WestLangley , any feedback on this long awaited feature ? |
I definitely support this feature. I am sure working, live links would be helpful to @mrdoob. |
sure !
|
@mbredif I think this can be a great addition to the Threejs. At my company, we are trying to use this branch, and being a noob with shaders, how would you handle rotation of the texture (maybe use Texture.rotation? |
Please file a PR against mine if you go for the second option ! :) |
Thank you! I will try the second option. |
This was an excellent contribution by @mbredif, IMO. I am disappointed it has not received the attention it deserves. |
So sad this was never implemented, would have been awesome |
Let me correct : textured spotlights ARE implemented in this PR. However it has not been merged yet... |
Sorry, this PR has lacked attention in the last month. I would also like to see this feature merged! However, I would only put effort in resolving the merge conflicts if @mrdoob is fine with this. Maybe he wants to head in another direction in context of textured lighting. BTW: I think one spotlight example is sufficient to demonstrate this new feature. Hence, I would undo the changes to |
Any idea if this will get merged soon? |
Not my call unfortunately... I can update the PR if I get a green light that this is very likely to be merged by a maintainer @mrdoob @WestLangley @Mugen87 |
@mbredif Not sure if having a milestone assigned can be considered "likely to be merged", but I would love to see this PR updated to current dev. Really nice work! |
@mrdoob I did not see you attached a milestone. Is it a green light that says that a rebase is likely to be merged ? |
Yes! Sorry for the... 2 years late review... 🙁 I think the Looks good to me! Any chance you can rebase/resolve the conflicts? |
Did this not get added in r120 as planned? Looks great and am really looking forward to having this support built in. Thanks! |
Friendly pinging @mbredif cause I am not sure he receives notifications. |
@trbll The PR has conflicts... |
Sorry for the delay, I started rebasing this very old PR but it had a lot of conflicts due to the reformating of the glsl code. I was too busy to polish it but I am quite there. |
I got it working again : dev...mbredif:spotLightMap2 |
Whatever is easier for you 👍 |
rebased version of this PR is available at #20290 |
This PR is a second attempt at #13057, by adding a
colorMap
map
property to theSpotLight
class :http://localhost:8000/examples/webgl_shadowmap_viewer.html
This PR generalizes the single-channel cookie concept to a 4-channel texture : the
directLight.color
of the spot light ismix
ed with the rgb value of thecolorMap
lookup with a ratio corresponding to its alpha value :mix( directLight.color, spotColor.rgb, spotColor.a )
. The cookie effect is reproduced using pixel values(0,0,0,1-cookie_value)
.Comments :
with this PR, each spotLight takes an extra texture slot (similar to Implement Projectors to support textured lighting #13057 (comment)). Is it an issue ? any idea ?(the second commit 8d683b8 addresses this issue.)spotShadowMatrix
is used for texture lookup). This will be tackled in a follow-up PR if this one gets merged.