- Home /
Implementing Custom Vertex Lighting Shader
I'm working on a 2D project, and am using vertex lighting. I'd like to use a custom shader to apply the lighting, as I don't want to worry about normals/depth and just want the light strength to be based on distance. Currently, due to z-positioning, lighting is annoyingly difficult to organize, and it makes sense to use a shader that's designed from a 2D perspective.
How do I make a shader with a custom lighting model? I've found topics with people doing that, but I haven't found any direct tutorials to follow.
Answer by Void24 · Oct 15, 2013 at 06:01 PM
HERE is a great starting guide to custom shader programming. Essentially what you want to do is use the inverse of the distance to a lightsource(covered in the series) as a multiplier for your texture color instead of a traditional lighting angle calculation.
That only seems to support forward or deferred lighting computation. I can't write a shader for Vertex Lighting mode?
You certainly can! I imagine you would need another resource though. $$anonymous$$y experience so far has been with fragment shaders.