Skip to content

Commit

Permalink
postfx: fix particle renders
Browse files Browse the repository at this point in the history
  • Loading branch information
qreeves committed Aug 24, 2024
1 parent 5cfe476 commit 4ad3683
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/engine/renderlights.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5055,7 +5055,7 @@ FVAR(0, refractdepthscale, 1e-3f, 16, 1e3f);
int transparentlayer = 0;
bool hasrefractmask = false;

void rendertransparent()
void renderearlydepth()
{
glBindFramebuffer_(GL_FRAMEBUFFER, msaalight ? msearlydepthfbo : earlydepthfbo);
glDepthMask(GL_FALSE);
Expand All @@ -5070,18 +5070,22 @@ void rendertransparent()
screenquad(max((renderw*gscale + 99)/100, 1), max((renderh*gscale + 99)/100, 1));

glDepthMask(GL_TRUE);
glBindFramebuffer_(GL_FRAMEBUFFER, msaalight ? msfbo : gfbo);
}

void rendertransparent()
{
int hasalphavas = findalphavas(), hasmats = findmaterials();
bool hasmodels = transmdlsx1 < transmdlsx2 && transmdlsy1 < transmdlsy2, hashaze = gethaze() != 0;
hasrefractmask = false;
if(!hasalphavas && !hasmats && !hasmodels)
{
if(!editmode && !drawtex) renderparticles();
renderearlydepth();
return;
}

if(!editmode && particlelayers && ghasstencil && !drawtex) renderparticles(PL_UNDER);
renderearlydepth();

timer *transtimer = begintimer("Transparent");

Expand Down

0 comments on commit 4ad3683

Please sign in to comment.