Arbitrary number of light sources

Showcase your libraries, tools and other projects that help your fellow love users.
Post Reply
User avatar
T-Bone
Inner party member
Posts: 1492
Joined: Thu Jun 09, 2011 9:03 am

Arbitrary number of light sources

Post by T-Bone »

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 :neko: 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
Attachments
light.love
(7.22 KiB) Downloaded 229 times
Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests