Finally starting to implement illuminated materials šŸ˜Ž #TangerineCSG
Essentially what's going on here is the cosine angle between the surface normal and the inverse light ray is clamped to 0-1 range and then passes into the color gradient eval function. I figure this would be useful for weird cell shading, but I'm still deciding how I want this to work. For example, should the ramp be evaluated once per light and averaged, or just evaluated once per vertex with a combined parameter.
Also I'm unsure if I want to separate this into multiple terms, each with their own gradients and so on.
I think the answer is probably going to be something relatively simple, and also that I'll definitely want to provide some kind of plugin interface for custom material types.
@aeva
Holy moley, not recursive fractals, thats a friction free gradient. don't slip.
@aeva when you say it’s being clamped down you mean you’re cutting the [-1, 0) range to 0? It’d be good to expose the full [-1, 1] range for ā€œhalf lambertā€ stuff.
@porglezomp rgb = ramp(clamp(-dot(N, L), 0, 1))
@porglezomp I'm open minded to doing ramp(-dot(N, L) * .5 + .5) instead, but I wasn't sure if there'd be much of a case for it
@aeva @porglezomp this is what I’ve done every time I’ve done toon ramp stuff! gives real nice control of the shadow bits too
@aeva ramp(clamp((-dot(N, L)+1)/2, 0, 1)) is nice for stylized shading since it lets you have more controlled forms in the shadows without needing a separate directional ambient term
@aeva it’s one of the first things I think of in stylized lighting just because of the ā€œwarped diffuseā€ stuff in the TF2 shaders https://steamcdn-a.akamaihd.net/apps/valve/2007/NPAR07_IllustrativeRenderingInTeamFortress2.pdf
@porglezomp do you think there's also value in exposing a separate ramp for specular and blending them together? vs using a more elaborate input to the ramp function?

@aeva I’m not sure.

I was gonna say I don’t know how much I have to contribute, but I did have one probably silly idea while thinking about the multiple lights problem: give the material a customizable function to blend two light values (so you can use max, or add, or softmax, or maybe something weirder. could be a 2d texture) and just recommend making it an associative operation