Built-in light detection for when blend mode is lightonly #11029
almighty00ZEDD
started this conversation in
Engine Core
Replies: 1 comment 1 reply
-
The bool property will be This is OK as an approximation, but it might not be precise enough for some use cases as it'll return |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
Ever made a sprite's canvas material to blend mode lightonly? it does it's job pretty well by only revealing it when light hits it!
The missing functionality i wish the godot team would add is some signal for when the sprite is being revealed or not to use it as light detection, because what everyone does at the moment is using area2D and raycast which can slow the performance if the shapes are not circular...
So i checked the C++ code and my intuition was right, the core function for revealing the sprite based on light is just there, and just needs some extra code to bind a bool variable for the GDscript api to be used as a light detection signal!
This can save a lot of time and ressources especially if your game like mine is heavily based on light.
Thanks.
Beta Was this translation helpful? Give feedback.
All reactions