-
Notifications
You must be signed in to change notification settings - Fork 28
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
Light biased towards two sides? #27
Comments
yes, that can be an issue. Keep the research! The only problem i noticed was with "transparent" objects on top of background, and solved that in one of demos. This plugin is highly experimental and the fact that it was possible to do that on v4 is a miracle :) previous versoin based on pixi-v3 was really hacky. |
I think I fixed the issue. I changed ambient.frag.js code from
to
The key was removing "* max(dot(N, L), 0.0)" |
I tried the demo out locally and noticed that with an ambient light in the scene, the right side and bottom side of the rectangles are lit up (kind of neutral) when the point light is on the opposite sides.
I turned OFF directionalLight to be sure that wasn't it and the lighting issue remained (also directionalLight doesn't seem to do anything).
I boosted the ambient light brightness to 1.0 and that made the issue more apparent. After removing both ambient and directional lights the behavior is how I would expect (dark edges are always on opposite side of point light).
Is this a bug? This is problematic for my game because pink sided sprites (right-side and/or bottom side) do not darken when facing away from the point light. I'm going to try to hunt this issue down myself, but wanted to see if this is expected functionality or not. It's almost like AmbientLight washes out the red normal values.
The text was updated successfully, but these errors were encountered: