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 16, 2024
1 parent 1c3538d commit 9c48143
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 @@ -848,6 +848,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 @@ -1040,6 +1043,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 9c48143

Please sign in to comment.