Skip to content

Commit

Permalink
Fix broken corona when the sprite contains alpha
Browse files Browse the repository at this point in the history
  • Loading branch information
nashmuhandes committed Sep 14, 2024
1 parent 521e2ed commit f5a3b50
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/rendering/hwrenderer/scene/hw_drawinfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -837,6 +837,9 @@ void HWDrawInfo::DrawCorona(FRenderState& state, AActor* corona, float coronaFad
state.SetTextureMode(TM_NORMAL); // This is needed because the next line doesn't always set the mode...
state.SetTextureMode(corona->RenderStyle);

// no need for alpha test, coronas are meant to be translucent
state.AlphaFunc(Alpha_GEqual, 0.f);

state.SetMaterial(tex, UF_Sprite, CTF_Expand, CLAMP_XY_NOMIP, 0, 0);

float scale = screen->GetHeight() / 1000.0f;
Expand Down Expand Up @@ -1029,6 +1032,7 @@ void HWDrawInfo::DrawCoronas(FRenderState& state)
DrawCorona(state, corona, (float)coronaFade, dist);
}

state.AlphaFunc(Alpha_Greater, 0.f);
state.SetTextureMode(TM_NORMAL);
state.SetViewpoint(vpIndex);
state.EnableDepthTest(true);
Expand Down

0 comments on commit f5a3b50

Please sign in to comment.