Santarh / MToon

Toon Shader with Unity Global Illumination
MIT License
534 stars 59 forks source link

Improve rendering of overlapping transparency #99

Closed emilianavt closed 3 years ago

emilianavt commented 4 years ago

This patch adds clipping to rendering modes with alpha blending. Pixels that are basically fully transparent are clipped, preventing fully transparent meshes in front of other partially transparent meshes from cutting out large parts of them. As a side effect, it might slightly improve performance.

It's only enabled for D3D11, because I haven't tested it on other platforms. I also mainly tested with TransparentWithZWrite. Before merging, more tests might be necessary.

Without this patch, transparent meshes can cut other meshes like this: Original

With this, the effect is much less noticable: WithPatch

Santarh commented 4 years ago

Thank you. LGTM. I'll investigate whether there is a problem with the specification.

Santarh commented 3 years ago

Merged!