-
-
Notifications
You must be signed in to change notification settings - Fork 36k
Added 2 New SpotLight Examples #8485
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
Conversation
This adds second example with 3 animated spotlights converging.
adds both new spotlight examples
examples/webgl_lights_spotlight.html
Outdated
<script src="js/Detector.js"></script> | ||
|
||
<script> | ||
let container = document.getElementById( 'container' ); |
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.
Could you use var
instead of let
? AFAIK Safari doesn't support it yet.
Really like the examples by the way! |
Perhaps the single spotlight example could be embedded into the |
Thanks for the peer review, all excellent points.
Thanks for the peer review, and insights.
randomColor function checks for a material or if it's a property (of a mesh).
Random color set when clicked but control-click sets the target object to white.
If you control-click the target object is set to white (click randomizes color without CTRL).
I changed to this description well "A point light that can cast a shadow in one direction with a falloff cone." I put the examples at the top since they are most relevant.
Incorporated all recommendations. Added Click to Randomize color and a CTRL-click will set to object materials to white. I could change variable names to be more verbose. I would consider opening that can of worms in another issue but for now in this example TweenMax is fine, right? Oh I also moved the angle so when the penumbra is set to zero it overlaps the object, and so I also changed to a tighter penumbra too. |
Well I guess it's more Magenta Yellow and Cyan
I'm noting again a need to start another issue about changing the docs to reflect the changes in camera properties. ? spotLight.shadowMapWidth = 1024; |
This is what I was referring to when I suggested
|
Embedded Single SpotLight iframe example into SpotLight.html doc
This adds the single spot light example into the SpotLightHelper doc
Thanks @WestLangley I needed a little more direction on that. I remembered later I forgot the Helper but I knew it was not embedded but just keeping what it was like, but to at least add them as simple links first. |
Seems it made sense to add the Extra Examples after the Code Example, but maybe that needs rethinking?
My guess is the previous SpotLightHelper.html had newlines with carriage returns because it seems to have reformatted or replaced all lines. I'm not sure how that happened as they look like identical lines but they all get replaced. Maybe it had something to do with the html wrapper being inclusive, seems like a github bug to me? again not sure how that happened I hope it's okay because it's all corrected now? |
Wait a minute now I've rebased and I've got no shadow or something? |
Thanks! |
Unfortunately, shadow quality is degraded significantly as the angle is increased. This is a consequence of the recent changes automating the shadow frustum.
Please do. Follow the coding style of the other three.js examples. |
@WestLangley thanks for pointing out the issues on mobile totally embarrassing, as is crashes on mobile. Basically it sets the shadow map size based on the angle, but in the animated example it will tune down the map sizes further if the desired FPS is not being obtained. Also if it is-Mobile it will set the default map size lower and the desired FPS too. It as well changes the names to be more verbose. |
The first example focuses on the edge of one spotlights shadow. The properties are adjustable.
The second example has 3 animated spotlights. Their position, angle and penumbra are animated.
Where the lights converge as white light the shadows become R G B due to coloring from dual lights.