Transparet surface shader

Hello, everyone. I’m beginner of graphic programming.
developing by scenekit, because of using other hardware sdk.

By the way I gonna develop transparent surface shader like right one…

scnmaterial’s transparency mode, single layer is working well on playground by mac,
but it’s not working on ios app.

So I want to manipulate by glsl shader but couldn’t find shader by search.
Probably, it’s because of worse search keyword like hide back face, single layer or transparent surface.

This isn’t something that can be done by a shader.

Transparency is implemented by blending (glBlendFunc etc). But in most cases, the order in which surfaces are rendered matters, so you have to render either from back to front or front to back. Sorting triangles is decidedly non-trivial (and not always possible; the graph can by cyclic which requires splitting polygons to break cycles), so modern approaches tend to involve sorting individual fragments, either using multiple render passes (see “depth peeling”) or maintaining a linked list of fragments for each pixel.

A workaround which was somewhat popular on older hardware is to use “stipple alpha”. I.e. instead of blending fragments, fragments were probabilistically discarded based upon their alpha (opacity value). This may be acceptable on a device with a particularly high DPI such as a smartphone.

Thank you and love you guy. I don’t have friendship to depth peeling and stipple alpha yet. But I can study that and apply. And I come back and update contents.

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.