AmbientLight2D Node, Separating Sprite Tint and Ambient Light. #10307
ditiem-games
started this conversation in
2D
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
The
CanvasModulate
node changes the tint of sprites, and as the documentation states (thanks @huwpascoe):CanvasModulate
is used to darken the scene by specifying a color that will act as the base "ambient" color.You can see this "issue" here: GitHub Issue #94383
What I think is happening is that the normal (0, 0, 1) is used for light illumination in the absence of a normal map. So, subtracting just negates the normal (0, 0, 1). This means white for add, and black for subtract. When the normal map is present, that normal map is used instead of the default one, which results in what we see. But now
CanvasModulate
introduces the ambient light.These are different features: one is the sprite tint, and the other is the ambient color of a light. In other words, a tint is not the ambient color, but the opposite is correct: an ambient color produces a tint in the sprite.
My proposal is to separate these two features by creating a new node,
AmbientLight2D
. You can have severalAmbientLight2D
nodes (only oneCanvasModulate
per scene is allowed). Here is how some effects could be applied:AmbientLight2D
on a light layer used in the tilemap cell will remove the shadow cast by theLightOccluder2D
.AmbientLight2D
only affects sprites on light layer 1. Another AmbientLight2D on light layer 2 could define the color in RAW and be used to produce a glow withWorldEnvironment
node.Beta Was this translation helpful? Give feedback.
All reactions