Commit graph

208 commits

Author SHA1 Message Date
Christoph Oelckers
a32489be31 - wall sprite positioning tweaks.
Turns out that a distance of one Build unit from a wall alone is not enough to render them glitch-free, some depth bias is still needed.
2021-06-09 00:31:54 +02:00
Christoph Oelckers
f96521a7f4 - fixed: Floor sprites must set their view orientation.
The translucent element sorter needs this to operate properly.
2021-06-02 20:32:35 +02:00
Christoph Oelckers
3c5ef9c8e6 - properly render geometry that's fully shrouded in fog. 2021-06-01 21:48:39 +02:00
Christoph Oelckers
2e9732ce79 - fixed new renderer's use of fog on skies: The palette value from the wall was used instead of the one from the sky plane. 2021-05-29 12:09:16 +02:00
Christoph Oelckers
8aed9063f8 - sector splitting hack for SW $bath.map. 2021-05-23 17:06:47 +02:00
Christoph Oelckers
264d42179e - optimized the wall drawer a bit to avoid repeated calls to the render API's deoth bias function.
The setters in FRenderState should check if the value actually changes and the wall drawer should only call it for non-translucent wall sprites.
2021-05-21 19:07:22 +02:00
Christoph Oelckers
4bb57cfab5 - fixed flickering floor sprites.
The SetDepthBias call was somehow gotten lost.
2021-05-21 19:03:39 +02:00
Christoph Oelckers
f7a424cd06 - fixed precision issues with GetClosestPointOnWall for orthogonal lines.
The math failed for some large wall sprites (e.g. Blood E2M4, sprite #181), and in orthogonal cases it is better anyway to perform direct checks of the coordinates
2021-05-21 18:25:30 +02:00
Christoph Oelckers
24dbfc7827 - fixed BunchInFront to do a more thorough comparison in case it encounters colinear walls. 2021-05-21 14:32:01 +02:00
Christoph Oelckers
079a95a0a3 - use a higher depth bias for non-orthogonal wall sprites.
Due to minor angular inaccuracies they are more sensitive to z-ordering than orthogonal ones when things are closely stacked.
2021-05-21 14:32:01 +02:00
Christoph Oelckers
be97ee04f9 - re-enable flat sprite rendering.
This was commented out for testing but forgotten afterward.
2021-05-20 19:21:14 +02:00
Christoph Oelckers
5cfd810311 - new renderer: take fog properties for walls and ceilings from the proper elements. 2021-05-20 19:17:21 +02:00
Christoph Oelckers
b5358bc03c - fixed typo in wall sprite offsetting code. 2021-05-20 18:25:19 +02:00
Christoph Oelckers
d4eb54d686 - render free standing wall sprites without depth bias.
Otherwise they can end up badly ordered with walls.
2021-05-20 12:36:35 +02:00
Christoph Oelckers
e99567cd70 - fixed bad array of arrays access in sector splitting code. 2021-05-20 00:30:54 +02:00
Christoph Oelckers
5fd41ab910 - new renderer: draw the fog layer for skies.
Code was active but alpha wasn't set.
2021-05-18 00:42:45 +02:00
Christoph Oelckers
5e94eaff8e - new renderer: handle light level underflows. 2021-05-16 18:50:54 +02:00
Christoph Oelckers
a348508779 - handle the wall sprite clipping properly. 2021-05-16 16:00:00 +02:00
Christoph Oelckers
5bb438b817 - new renderer: fixed bad positioning when a y-flipped wall sprite had to be clipped to floor or ceiling. 2021-05-16 12:17:26 +02:00
Christoph Oelckers
845ce63348 - make sure that all objects rendered as shadow reset the object color after the draw call. 2021-05-15 10:40:25 +02:00
Christoph Oelckers
55abb261c6 - this was in the wrong place. :( 2021-05-15 10:25:37 +02:00
Christoph Oelckers
db8572dbcc - newrenderer: clip wall angles before doing any math with them.
In some cases these unclipped ranges ended up in other data structures, causing problems with bunch ordering.
2021-05-14 12:56:37 +02:00
Christoph Oelckers
3d6ae40bc0 - normalize all angles to the actual viewing range in the drawer.
This simplifies the debugging of this code a lot because we no longer have to deal with range overflows and can do direct comparisons everywhere.
2021-05-14 10:50:22 +02:00
Christoph Oelckers
cb2bc7967a - fixed the remaining warnings. 2021-05-12 21:50:01 +02:00
Christoph Oelckers
d097c8e635 - removed the non-functional and long abandoned level music alias feature.
With RMAPINFO such a hack is no longer needed for anything.
2021-05-12 21:48:40 +02:00
Christoph Oelckers
783b94f922 - more warning fixes in 'core'. 2021-05-12 21:48:14 +02:00
Christoph Oelckers
03289f5097 - silenced some warnings. 2021-05-12 21:47:32 +02:00
Christoph Oelckers
e74aca291c - position tweaking for Nam's skies.
Why is this such an utter mess to get skies placed correctly? :(
2021-05-10 20:13:28 +02:00
Christoph Oelckers
325af156e7 - fixed loop in ProcessBunch to account for array reallocation. 2021-05-08 09:16:06 +02:00
Christoph Oelckers
79823b430c - reinstate the old code for rendering the first portal without stencil
The previous commit fixes the true issue causing the problems - with this back the restriction is not needed anymore.
2021-05-07 00:26:22 +02:00
Christoph Oelckers
b644000b02 - fixed texture y-flipping on bottom tiers of walls.
The flip flag was taken from the wrong side of the wall.
2021-05-07 00:18:13 +02:00
Christoph Oelckers
29b0106a96 - fixed yet another problem with the local 'sprite' variables in HWWall causing problems.
This variable and its companions in HWFlat and HWSprite have now been renamed to avoid these issues.
2021-05-07 00:09:30 +02:00
Christoph Oelckers
d206a767b2 - added render workaround for CP07. 2021-05-03 17:48:35 +02:00
Christoph Oelckers
d8b808576f - restrict the sky portal shortcut to skies in scenes where there are no other portals.
This entire setup does not work with sector portals, causing various render glitches in Shadow Warrior's portals. This also applies to skies within portals so it is now restricted to single sky setups.
2021-05-03 14:52:23 +02:00
Christoph Oelckers
389340f97c - use sections for rendering. 2021-05-03 00:15:09 +02:00
Christoph Oelckers
30b1b046e4 - added an intermediate data structure to decouple the rendering from the immediate map data.
This will be needed for sectors consisting of disjoint parts and for providing some help with addressing rendering anomalies
2021-05-03 00:04:36 +02:00
Christoph Oelckers
aa6bd8ffcc - factor in angoff when placing sprites. 2021-04-25 11:58:03 +02:00
Christoph Oelckers
ad28630df6 - offloaded map patches to data files.
This is a lot easier to manage than having them in the code.
For now it piggybacks on the map hack feature, later this should use the same scripted approach as GZDoom.
2021-04-24 23:07:35 +02:00
Christoph Oelckers
a7046eaee4 - fixed animations on skies.
Lunatic Fringe made this very obvious.
2021-04-24 20:04:02 +02:00
Christoph Oelckers
5585351c0f - added a hack to help the new renderer with Lunatic Fringe.
This is by no means a permanent solution but having it buys some time to find something more universal that won't affect performance too badly and investigate the need for a more robust solution.
The idea here is to define pairs of walls where when the first element of the pair is seen, it will treat the second one as view blocking.
This is used as the two offending windows (sectors 151 and 152) to cope with the lack of a height sensitive clipper.
2021-04-24 20:00:54 +02:00
Christoph Oelckers
be08a2f800 - clipper rework
* let the clipper work on relative angles to simplify the math.
* properly initialize the initial visible range and preserve it for multiple invocations.
* track the maximum visible angular range per sector. While possibly not sufficient to handle every edge case imaginable it has low overhead and is still useful to eliminate obvious cases that do not need more complex checks. It is enough to fix the blue door in Duke E3L4.
* removed unused elements of the clipper.
2021-04-24 12:08:38 +02:00
Christoph Oelckers
eb573bea23 - removed all compensation for the clamped shades.
None of this is needed, the shader can work with out of range shades to produce proper lighting.
2021-04-21 22:48:55 +02:00
Christoph Oelckers
dc0df7d081 - don't clamp shade values in the setup pass.
We need their proper values when setting up the lighting.
2021-04-21 22:32:27 +02:00
Christoph Oelckers
b8f9bdb7c1 - made savepic work with new renderer. 2021-04-21 22:32:27 +02:00
Christoph Oelckers
643b969dff - added another weird Build specialty: no vertical sprite offset flipping for face sprites.
Just... why...? :?
2021-04-20 19:37:32 +02:00
Christoph Oelckers
be20b6a839 - fixed: wall sprites do not need NPOT emulation. 2021-04-20 16:58:18 +02:00
Christoph Oelckers
d078b511b8 - flip backwards oriented wall sprites before submitting them to the render list.
Backwards orientation will break the translucent object sorter so this needs to be sorted out beforehand.
2021-04-20 14:30:22 +02:00
Christoph Oelckers
ccdf9d13f1 - do not render sprites that are extremely close to the camera.
These can temorarily cover the entire screen so everything with a distance of less than 4 map units will now be skipped if it is a face sprite.
2021-04-20 00:15:11 +02:00
Christoph Oelckers
eff7d66742 - fixed Clang compilation error. 2021-04-17 18:47:15 +02:00
Christoph Oelckers
cdf89b9175 - portal rendering fix when viewing through two-sided walls outside the actual portal area.
If there's more portal area behind such a line its range in the clipper needs to be cleared again.
2021-04-17 18:32:40 +02:00