orels1 / orels-Unity-Shaders

A collection of practical Unity shaders for your next project
https://shaders.orels.sh
Other
174 stars 14 forks source link

[ORL-63] Toon shader outlines w/o stencil #58

Open daalta opened 9 months ago

daalta commented 9 months ago

The current toon shader uses stencils to achieve its stencil effects. This effect has benefits when dealing with transparency. But it's sometimes less effective at rendering concave outlines or outlines that intersect with the mesh.

I'd appreciate being able to choose between stencil-based outlines and "traditional" outlines.

Here's a comparison between orels's toon shader and Poyomi.

orels vs poyomi

Here's an example of outlines not being rendered in certain conditions:

outlines

From SyncLinear.com | ORL-63

orels1 commented 9 months ago

https://github.com/orels1/orels-Unity-Shaders/assets/3798928/62cc75e7-5af1-40d0-ae08-24ca88f0f06a

I think i got it working with a simple toggle

orels1 commented 9 months ago

That would allow shapes that overlap each other to have stencils. I'll probably rename it to something more human readable

orels1 commented 9 months ago

Added support for modifying outline width by vertex color. This will allow better artistic control