Skip to content

Commit

Permalink
Map Renderer: Avoid unnecessary interpolation of line-angle light lev…
Browse files Browse the repository at this point in the history
…el deltas
  • Loading branch information
danij-deng committed Aug 12, 2012
1 parent d3b4243 commit 311eee9
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions doomsday/engine/portable/src/render/rend_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1751,7 +1751,7 @@ static boolean rendHEdgeSection(HEdge* hedge, SideDefSection section,

{
SideDef* frontSide = HEDGE_SIDEDEF(hedge);
float deltaL, deltaR, diff;
float deltaL, deltaR;

/**
* Do not apply an angle based lighting delta if:
Expand All @@ -1769,13 +1769,15 @@ static boolean rendHEdgeSection(HEdge* hedge, SideDefSection section,
}
else
{
float diff;

LineDef_LightLevelDelta(hedge->lineDef, hedge->side, &deltaL, &deltaR);
}

// Linear interpolation of the linedef light deltas to the edges of the hedge.
diff = deltaR - deltaL;
deltaR = deltaL + ((hedge->offset + hedge->length) / hedge->lineDef->length) * diff;
deltaL += (hedge->offset / hedge->lineDef->length) * diff;
// Linear interpolation of the linedef light deltas to the edges of the hedge.
diff = deltaR - deltaL;
deltaR = deltaL + ((hedge->offset + hedge->length) / hedge->lineDef->length) * diff;
deltaL += (hedge->offset / hedge->lineDef->length) * diff;
}

opaque = doRenderHEdge(hedge,
surface->normal, ((flags & RHF_FORCE_OPAQUE)? -1 : alpha),
Expand Down

0 comments on commit 311eee9

Please sign in to comment.