Skip to content

Commit

Permalink
WIP fix clothing blending
Browse files Browse the repository at this point in the history
  • Loading branch information
dpogue committed Mar 10, 2023
1 parent 3bb2b8a commit 919a8a4
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Sources/Plasma/FeatureLib/pfGLPipeline/plGLPipeline.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1649,6 +1649,8 @@ void plGLPipeline::IPreprocessAvatarTextures()
glUniform1i(0, 0);
glUniform4f(1, 1.f, 1.f, 1.f, 1.f);
glActiveTexture(GL_TEXTURE0);
glDepthFunc(GL_LEQUAL);
glDepthMask(GL_TRUE);

float uOff = 0.5f / rt->GetWidth();
float vOff = 0.5f / rt->GetHeight();
Expand All @@ -1667,7 +1669,11 @@ void plGLPipeline::IPreprocessAvatarTextures()
if (k >= plClothingElement::kLayerSkinBlend1 && k <= plClothingElement::kLayerSkinLast)
tint.a = co->fSkinBlends[k - plClothingElement::kLayerSkinBlend1];

// TODO: Set up state based on base layer
if (k == plClothingElement::kLayerBase) {
glBlendFunc(GL_ONE, GL_ZERO);
} else {
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
}

glUniform4f(1, tint.r, tint.g, tint.b, tint.a);

Expand Down

0 comments on commit 919a8a4

Please sign in to comment.