Commit graph

712 commits

Author SHA1 Message Date
Eidolon
1ffc7d7c82 r_things.c -> r_things.cpp 2023-09-24 14:30:41 -05:00
James R.
5c1332f977 Add R_CustomShadowZ, Obj_FakeShadowZ, Obj_HyudoroShadowZ; let Hyudoro shadow float while patrolling 2023-09-17 21:56:19 -07:00
James R.
72ef1d352b mobj_t: add shadowcolor member to change shadow palette index 2023-09-17 21:56:17 -07:00
James R.
0cd4ceec01 R_ThingVisible: hide Spraycans with cv_drawpickups 2023-09-13 00:40:05 -07:00
James R.
717a9e3f97 Add R_GetBrightmapColumn, convert brightmaps to associated texture's column layout
- 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.
2023-09-09 21:08:11 -07:00
Eidolon
e0758875d4 Actually fix papersprites near camera crash 2023-09-03 16:31:08 -05:00
Eidolon
e76b1e1707 Fix sprite scale column iteration crash 2023-09-02 18:39:04 -05:00
James R
70294e62bd Automatically disable directional lighting if the sector has no sky 2023-08-11 01:41:49 -07:00
James R
46406931c1 Toggle all manner of directional lighting with MSF_FLATLIGHTING 2023-07-27 17:49:45 -07:00
Sally Coolatta
5067bb854a Split hitlag into its own file 2023-06-30 23:05:40 -07:00
James R
6b125ea575 Sprite directional lighting, add SpriteBacklight option to level header
- 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
2023-06-14 19:56:16 -07:00
James R
ffcdce339e Add FF_INVERT frame flag, use hitlag colormap 2023-06-13 14:42:00 -07:00
AJ Martinez
0e9e68a9cc Light level linkdraw fixes 2023-06-11 18:33:47 -07:00
James R
018f6f3410 Add lightlevel field to mobj_t
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.
2023-06-05 20:00:35 -07:00
James R
54b3aff09f R_ProjectSprite: fix overflow in sideways perspective clipping
Multiplications of perspective values can easily overflow
and flip sign bit at far distances. Instead, divide the
left operand.
2023-06-02 16:12:54 -07:00
James R
4ebbabc6f5 MF_DRAWFROMFARAWAY: draw sprites from infinitely far away 2023-06-02 04:17:34 -07:00
AJ Martinez
6f02923d89 Shield VFX 2023-05-19 17:59:47 -07:00
James R
9eab5317f3 Stop calling P_NullPrecipThinker
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.
2023-04-08 13:34:42 -07:00
toaster
94e3803eb0 Merge branch 'blockmap-precip' into 'master'
Render precip through blockmap instead of during BSP

See merge request KartKrew/Kart!1147
2023-04-08 11:21:23 +00:00
James R
bced5ecbc5 Render precip through blockmap instead of during BSP
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
2023-04-06 05:41:06 -07:00
James R
5be3a6c574 R_ClipVisSprite: add SC_CULL, completely exclude sprite from sorting if it is fully clipped
The avoids wasting time sorting and drawing sprites that
are completely obscured by segs / FOFs.
2023-04-06 01:19:22 -07:00
James R
1a2dc9635b R_SortVisSprites: refactor linked list handling
What a mess! It's pretty obvious how the list is supposed
to be laid out but the old code was gross.
2023-04-06 01:19:20 -07:00
James R
7867ffa335 Increase MINZ from 4 fracunits to 16
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.
2023-03-30 23:08:28 -07:00
James R
c702e37ae2 Merge branch 'double-drawdist-flag' into 'master'
Double drawdist flag

See merge request KartKrew/Kart!1106
2023-03-28 09:41:07 +00:00
James R
7f0cb6aa94 Merge branch 'respawn-line-debug' into 'master'
Add perspective to debugfinishline; highlight Respawn Lines

See merge request KartKrew/Kart!1089
2023-03-27 12:12:39 +00:00
James R
61abb7a82e Add MF_DRAWFROMFARAWAY flag, renders objects up to 2x drawdist 2023-03-26 22:01:25 -07:00
James R
1fa98a08d6 Revert debug line drawing for R_RenderMaskedSegRange
Reverts parts of b7ef8275c
2023-03-26 05:27:58 -07:00
Eidolon
04a6132f66 software: Skip precip mobjs in sky portal renders 2023-03-25 22:47:12 -05:00
James R
b7ef8275c4 Add debugfinishline, highlight finish line linedefs and black fill solid walls
- Highlight is drawn across the screen at the horizon
  (player's eye level).
- Highlight alternates between red and white for 35 tics
  each.
2023-03-19 20:45:36 -07:00
James R
f71ba63cd3 Add RF_ALWAYSONTOP, renders sprite through walls
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.
2023-03-06 06:50:23 -08:00
James R
aed9fe996c Add cv_debugrender_spriteclip, toggle sprite clipping
This cvar can be used to reveal which sprites are
technically drawn but clipped completely by level
geometry.
2023-03-06 05:34:49 -08:00
James R
53b2922fbb Add the debugrender_highlight command, highlight specific rendering in flat colors
Software mode only.

The command is used like this:

debugrender_highlight planes sprites
debugrender_highlight pl spr
debugrender_highlight none

(Abbreviations work.)

Supported rendering to flag:

planes      - sector floor/ceiling
fofplanes   - FOF top/bottom
fofsides    - FOF sides
midtextures - pegged midtexture
walls       - sector upper/lower texture, one-sided linedefs
sprites     - sprites
sky         - skybox
2023-03-06 05:25:36 -08:00
James R
77a864cc84 WIP - try fix off-by-one error in R_ProjectSprite, debug 2023-03-01 06:35:10 -08:00
James R
3b05d22679 Add more details to R_DrawVisSprite RANGECHECK message 2023-02-19 22:41:57 -08:00
James R
9b08730281 Fix R_CacheSpriteBrightMap trying to cache out of range lump 2023-02-14 04:17:04 -08:00
James R
97497fa1a1 Guard against out of bounds sprite brightmap 2022-12-16 18:56:52 -08:00
James R
9c8d6dfaa6 Add BrightMap support to SPRTINFO 2022-12-05 13:14:50 -08:00
James R
da8809c911 Clean up code duplication around RANGECHECK in r_things.c 2022-12-05 13:12:41 -08:00
James R
404aa0b5fe Hide MT_OVERLAY with drawpickups 2022-11-27 21:19:04 -08:00
Oni
dbb548d8ad Merge branch 'ironman' into 'master'
HOSTCODE 'ironman'

See merge request KartKrew/Kart!745
2022-11-26 11:56:11 +00:00
James R
e2be36c343 drawpickups command to hide collectible items 2022-11-25 16:05:11 -08:00
AJ Martinez
80252717c9 Kill SF_HIRES, use skin_t highresscale instead 2022-11-03 16:19:17 -07:00
James R
603a1671b4 Use angle between viewz and mobj z to determine splat sprite angle 2022-11-03 03:38:56 -07:00
James R
26eb1cf9e2 Use interpolated mobj x/y/z/angle for splats 2022-11-03 03:38:56 -07:00
James R
424c65955e Use angle between viewz and mobj z to determine splat sprite angle 2022-10-31 19:03:09 -07:00
James R
ce4518a20c Use interpolated mobj x/y/z/angle for splats 2022-10-31 19:01:44 -07:00
MascaraSnake
3b971835ee Add Lua backwards compatibility for FOF flags 2022-10-09 01:56:50 -04:00
Sally Coolatta
4b51f12c09 Merge branch 'master' into better-splash 2022-09-25 13:39:55 -04:00
James R
3d2d8bce16 Merge branch 'spritestuff-ports' into 'master'
Spritestuff ports

See merge request KartKrew/Kart!669
2022-09-17 07:10:44 +00:00
Sally Coolatta
0faf4d5f54 Add MF_APPLYTERRAIN
I gave it to all of our items, to give them footstep particles. Replaced MF_NIGHTSITEM.
2022-09-15 05:46:40 -04:00