Two-Sided translucent material woes...

So, I know I’ve read before that translucency has issues in UE4. I thought I’d ask anyway.

I’m trying to set up a simple, 2-sided translucent material. I’ve applied an alpha in Opacity.

The result doesn’t seem to be 2-sided. Most of the time. It’s definitely rendering wrong in the engine.

Am I doing something wrong?

This is because translucent rendering doesn’t render the polygons on the correct order in respect to the screen. You’ll get polygon from behind rendering in front on top of the nearer ones. Unfortunately, You have to use masked to get correct pixel ordering. This is due to the way deffered renderers work. If there was a forward rendering path solution then this wouldn’t be an issue.

Thanks, dokipen! I can stop pulling my hair out.

Just to be clear, this means there’s no way to vary the translucency with this method, right? My mask has to be hard edged, no gray scale translucency mask?

This hasn’t anything to do with deferred rendering. All transparent rendering use forward rendering in UE4.
This is general transparent rendering problem which is still unsolved problem.(with constant time solution). Transparent pixel should be rendered from back to front. You could try to sort polygons but then intersection would still cause problems. You also would need ubershader to handle all possible materials. Most general solutions use per pixel sorting. This is almost perfect solution but it’s super expensive. There are also some promising solutions using depth weightings for order independent transparency. But these can both look wrong and be quite expensive.

If you can afford to render those foliage twice then I have usable solution for you. First render fully opaque pixel with masked material. Then render translucent edges with blending and hope that those borders are thin enough to hide artifacts.

Foliage really shouldn’t be translucent anyways, not unless you want your grass looking like sheets of plastic. Masked foliage with the hard edge will solve the issue. You can use fade out with the vertex color multiplied by the alpha plugged into the opacity mask. Trying to solve translucency sorting on foliage is a fool’s errand: the end result won’t look appropriate, and it will be very expensive and difficult to execute.

To get back some of that lost translucency under the masked blend, use the Two-Sided Foliage shading model and mess with the Subsurface/opacity settings.

1 Like

Why don’t select “Shading Model: Two Sided” ?

This^
To get the effect you’re after, use a mask+heightmap. The mask will define the shapes of your foliage, and the heightmap will define the thickness.
The mask goes in to opacity mask, the heightmap goes in to opacity, and your material should be set to two-sided (this material mode was originally created for foliage and used to be called as such until people got creative with it.)
Your base colour should also feed in to subsurface colour, unless your plant has an interior colour different from the outside, like some sort of weird see-through watermelon.

Hi, can I ask if you managed to solve your issue? I may be having the same problem…

Thank you! Worked!