Optimizing Ambient/Diffuse/Specular lighting shaders [update: now with video]

@Ignatz you’ve done a multi-light shader haven’t you?

it means repeating all the code, or sending through arrays of lighting info and looping through them.

It’s a lot of work, and slows things down a lot, too

You could also try deferred rendering (https://en.m.wikipedia.org/wiki/Deferred_shading). It only shades the pixels that need to be shaded and multiple lights are super easy to implement. But the G-Buffer takes a lot of memory and it can only shade pixels, not vertices.