Description

When using OIT, AlphaComposite Materials blend as if they are using the Translucent BlendMode. The order of macro #if … #elif cases cause AlphaComposite Materials to take the same route as Translucent Materials.

Steps to Reproduce

1. Download the attached test project and open
2. Observe the two pairs of Cube and Cone. One set (left) uses AlphaComposite, and the the other (right) uses Translucency
2. Observe that the pair using AlphaComposite appears much brighter than the Translucent pair, as expected
3. In the Project Settings, under Engine -> Rendering - > Translucency, enable "Enable Order Independent Transparency (Experimental)"
4. Restart the editor
5. Observe that the two pairs of Cube and Cone look the same.

6. In BasePassPixelShader.usf, search for the first usage of "OIT_ENABLED" in the function "FPixelShaderInOut_MainPS(...)", around line 2154.
7. A little bit after that, there are several macro statements:
```
#if MATERIALBLENDING_TRANSLUCENT
….
#elif MATERIALBLENDING_ADDITIVE

#elif MATERIALBLENDING_ALPHACOMPOSITE || MATERIALBLENDING_ALPHAHOLDOUT

#else

#endif
```
Observe that MATERIALBLENDING_TRANSLUCENT is the first checked, and if it succeeds, then none of the other branches will be used.
8. In MaterialShared.cpp, in the function "FMaterial::SetupMaterialEnvironment(...)", search for "case BLEND_AlphaComposite:". There should be two instances, one for Substrate (~ line 2620) and one for without Substrate (~ line 2567).
9. Observe that both cases define MATERIALBLENDING_TRANSLUCENT to true, as well as define "MATERIALBLENDING_ALPHACOMPOSITE" to true.

Have Comments or More Details?

There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-254066 in the post.

0
Login to Vote

Unresolved
ComponentUE - Graphics Features - Substrate
Affects Versions5.55.5.4
CreatedMar 4, 2025
UpdatedMar 4, 2025
View Jira Issue