Archive 17/01/2023.

See backside of transparent models

Lunarovich

I’ve tried many combos of materials and techniques and yet can’t achieve the simple effect of seeing backsides of a transparent object. Namely, I get this:

As you can see the backsides of the cubes are invisible. I’ve tried to to set cul to none, to set occlusion to false, to use unlit material, to use different blends, lie alpha, addalpha, but nothing seems to work. I expect backsides to be less transparent (darker) due to some sort of blending of front faces and backfaces of the cube - this can be seen on the image above when models overlap.

What I want to achieve is something like this

.
Normally, I understand that edges would require a line shader, so I’m not talking about that. Just about the visibility of the backsides.

Thank you very much!

Eugene

Depth write should be disabled for transparent objects, too.

Lunarovich

Thanks. depthwrite is also set to false, i’ve just forgot to mention it.

SirNate0

Just wanted to check, you said you set cul to none, but that’s spelled wrong. When you tried it, did you actually use cul? And are you sure you’re not seeing the back faces? Without the edges, the overall cube would just look a bit darker/bluer than when it is not on, like the overlapping cubes in the picture.

Lunarovich

@SirNate0 Sorry, it was just a spelling mistake here. In the code, I’ve checked it with grep (a tool for reg exp), it’s correct, it’s cull. Model actually has two geometries. So I’ve set the “edge” geoemtry to cull none and I see the “infrastructure”. So this part is ok.

However, as hard as I try, I don’t get that “a bit darker/bluer” and that’s what bothers me. No combo of techniques and material values seems to work.

Eugene

image
image
image


I checked it and it works just as intendent. These dirty patches are caused by messed up render ordering, which is expected.

In general, you have to render model twice, back faces and then front faces, with different render order, in order to keep it at least basic visual appeal.

JSandusky

In some fringe cases you can use additive blending with negatives equaling the sum of the positive (like 0.5, -0.25, -0.25) for very limited OIT that only works for “I need all of this same-colored tinted glass” situations. It’s difficult to hit precise colors that way though. You still have other probable sorting needs on top of it though that make it moot (particles, etc)

See 2nd answer of: opengl - What is the order-less rendering technique that allows partial transparency? - Game Development Stack Exchange

Lunarovich

@Eugene Thank you, I will try it. Do you render model twice in your cube example?

@JSandusky Thank you, I’ll consult the article.

Eugene

Nope, I was lazy and I only disabled culling, and nothing more.