Lighting-System-2D icon indicating copy to clipboard operation
Lighting-System-2D copied to clipboard

polygon_from_sprite_precice.gml

Open jgric2 opened this issue 3 years ago • 7 comments

I had an idea after using another lighting system to create an automatic mesh maker based on the sprite itself, it takes the sprites origin point and then casts rays from the origin point to the border and uses transparent values as the edges of the sprite, it will then take those points and generate mesh for shadows in the engine from that.

the script has 3 modes: Greedy: this mode will cast rays from the center but will terminate the ray at the first instance of a transparent pixel. The user can choose how many points the poly has from 4 to 360. Normal: this mode will cast rays from the center until said ray reaches the border of the sprite, when it does it uses the last known transparent pixel fro that ray. The user can choose how many points the poly has from 4 to 360.

Auto: this mode was a test, it casts rays from the outside in, it produces a fixed number of points for the polygon being width+height+width+height

I will make an update in the coming days to make compatible with dynamic meshes. Enjoy!

jgric2 avatar Jul 28 '21 09:07 jgric2

hello??

jgric2 avatar Nov 07 '21 12:11 jgric2

Sigh....

jgric2 avatar Oct 05 '23 07:10 jgric2