Replies: 3 comments 1 reply
-
Isn't this a feature that is game/project specific? It really isn't something that belongs in the game engine. If you need suggestions or help on how to implement such a thing, then there are more appropriate places to be asking such questions, such as the Discussions section. |
Beta Was this translation helpful? Give feedback.
-
I guess you need: https://www.codeandweb.com/spriteilluminator/tutorials/how-to-use-light-effects-with-axmol-game-engine |
Beta Was this translation helpful? Give feedback.
-
it's typically done with a fragment shader that is run on all of your sprites that are light affected, that shader can have an array of structs that explain where and how strong the lights are, but that's bad since you only have as many lights as the uniform size of your gpu can support, a better approach is to use render textures, your light objects can be sprites that have a shader, that shader doesn't need any texture but just a circular gradiant where in the middle it's white and the further it is from the center the more transparent pixels are, and then render your main sprites on another render texture, and overlay the two render textures by subtracting rt1 from rt2 on a third texture to get lighting, you can even exclude elements from lighting by not rendering them to the second render texture, what I just described is differed rendering for 2D, it's much more complex for 3D, the second technique of using render textures gives the benefits of batching since sprites are just quads with custom shaders that act like light. hope this helps. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
Describe the solution you'd like
A clear and concise description of what you want to happen.
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Additional context
Add any other context or screenshots about the feature request here.
Beta Was this translation helpful? Give feedback.
All reactions