Skip to content

Commit

Permalink
Disabled alpha blending for sprites for now.
Browse files Browse the repository at this point in the history
  • Loading branch information
luciusDXL committed Sep 26, 2023
1 parent 8820787 commit 3622998
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions TheForceEngine/Shaders/gpu_render_sprite.frag
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,10 @@ void main()

// Sample the texture.
baseColor = sampleTextureClamp(Frag_TextureId, Frag_Uv);
if (discardPixel(baseColor, LightData.w)) { discard; }
// if (discardPixel(baseColor, LightData.w)) { discard; }
// Either discard very close to the iso-value or
// do a two-pass filter - close cut with depth-write + alpha blend without depth-write.
// if (baseColor.a < 0.48) { discard; }
if (baseColor.a < 0.48 && LightData.w < 1.0) { discard; }

// Get the emissive factor (0 = normal, 1 = 100% fullbright).
#ifdef OPT_TRUE_COLOR
Expand Down
2 changes: 2 additions & 0 deletions TheForceEngine/TFE_Jedi/Renderer/RClassic_GPU/rsectorGPU.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1953,11 +1953,13 @@ namespace TFE_Jedi
TFE_RenderState::setDepthFunction(CMP_ALWAYS);

// Alpha blending...
#if 0 // Disable for now.
if (s_shaderSettings.trueColor)
{
TFE_RenderState::setStateEnable(true, STATE_BLEND);
TFE_RenderState::setBlendMode(BLEND_ONE, BLEND_ONE_MINUS_SRC_ALPHA);
}
#endif

s_spriteShader.bind();
s_indexBuffer.bind();
Expand Down
2 changes: 1 addition & 1 deletion TheForceEngine/gitVersion.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
const char c_gitVersion[] = R"(
v1.09.510
v1.09.512
)";

0 comments on commit 3622998

Please sign in to comment.