-
-
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
Support shadow intensity #14087
Support shadow intensity #14087
Conversation
I think that for a more customized scene it should be per light |
I do not think a per-light shadow intensity is possible with /ping @bhouston It the capability to control shadow intensity a worthwhile addition in your view -- or too hacky? |
Closed due to lack of interest. |
I'm definitely interested! I'm not qualified to review the patch, but I'd use it if it landed… |
For a workaround, you can use two lights: var shadowIntensity = 0.5; // between 0 and 1
var light2 = light1.clone();
light1.castShadow = true;
light2.castShadow = false;
light1.intensity = shadowIntensity;
light2.intensity = 1 - shadowIntensity; |
Wow, that's brilliant in its simplicity! I wrestled with this problem for a bit and that solution never occurred to me. Thank you! |
I think modulating the shadow intensity is something desirable for the library. I vote to reopen the PR and merge it with proper documentation. |
My issues with shadows are on the mesh level and would like to see it there. For instance a mesh with 10% opacity should not have a full shadow. |
Saved me a lot of heartache. Thanks! |
@WestLangley Modulating shadow intensity or darkness for artistic purposes is a feature request that repeatedly comes up (latest request from the forum). The workaround via lights provides a solution but it would be easier and more intuitive to configure a property per light shadow as suggested in #14087 (comment). Now that I have implemented this feature in Mugen87@65510a7 and it can be tested with this link: Would you support this change? |
Yes. I support adding shadow intensity for artistic purposes, as I did in #8238. Please note that shadow intensity should take values in [ 0, 1 ]. Your example allows values larger than that, and the example should be corrected. |
As proposed in #8238.
The shadow intensity (darkness) can be changed without affecting the overall illumination of the scene.
This implementation adds a single uniform,
renderer.shadowIntensity
, that takes a value in [ 0, 1 ], defaulting to 1.The approach works with (Gouraud)
MeshLambertMaterial
-- whose shadows are an approximation -- and it also works with the other built-in materials, where shadows are implemented correctly as the absence of light. (MeshLambertMaterial
does not accommodate a per-light shadow intensity.)I can add docs later if this is merged.