I was playing around with shaders a little bit and decided to write a shader that can take a completely arbitrary amount of light sources. GLSL doesn't support arbitrarily large arrays, so I made a simple lua script that rewrites the shader whenever it needs to, doubling the amount of light sources it can take. I have always had sort of a fetish for code that writes other pieces of code at runtime And it works pretty well! Feel free to try it out!
Controls:
Left click to add a new light source (it appears below the screen and walks upwards, be patient!)
Right click to restart
Arbitrary number of light sources
Arbitrary number of light sources
- Attachments
-
- light.love
- (7.22 KiB) Downloaded 229 times
My game called Hat Cat and the Obvious Crimes Against the Fundamental Laws of Physics is out now!
Who is online
Users browsing this forum: No registered users and 4 guests