Advanced Cel Shader Pack

(I haven’t upgraded because I made some custom modifications! And it was working great minus this one issue. I can update and re-modify if need be, however.)

Modifying the LUT with pure black on the left side does seem to fix the problem if the light intensity is just right, but the problem is that if the light is too bright, the light envelops the entire barrel, including backfaces, no matter what the light responsiveness/other parameters are. I might be able to get around this with clever values, but none of the light should be touching the backface of the barrel no matter how bright it is. See this GIF as I increase the light intensity from 10.0 to 100.0: https://www.dropbox.com/s/qktzezkv5s…rease.gif?dl=0

If I make the LUT mostly black to account for brighter lights not hitting backfaces, then I get this sort of effect for dimmer lights, which is silly: https://www.dropbox.com/s/hv5zqoaagl…ooLow.PNG?dl=0

I feel like the solution here is some kind of clamp in the CelLightingDirectional/PhongLighting function, on the normals, but I don’t know enough about the math in there to do it.

More edit: after some deep diving, it appears that this part of the CelShadeRampSampler is causing the issue: https://www.dropbox.com/s/kwtmkhssst…mpler.PNG?dl=0

The output dot product is being shifted here from a -1 to 1 range to a 0 to 1 range for all values, making nothing “clampable”. I’m gonna bypass that and see what happens…

Edit again: That…worked? I think!