Facepunch / sbox-issues

176 stars 12 forks source link

"toon" shading/Light Warping support #1126

Closed yourtoast4 closed 1 year ago

yourtoast4 commented 2 years ago

Garry's Mod (And the source engine in general) had a light warp feature to use a texture to change how light displayed on a mesh. This was a thin texture, which allowed for the lighting of the model to appear differently on the model without taking a normal map slot. With some examples of it being on the tf2 mercs or the many anime characters on the workshop. S&Box doesn't currently seem to have this type of feature which can bring difficulties when trying to make a model with more cartoon-like lighting

Like stated, preferrably this is done in a similar way to how it's handled in Garry's Mod but I can also understand if that isn't possible with the new engine. I do not really know how Source 2 works just yet, but I did notice the Shaders in materials. If adding a light warp texture to a material isn't possible, then perhaps it a Toon/Anime/Cel shader could be added? This could have a slider for how hard the light fall off is, or for the colour of the shadow itself.

The closest I have gotten to a effect similar to the light warp texture, is by using transmission on a material and adjusting the colour. This isn't great as it wasn't designed for doing this, and it doesn't really give the desired effect. However doing this makes the material look slightly more cartoon but not to an extent where it's considered to be suitable for this purpose.

walllable commented 2 years ago

This sounds pretty similar to a shadow ramp, I'd be down for this. A good example of a shader that does this is Xiexe's Unity s Shader.

handsomematt commented 1 year ago

You can make a custom shader that does this