- Ensures that column drawer doesn't read out of bounds
the brightmap column.
- Refactored code in r_segs.cpp, so it checks
R_TextureHasBrightmap.
- Added comments for plane brightmaps and sprite
brightmaps, that these are still error-prone.
- Sprites have directional lighting, like walls
- For normal sprites: contrast is much stronger than walls
- Papersprites look the same as walls
- SpriteBacklight option in level header weakens the contrast for sprites only
- SpriteBacklight subtracts from LightContrast
- E.g. SpriteBacklight = 0 would let it match LightContrast
- E.g. SpriteBacklight = 60 would make the contrast much weaker
- Negative values make the contrast stronger
Adds r_spritefx.cpp
lightlevel should be -255 to 255, relative offset to
normal sector lightlevel.
If RF_ABSOLUTELIGHTLEVEL, mobj_t.lightlevel becomes an
absolute lightlevel in the range 0 to 255.
In levels with tens of thousands of precipmobjs, the
overhead of running a thinker for all of them is too much,
no matter how small the thinker is.
ALL thinking is done inside the renderer now, where it can
be limited by distance. Precipmobjs track the last
leveltime they thunk, so interpolated frames don't think
twice.
There can be very many precipmobjs in a sector. During BSP
rendering, for each sector reached by BSP (the entire
visible level at least), all the precipmobjs would be
iterated and their distance from the camera calculated, to
determine whether they are within draw distance.
The issue with the old approach is that there really are
too many precipmobjs in each sector. By iterating the
blockmap within a certain range instead, precipmobjs
out of view are not iterated at all, saving some time.
Caveat: drawdist_precip is no longer respected as an
exact value, since it must round to the precision of the
blockmap.
List of potentially scary changes:
- Removes snext/sprev for precipmobj_t
- Removes preciplist for sector_t
- Adds bnext/bprev for precipmobj_t
- mobj_t and precipmobj_t field offsets are symmetrical
- Modified P_SetPrecipitationThingPosition and P_SetThingPosition
- The syntax in these functions is kind of wacky
Prevents sprites from rendering too close to the camera.
Such as when precipitation is too close and the sprite
corrupts visually. Perspective also breaks down when too
close.
Specifically, it avoids sorting or clipping the sprite
against stuff like FOF planes, which are notorious for
messing up sprites. Useful for debug stuff which
absolutely must be visible.