Skip to content

Commit 0f33d75

Browse files
authored
#3059 Fix for PBR hair fighting itself (and other fully transparent materials) (#3080)
1 parent ef6d2dd commit 0f33d75

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

indra/newview/llvovolume.cpp

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5925,7 +5925,24 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group)
59255925
{
59265926
if (gltf_mat != nullptr)
59275927
{
5928-
add_face(sPbrFaces, pbr_count, facep);
5928+
// In theory, we should never actually get here with alpha blending.
5929+
// How this is supposed to work is we check if the surface is alpha blended, and we assign it to the alpha draw pool.
5930+
// For rigged meshes, this apparently may not happen consistently.
5931+
// For now, just discard it here if the alpha is 0 (fully transparent) to achieve parity with blinn-phong materials in function.
5932+
5933+
bool should_render = true;
5934+
if (gltf_mat->mAlphaMode == LLGLTFMaterial::ALPHA_MODE_BLEND)
5935+
{
5936+
if (gltf_mat->mBaseColor.mV[3] == 0.0f)
5937+
{
5938+
should_render = false;
5939+
}
5940+
}
5941+
5942+
if (should_render)
5943+
{
5944+
add_face(sPbrFaces, pbr_count, facep);
5945+
}
59295946
}
59305947
else
59315948
{

0 commit comments

Comments
 (0)