Commit graph

1531 commits

Author SHA1 Message Date
James R
5b3f1b2c10 Scale precipitation to mapobjectscale 2022-06-08 00:36:06 -07:00
Sally Coolatta
f05ac93633 Fix the two big problems with the lighting
- FULLY fix light offset still being applied on full bright walls
- Fix ceiling lighting being reversed
2022-05-25 16:16:20 -04:00
Sally Coolatta
ec02e75f0d Implement directional lighting
(Sloped ceilings are reversed and not sure what to do about it)
2022-05-25 02:51:08 -04:00
Sally Coolatta
dc890caef3 Add slope lighting
Makes slopes at a great enough steepness able to match the contrast of walls.

COMING SOON: Directional lighting & contrast modifier, as options for map header.
2022-05-24 22:23:04 -04:00
Sally Coolatta
ea477cb69a Make OpenGL use hwLightOffset instead of calculating every time
Fake contrast setting is no more
2022-05-24 20:09:32 -04:00
toaster
38e6cba181 Merge branch 'master' of https://git.do.srb2.org/KartKrew/Kart.git into uncapped-absolution
# Conflicts:
#	src/f_finale.c
#	src/sdl/i_video.c
#	src/st_stuff.c
2022-05-21 13:40:20 +01:00
Sally Coolatta
4e740ea683 WHY IS IT NOT ON BY DEFAULT 2022-05-12 17:35:14 -04:00
Sally Coolatta
d262190faf Fix compiling with da strict settings
Moved from gnu99 to gnu11 because I think unnamed union is reasonable, and will also cause a lot of problems down the road if we ever need changes!!
2022-05-07 07:23:26 -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
6dd38f001a Fix boss flash in opengl 2022-03-21 13:05:01 -07:00
Jaime Ita Passos
0abc659168 Update r_opengl.c 2022-03-18 17:46:18 +00:00
Jaime Ita Passos
5539341ebc Allocate a buffer for non-RGBA to RGBA texture conversions.
UpdateTexture will I_Error (from AllocTextureBuffer) if the allocation fails.
2022-03-18 17:46:09 +00:00
lachablock
c331bac825 Fix models interpolating to frame 0 from a same-sprite2 FF_SPR2ENDSTATE state 2022-03-18 17:10:32 +00:00
Hannu Hanhi
955bbeed42 Take slopes into account even more in FOF wall cutoff in HWR_ProcessSeg 2022-03-18 16:20:25 +00:00
Hannu Hanhi
8f22ccccdb Take slopes into account in FOF wall cutoff in HWR_ProcessSeg 2022-03-18 16:20:08 +00:00
toaster
37e16db41e Fix slope plane rotation and alignment.
A flattened-commit port of the SRB2 repository's software-slope-plane-uv-fix-attempt/merge request 1464 due to the vast, vast refactorings that would intefere with brightmaps and Encore if done one commit at a time.
2022-03-18 16:10:05 +00:00
toaster
2868639144 Add PF_ColorMapped
Not all surfaces have tint and fade colors. Checking for a specific surface flag, that tells the backend those colors are present, avoids uninitialized reads.

# Conflicts:
#	src/hardware/hw_main.c
2022-03-18 12:43:36 +00:00
toaster
11875b56c7 Render midtextures on two-sided lines with a z-buffer offset
This will fix z-fighting issues when they overlap with FOFs.

# Conflicts:
#	src/hardware/hw_main.c
2022-03-18 12:32:58 +00:00
Hannu Hanhi
b836d774a7 Remove bad pointer arithmetic in polygon comparators, that was causing glitches 2022-03-18 11:59:40 +00:00
katsy
c1a4ff724e move HWR_GetMappedPatch earlier 2022-03-18 11:56:50 +00:00
Hannu Hanhi
dcf944be9c Fix a OpenGL backend DeleteTexture crash 2022-03-18 11:53:20 +00:00
James R
821fd41d70 Merge branch 'c99-pedantic' into 'master'
Switch compiler mode C90 to C99; enforce stricter standard conformance

See merge request KartKrew/Kart!554
2022-03-18 02:41:57 +00:00
toaster
87fe8f2c9c Merge branch 'gamestatereloaded' into 'master'
Gamestate reloaded

See merge request KartKrew/Kart!551
2022-03-12 19:08:04 +00:00
toaster
2fdcd9bc2d Merge branch 'light-setup-frame-refactor' into 'master'
A lightweight refactor to R_SetupFrame and R_SkyboxFrame

See merge request KartKrew/Kart!532
2022-03-12 18:54:20 +00:00
James R
d7087c7405 pedantic: fix address loading function pointer casts 2022-02-20 03:22:25 -08:00
James R
bef9f502ca pedantic: cast to (void*) for printf %p 2022-02-20 03:15:51 -08:00
James R
bea79dfa65 Replace GNU zero-length array with ISO C99 flexible array member 2022-02-20 03:10:04 -08:00
toaster
0b97d954ad Tested with Chengi at one point, correct a few things from that.
* Fixed a few prints happening on resync that shouldn't.
* Fixed OGL loading not using levelfadecol.
2022-02-16 23:23:14 +00:00
James R
f10aa9645b Few more instances of fullbright colormap nullification 2022-01-20 23:39:58 -08:00
James R
26d231c43a Only ignore colormap for fullbright 2022-01-20 05:09:39 -08:00
James R
ecc3d031df Ignore colormap when overriding thing brightness 2022-01-20 03:57:58 -08:00
James R
ff70bd0d83 Fix opengl semibright
Adds back 3d models semibright.
2022-01-20 03:52:32 -08:00
James R
d06355018d Track skybox within player struct
TODO: Lua

Splitscreen and change viewpoint uses the proper skyboxes!
2022-01-17 22:46:01 -08:00
James R
8e0f02d65a Refactor R_SetupFrame/R_SkyboxFrame to use splitscreen number directly 2022-01-17 18:53:01 -08:00
James R
0d41c36f09 Closer OpenGL underwater/heatwave effect to Software 2022-01-12 04:30:43 -08:00
James R
2c6dfd5498 Do not speed up underwater/heatwave effect in OpenGL 2022-01-12 04:30:03 -08: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
ce01b494f4 Add functions to handle interpolation
Much less code duplication
2021-12-24 11:30:19 -05:00
James R
033a489b85 Fix bad merge @ 4a8340cd4 2021-12-13 01:29:20 -08:00
James R
a90520ebdc Do not factor roll and pitch into model rollangle
Those transformations are applied separately so the model
tilts in 3d space.
2021-12-10 00:32:46 -08:00
James R
1ac123246d Model stretching 2021-12-09 22:41:54 -08:00
James R
4f04c0c430 Tilt models 2021-12-09 22:41:54 -08:00
James R
95bfe07d66 Enable sprite rotation in OpenGL 2021-12-09 21:34:41 -08:00
Sally Coolatta
76874de965 Drop shadow tweaks for OGL
- Shadow uses subtractive & additive, like software shadows
- Shadow does not change scale or opacity, like software shadows
- Fixed shadow the hedgehog seizure
2021-12-09 18:32:52 -05:00
toaster
a149fa9db9 GL now loads in netgames and doesn't memory leak
What is broken:
* Encore mode remapping in GL only
* Seizure effect in Daytona (NOT IVO SAFE)
* God knows what else has been waiting in the wings
2021-12-09 20:57:15 +00:00
SteelT
83988a1cd8 Merge branch 'fade-strength' into 'master'
Alpha value for fade colormaps + colormap bug

See merge request KartKrew/Kart!477
2021-12-08 01:53:32 +00:00
SteelT
d0caa79414 Merge branch 'snapify-hitlag' into 'master'
Snapify Hitlag 2

See merge request KartKrew/Kart!461
2021-12-08 01:53:28 +00:00
Sally Coolatta
dbefc8fe58 Fix yellow persist fade colormap bug
I did the equivalent change to OpenGL and it broke Zoned City, despite it being fine in Software ... not sure what's up with that, since the color math is pretty similar. Just gonna leave that alone for now...
2021-12-06 22:47:15 -05:00
Sally Coolatta
b03cfe302d OGL fade alpha support 2021-12-06 20:58:31 -05:00