Commit graph

169 commits

Author SHA1 Message Date
James R
ce4518a20c Use interpolated mobj x/y/z/angle for splats 2022-10-31 19:01:44 -07:00
Sally Coolatta
dea86d611e Add floor clipping for TERRAIN
Port of code from Heretic/Hexen, lets you make a texture look "deep" by offsetting the sprites and cutting them off. Doesn't impact hitboxes.
2022-09-14 01:16:19 -04:00
James R
d60d4b05fc Remove R_ThingVisibleWithinDist
It's no longer used!
2022-09-11 16:59:51 -07:00
James R
ac2a13fe57 OpenGL hitbox renderer
I apologize for that vertex array.
2022-09-11 16:57:58 -07:00
James R
5a58b3ca3a Refactor hitbox renderer to project vissprites
Properly accounts for portals (skyboxes).
2022-09-11 06:17:42 -07:00
James R
082d9206e8 Add a hitbox renderer to Software mode
renderhitbox
- Tangible - collision activating objects, minus rings
- All - every object
- Intangible - the opposite of Tangible, also no rings
- Rings - rings
2022-09-08 22:30:00 -07:00
Sally Coolatta
8494c30e08 Drawseg clipping optimized, from prboom-plus 2022-08-24 22:03:05 -04:00
Eidolon
f7ec2f182f Uncapped (squashed v2)
Squashed SRB2 2.2 Public uncapped without UDMF merge

Implement interpolation at the renderer level

Instead of interpolating thinkers, we interpolate mobjs inside the
renderer. Further interpolation is TBI.

Place Frame Interpolation in "Experimental" video options header

This seems like an appropriate way to describe the feature for now.

Add smooth level platter under interpolation, `renderdeltatics`

`renderdeltatics` can be used as a standard delta time in any place,
allowing for smooth menus. It will always be equal to `realtics`
when frame interpolation is turned off, producing consistent
framerate behavior everywhere it is used.

Add smooth rendering to save select screen

Add smooth rendering to Record/NiGHTS Attack, F_SkyScroll

Ensure viewsector is accurate to viewx/viewy

This fixes a potential crash in OpenGL when changing between levels.

Ensure + commands get executed before map start

Always have precise_t defined

Fix misc dropshadow issues

Reset view interpolation on level load

Remove unnecessary precipmobj thinker hack

Add reset interpolation state functions

Reset precip interpolation on snap to ceil

Reset mobj interp state on TeleportMove

Only swap view interp state if a tick is run

Run anti-lag chasecam at tic frequency

Fixes jittery and unstable chasecam in high latency netgames

Homogenize mobj interpolations

Add sector plane level interpolations

Add SectorScroll interpolator

Add SideScroll interpolator

Add Polyobj interpolator

Intialize interpolator list at a better time

Delete interpolators associated with thinkers

Interpolate mobj angles and player drawangle

Interpolate HWR_DrawModel

Add functions to handle interpolation

Much less code duplication

P_InitAngle, to fix angle interpolation on spawning objects

Fully fix drop shadows

It used the thing's floorz / ceilingz directly -- that wouldn't account for interpolated coordinates.

Do not speed up underwater/heatwave effect in OpenGL

Closer OpenGL underwater/heatwave effect to Software

Interpolate from time of previous tic

Previously interpolated from last 35th of a second, which
may be offset from game time due to connection lag.

Consider this the proper fix to 6ecac4159a too.

Calculate FPS stuff even if frame is skipped

I decided ultimately to actually keep the frame skip optimization disabled, because I think it is actually a little bit helpful that you can still get accurate rendering perfstats while paused, however if we decide otherwise then we can have this optimization back without making the game act like it's lagging.

Keep rect in memory

Feel better about this than creating one all da time

Lots of FPS stuff

- Disabled VSync, due to the numerous problems it has.
- Instead, added an FPS cap.
- Frame interpolation is now tied to fpscap != 35.
- By default, the FPS cap is set to the monitor's refresh rate.
- Rewrote the FPS counter.

(This also consolidates several more commits ahead of this
fixing various issues. -eid)

Misc changes after Kart cherry-picks

Fix renderdeltatics with new timing data

Update mobj oldstates before all thinkers

Allow FPS cap values

Adjust how FPS cap is checked to improve FPS stability

Fix precip crash from missing vars

Improve the framerate limiter's timing for extreme stable FPS

Handle the sleep at the end of D_SRB2Loop instead of the start

Simplifies logic in the other parts of the loop, and fixes problems with it frequently waiting too long.

Reset mobj interp state on add

Add mobj interpolator on load netgame

Move mobj interpolators to r_fps

Dynamic slope interpolators

I_GetFrameTime to try and improve frame pace

(It doesn't feel that much better though.)

Move I_FinishUpdate to D_SRB2Loop to sync screen updates with FPS cap, use timestamps in I_FrameCapSleep to simplify the code

Fix plane interpolation light level flickering

Fix flickering plane interpolation for OpenGL in the exact same way

Funny OpenGL renderer being at least 50% copy-pasted Software code :)

P_SetOrigin & P_MoveOrigin to replace P_TeleportMove

Convert P_TeleportMove use to origin funcs

Revert "P_InitAngle, to fix angle interpolation on spawning objects"

This reverts commit a80c98bd164a2748cbbfad9027b34601185d93f5.

Waypoint polyobjects interpolate z & children

Add interpolation to more moving plane types

Adds interpolation to the following:
- Crumbling platforms
- Mario blocks
- Floatbob platforms (this one works really strangely due to two thinkers, maybe double-check this one?)

Reset overlays interp states each TryRunTics

Interpolate model interpolation (lol)

Use interp tracer pos for GL linkdraw

Papersprite angle interpolation

Makes the ending signpost smooth

Move intermission emerald bounce to ticker

Bring back shadows on polyobjects

Also optimizes the method used so rings can show their shadows too. Using just the subsector is a tad bit imprecise admittedly but any more precise methods get really laggy.

Fix a bunch of ticking in hu_ drawing functions

Revert "Reset overlays interp states each TryRunTics"

This reverts commit a71a216faa20e8751b3bd0157354e8d748940c92.

Move intro ticking out of the drawer

Adjust 1up monitor icon z offsets

Fixes interpolation issues with 1up monitors.

Delta time choose player menu animations

Add drawerlib deltaTime function

Interpolate afterimages further back

Use old sleep in dedicated mode

Clamp cechotimer to 0

Fixes issues with cechos staying on-screen and glitching out
(NiGHTS items for example).

Revert "Remove unnecessary precipmobj thinker hack"

This reverts commit 0e38208620d19ec2ab690740438ac2fc7862a49e.

Fix frame pacing when game lags behind

The frame timestamp should've been made at the start of the frame, not the end.

Fix I_FrameCapSleep not respecting cpusleep

Jonathan Joestar bruh

Allow dedicated to use precise sleep timing again

Instead of only using one old sleep, just enforce framerate cap to match TICRATE.

Make Lua TeleportMove call MoveOrigin

Reset Metal fume interp state on appear

Add interpdebug

Put interpdebug stuff in perfstats instead

Add timescale cvar

Slow the game down to debug animations / interpolation problems! Speed it up if you need to get somewhere quickly while mapping!

Enable timescale outside of DEVELOP builds

It has NETVAR, so it should be fine -- put an end to useful debugging features excluded in multiplayer!

Force interpolation when timescale != 1.0

Reset old_z in MT_LOCKON think

Fixes interpolation artifacting due to spawn pos.

Fix cutscenes in interp

Fix boss1 laser in interp

Interpolate mobj scale

Precalculate refresh rate

Slower PCs can have issue querying mode over and over. This might kinda suck for windowed mode if you have different refresh rate displays but oh well

Fix interp scaling crashing software

Reset interp scale when Lua sets .scale

Disable angle interp on fresh mobjs

Fix interp scale crash for hires sprites

Interp shadow scales

Copy interp state in P_SpawnMobjFromMobj

Fix multiplayer character select

Don't interpolate mobj state if frac = 1.0

Fix Mario block item placement

Interpolate spritescale/offset x/y

Fix offset copies for SpawnMobjFromMobj

THANKS SAL

Add Lua HUD drawlists

Buffers draw calls between tics to ensure hooks
run at the originally intended rate.

Rename drawerlib deltaTime to getDeltaTime

Make renderisnewtic is false between tics

I know what I'm doing! I swear

Completely refactor timing system

Time is now tracked internally in the game using I_GetPreciseTime
and I_UpdateTime. I_Time now pulls from this internal timer. The
system code no longer needs to keep track of time itself.

This significantly improves frame and tic timing in interp mode,
resulting in a much smoother image with essentially no judder at
any framerate.

Ensure mobj interpolators reset on level load

Ensure view is not interpolated on first frame

Disable sprite offset interpolation (for now)

Refactor timing code even more

System layer is greatly simplified and framecap
logic has been moved internally. I_Sleep now
takes a sleep duration and I_SleepDuration
generically implements a precise sleep with spin
loop.

Adjust spawned mobj z by gravity inversion

Only check VERTICALFLIP for old_z calc

Fix Marathon Mode menu for uncapped

Move screenshot code before timing

Only play emerald hunt sounds on new tics

Restore deleted zofs (fixes signpost sparkles etc)

Revert to before screenUpdate boolean was added

Was done this way for the sake of an older version of uncapped's timing; now that the new timing is much better, I decided it should remain as close to pre-uncapped as it can be.

Run UpdateLevelInterpolators in preticker

Fixes KartKrew/Kart-Public#10

Run UpdateMobjInterpolators in preticker

Reset view interp in preticker

Add per-split player view resets
2022-05-06 22:47:39 -05:00
toaster
982c6d9a2e Merge branch 'boss-code-extras' into 'master'
Extra code changes for boss

See merge request KartKrew/Kart!563
2022-03-22 13:06:15 +00:00
James R
fbe3106890 Refactor R_SpriteIsFlashing into R_ThingIsFlashing
Checks for boss fret AND hitlag.
2022-03-21 13:03:30 -07:00
toaster
336010e616 Fix portals
- Resetting portalcullsector fixes the major visual glitches

- Using 32 bits for nummasks and i fixes crashes when rendering lots of portals

# Conflicts:
#	src/r_main.c
2022-03-18 20:44:07 +00:00
toaster
86f2a551e6 Fix floor sprite projection
# Conflicts:
#	src/r_plane.c
#	src/r_things.h
2022-03-18 18:16:31 +00:00
Sally Coolatta
09eefc7e9b Make drop shadows slightly better in uncapped
They still jitter uphill
2021-12-24 23:17:28 -05:00
Sally Coolatta
04c1a9dcb1 Brightmaps on walls 2021-12-16 09:40:14 -05:00
James R
08348fcd43 Merge remote-tracking branch 'srb2/next' 2021-04-05 01:26:17 -07:00
Jaime Ita Passos
316ecff003 [Software] A few floorsprite fixes
This fixes the texture of the floorsprite sometimes facing the wrong way, since plane rendering can change the view angle.
2021-03-29 23:04:13 -03:00
Sally Coolatta
4139e67ddb Renderer compile errors 2021-02-28 23:31:56 -05:00
Sally Coolatta
420a6ccccb Fix Dehacked loading 2021-02-28 22:39:47 -05:00
Jaime Ita Passos
95c6139b32 Fix thing scale mismatch in R_DrawVisSprite 2021-02-28 16:23:40 -03:00
Sally Coolatta
9d7ec0ab8f Merge SRB2 next
Probably doesn't compile yet, but I got rid of all of the conflicts for anyone who wants to take a stab at it.
2021-02-27 05:18:36 -05:00
James R
c7647c7f6c Revert "Merge branch 'plane-sorting-fix-part-3' into 'next'"
This reverts merge request !1235
2020-12-23 03:02:31 +00:00
James R
d7e32e616d Merge remote-tracking branch 'origin/next' into plane-sorting-fix-part-3 2020-11-22 14:41:42 -08:00
James R
fb181a5b38 Remove unused stuff 2020-11-05 18:45:51 -08:00
James R
648f1f0958 Revert "Do not sort sprite in front of plane if plane should render in front of sprite's plane"
This reverts commit 0d6f329b1d.
2020-11-05 00:20:14 -08:00
James R
0d6f329b1d Do not sort sprite in front of plane if plane should render in front of sprite's plane
Say you have a higher plane in the foreground and a lower one behind. And then
insert a sprite above the plane in the background, the top of which is higher
than the height in the foreground. Should the sprite be drawn in front of the
foreground plane? I think not. Sprites drawing in front of a plane if only part
of them is above the plane is a rendering trick that allows sprites to extend
into the floor. This doesn't make sense if the plane they extend into would be
obscured anyway, or if they don't extend into the plane at all.
2020-11-02 17:54:51 -08:00
James R
263a11e62f Remove unused stuff 2020-11-02 03:37:16 -08:00
Sally Coolatta
9b6aa946ea Merge remote-tracking branch 'srb2/master' into the-scary-22-merge 2020-10-24 19:28:06 -04:00
Jaime Passos
a6f2e8b9c6 Implement relative and absolute sprite offsets for objects (mobjs)
Added RF_ABSOLUTEOFFSETS and RF_FLIPOFFSETS
2020-10-13 12:57:36 -03:00
Jaime Passos
e8dd79e5e2 Improve sorting between sprites and floor sprites 2020-10-13 02:24:18 -03:00
Jaime Passos
37ed2a6b26 Support spritexscale and spriteyscale in OpenGL
Fix papersprite scaling with spritexscale and spriteyscale in Software
2020-10-12 17:25:18 -03:00
Jaime Passos
b4b4738c94 Changes to sprite rendering:
- Added render flags (see r_defs.h)
- Implemented floor splats
- Drop shadow sprite rendering through render flags
2020-10-12 00:13:22 -03:00
Jaime Passos
7bc4af41ab Merge branch 'pictureformats' into patch-stuff-again-2 2020-08-15 20:48:28 -03:00
Sally Coolatta
dfd733eb80 Up to screen.o
Lots of renderer files I didn't need to touch at all here :)
2020-08-15 00:55:30 -04:00
Sally Coolatta
f9ca40e673 Merge branch 'master' into the-scary-22-merge 2020-08-12 20:59:09 -04:00
Sally Coolatta
3f1d58754e Merge r_things.c/h
Includes r_skins, obviously, but also a little bit of m_cond to make availabilities better for kart's purposes
2020-08-08 19:08:19 -04:00
Sally Coolatta
ef2579f2b3 Merge branch 'master' into draw-flags 2020-07-20 13:38:48 -04:00
Latapostrophe
cab9c2a139 Merge branch 'v2-master' into followme-internal 2020-06-07 23:56:32 +02:00
Sally Coolatta
63917ffccc The start of the scary 2.2 merge
All conflicts are left in-tact. We should be collaborating on solving these files one at a time.
2020-05-29 13:43:38 -04:00
Jaime Passos
c69a4f9ced Merge remote-tracking branch 'origin/next' into pictureformats 2020-05-15 01:34:54 -03:00
Latapostrophe
2bee969c6a Add follower bubbles with the BUBBLESCALE field 2020-05-11 00:16:13 +02:00
Sally Coolatta
22afa68651 Rivals system
You can input a predetermined list of rivals for each character, up to 3. In S_SKIN: `rivals = sonic,tails,knuckles`. Can support skin names from addons without throwing warnings.
2020-05-09 21:55:50 -04:00
Latapostrophe
766f7f035f Let followers change colour separatly from players 2020-05-04 18:08:41 +02:00
Latapostrophe
63485c3dbe Merge branch 'v2-master' into followme-internal 2020-05-03 22:37:26 +02:00
Latapostrophe
4c8d373962 Fix followers in anti gravity 2020-03-29 16:40:21 +02:00
Latapostrophe
4c1459cd4e Chaos Conflicts 2020-03-29 12:14:27 +02:00
James R
1b6256bd89 Use the 2.2 frame characters 2020-03-28 20:57:27 -07:00
toaster
c74dde0f0f Minor optimisations surrounding R_DrawFlippedMaskedColumn.
* Replace the texheight parameter provided directly to it with a previously existing (now renamed) global used for the same purpose, so that it can be used as an interchangeable function pointer with R_DrawMaskedColumn.
* Using the above, optimise R_DrawVisSprite to call a function pointer in a tighter loop rather than check SC_VFLIP each time around.
* SHORT macro can involve repeated operations; calculate once and put in memory for both RANGECHECK and papersprite.
* Remove irrelevant range check (already covered by existing range check immediately above) from R_DrawFlippedMaskedColumn and R_DrawMaskedColumn.
* "Warning: avoiding a crash in %s %d" is a terrible error message, and it chips away at the tightness of the loop just for something most people will never see printed. Replace with a PARANOIA I_Error in case someone actively wants to go hunting for its cause.
2020-03-26 16:09:19 +00:00
Monster Iestyn
34c4da018a Reorganise r_things.h 2020-03-08 21:17:30 +00:00
Monster Iestyn
9013398151 Create r_skins.c/.h, to contain skins code formerly in r_things.c/h 2020-03-08 19:32:07 +00:00
Jaime Passos
81a57d5fac Merge remote-tracking branch 'origin/next' into pictureformats 2020-03-07 20:43:16 -03:00