Commit graph

541 commits

Author SHA1 Message Date
Mitchell Richters
3de1d2156d - Rename binaryangle.h to fixedhorizon.h and sanitise places where previous header was included. 2022-10-05 00:36:31 +02:00
Mitchell Richters
951734beae - Eliminate last remaining uses of binangle and the class itself.
* https://www.youtube.com/watch?v=RgKAFK5djSk
2022-10-05 00:36:29 +02:00
Mitchell Richters
c25493762b - Eliminate bvectangbam(). 2022-10-05 00:36:28 +02:00
Mitchell Richters
4f56138027 - Change all remaining BunchDrawer properties from binangle to angle_t types. 2022-10-05 00:36:25 +02:00
Mitchell Richters
e6fe9b7031 - Change all binangle members in Clipper struct to angle_t. 2022-10-05 00:36:25 +02:00
Mitchell Richters
914930ff9a - Change BunchDrawer::ang1, BunchDrawer::ang2 and BunchDrawer::angrange from binangle to angle_t. 2022-10-05 00:36:25 +02:00
Mitchell Richters
e17d24ce0b - Change FBunch::startangle and FBunch::endangle from binangle to angle_t. 2022-10-05 00:36:25 +02:00
Mitchell Richters
36d76a71ea - Change walltype::clipangle from binangle to angle_t. 2022-10-05 00:36:25 +02:00
Mitchell Richters
d3022947eb - Replace use of binangle in gi->processSprites() with DAngle object. 2022-10-05 00:36:24 +02:00
Mitchell Richters
ebac932efe - Update render_drawrooms() and render_camtex() to work off DAngle objects. 2022-10-05 00:36:23 +02:00
Christoph Oelckers
c2f4fa8bb5 - more angles 2022-10-04 23:56:44 +02:00
Christoph Oelckers
f54e4b8a9a - more int_ang() 2022-10-04 23:56:43 +02:00
Christoph Oelckers
33d5b54ce0 - use int_ang(). 2022-10-04 23:56:43 +02:00
Christoph Oelckers
735b9a8fed - renamed ang to __int_angle 2022-10-04 23:56:42 +02:00
Christoph Oelckers
06b8a9139e - handle most int_pos calls in common code. 2022-10-04 18:44:17 +02:00
Christoph Oelckers
a59a771209 - use floats for ceilingz/floorz storage. 2022-08-27 10:49:59 +02:00
Christoph Oelckers
c84d75b8bf - use inline access functions to read floorz/ceilingz. 2022-08-27 09:58:16 +02:00
Christoph Oelckers
0672572e63 - renamed sectortype::floorz and ceilingz as preparation for floatification 2022-08-27 09:47:48 +02:00
Christoph Oelckers
c15aeec9f7 - late __int_pos additions 2022-08-26 19:53:11 +02:00
Christoph Oelckers
1231f6025d - handle the last remaining uses of __int_pos that can be done with the function interface. 2022-08-26 19:53:10 +02:00
Christoph Oelckers
8ccaa0ab8c - more tsprite position stuff 2022-08-26 19:53:10 +02:00
Christoph Oelckers
170387ab26 - tspritetype::pos access wrappers, part 1. 2022-08-26 19:53:10 +02:00
Christoph Oelckers
dc94dedc6b - renaming spritetype::pos 2022-08-26 19:53:10 +02:00
Christoph Oelckers
ad9931081e -fix some bugs, handle occurences in recently changed code 2022-08-26 19:53:10 +02:00
Christoph Oelckers
111dbd7a7d - backend update from GZDoom.
mainly TAngle overhaul and needed code adjustments.
2022-08-26 18:28:22 +02:00
Christoph Oelckers
4d423004e9 - unlimited the displayable sprites.
Now with Polymost gone this can finally be done properly.
2022-08-07 10:25:15 +02:00
Christoph Oelckers
4f2170655c - animateoffs cleanup and consolidation
This was rewritten based on specs alone - it still doesn’t look that different due to its simplicity.
2022-08-05 23:32:16 +02:00
Christoph Oelckers
ec66f39535 - replaced a few naked chars with better types. 2022-08-05 17:04:46 +02:00
Christoph Oelckers
c2fc7577db - cleanup of 3D viewport code.
Removes all the hackery that Polymost needed and now uses a sane struct to store the info.
2022-08-05 17:04:45 +02:00
Christoph Oelckers
e6ca0f4817 - made fov change for RRRA's drug mode work. 2022-08-03 19:41:30 +02:00
Christoph Oelckers
291726cc55 - removed the Polymost renderer. 2022-08-03 15:50:27 +02:00
Christoph Oelckers
7debab7ff4 - refined wall sprite check so that orthogonally aligned sprites are only aligned to orthogonal walls.
Here even the slightest deviation can create problems.
2022-08-03 14:13:42 +02:00
Christoph Oelckers
6591b3b090 - Backend update from GZDoom.
Mainly new features for 2D drawer and model renderer.
2022-07-23 12:05:27 +02:00
Christoph Oelckers
390cd2ca98 - fixed rendering of non-orthogonal wall sprites.
These cannot be done in a simple two-pass approach, for wall sprites attached to walls it requires doing the two passes per wall to ensure proper depth buffer coverage.
2022-07-04 09:11:24 +02:00
Christoph Oelckers
9e6fe2cbaa - added workaround to render the crane in WT's 'Docks' map correctly.
This one violates engine specifications by creating overlapping walls when the crane is rotated.
2022-06-26 09:36:01 +02:00
Christoph Oelckers
e86899ed31 - fixed sky panning.
This picked the wrong overload - to make things robust one of the functions was renamed.
2022-06-06 10:12:26 +02:00
Christoph Oelckers
f245a70883 - removed redundant setting of black shadow color with incorrect data check.
SetLightAndFog already does this, but with correct checks.
2022-05-30 23:05:37 +02:00
Christoph Oelckers
bd023b0b1c - fixed wall sprite clipping 2022-05-30 00:19:32 +02:00
Christoph Oelckers
4278f0113b - function for checking wall sprites’ need for recalculation
Preparation for overhauling their rendering
2022-05-24 00:10:36 +02:00
Christoph Oelckers
380864d6fb - pass shade values to sky renderer 2022-04-19 14:44:10 +02:00
Christoph Oelckers
c4bfee070e - don’t crash on sector-less walls. 2022-04-19 13:39:26 +02:00
Christoph Oelckers
cc6629a95f - do not call tileUpdatePicnum for voxelized tsprites. 2022-02-20 23:36:04 +01:00
Christoph Oelckers
a1339f014c - store indices in sectionsPerSector. 2022-02-20 23:11:04 +01:00
Christoph Oelckers
f1859c69f0 - fixed bad assumption about g_visibility == 0 meaning fullbright.
This merely means that there should be no fog, but the shade must still be applied.
2022-02-19 11:30:35 +01:00
Christoph Oelckers
e3f1893e02 - avoid conversions for vertex comparisons in CollectLoops and for sectorgeometry.cpp's poscompare values. 2022-02-15 22:34:03 +01:00
Christoph Oelckers
71943abed0 - changed math utilities to floating point coordinate system. 2022-02-15 22:18:26 +01:00
Christoph Oelckers
4e2a9f6e59 - use float wall positions in portal code. 2022-02-15 22:18:26 +01:00
Christoph Oelckers
651c25a7be - do the 'inside' check with integers.
Using floats and multiplications is not robust enough. This is a bit slower, but doesn't run the risk of underflows and other nasties.
Q: How many bits of fractional precision should we use? 16 seems fine
2022-02-15 22:18:26 +01:00
Christoph Oelckers
a781517780 - renamed PlanesAtPointf to PlanesAtPoint
The old PlanesAtPoint is not needed anymore.
2022-02-15 22:18:24 +01:00
Christoph Oelckers
bd95da423a - use PlanesAtPointf in most places where PlanesAtPoint was used. 2022-02-15 22:18:24 +01:00
Christoph Oelckers
02d508baef - renamed floatified wall coordinate to 'pos'. 2022-02-15 22:18:24 +01:00
Christoph Oelckers
cd55658786 - use floats for vertices. 2022-02-15 22:18:23 +01:00
Christoph Oelckers
f44736a5b6 -use an access function for reading wall positions so that we have a non-modifiable value wherever this is possible. 2022-02-15 22:18:23 +01:00
Christoph Oelckers
89ef81da55 - renamed walltype::pos as preparation for refactoring.
no functional changes here
2022-02-15 22:18:22 +01:00
Christoph Oelckers
dab1f7fcec - handle walls where a sloped floor intersects with the visible part. 2022-01-30 08:54:11 +01:00
Christoph Oelckers
11b21cce2c - handle wall sprites on orthogonal walls better.
This covers the case that a wall sprite may overlap two walls with a slight deviation in their position - always pick the closest one.
2022-01-30 08:28:52 +01:00
Christoph Oelckers
686a648aa1 - fixed inverted logic when checking for dragged sectors. 2022-01-29 09:59:29 +01:00
Christoph Oelckers
04a380ce14 - added script exports for DCoreActor's member variables. 2022-01-24 00:24:46 +01:00
Christoph Oelckers
0398ba4ff0 - added all parts needed to implement the actor property parser.
Not hooked up yet with the rest of the code, this just adds the needed files in compilable form.
2022-01-23 13:03:39 +01:00
Christoph Oelckers
3aff12cf4c - sky management rework. 2022-01-16 12:12:43 +01:00
Christoph Oelckers
e2061dbcc6 - fixed bad wall array access when handling a sector that got split up. 2022-01-14 22:56:00 +01:00
Christoph Oelckers
7b1d99373b - fixed last commit and optimized wall lookup code a bit.
No need to continue if a matching wall has been found.
2022-01-14 20:20:47 +01:00
Christoph Oelckers
ef711f0b2d - allow a bit of tolerance for attached orthogonal wall sprites.
We have to account for mappers adding some 'safe' distance (which isn't really safe!)
2022-01-14 16:27:24 +01:00
Christoph Oelckers
8281374551 - do not use floor sprites for splitting geometry.
This is way too expensive on maps with lots of sprites. Instead, run them through the case for slope sprites which should be sufficient here
Also let rendered_* count the actual draw calls, not processed objects, because that is the most relevant metric for checking performance issues.
2022-01-14 00:49:57 +01:00
Christoph Oelckers
899ced50aa - moved alpha threshold determination for sprites to the setup pass.
Overall this is not much, but it can be easily offloaded to a worker thread later.
2022-01-14 00:19:26 +01:00
Christoph Oelckers
37e7f92182 - made a few changes to the timer calls for renderer profiling.
A few items were counted double, other were in the wrong slot.
2022-01-14 00:15:33 +01:00
Christoph Oelckers
9375750a17 - added sorting for wall sprites attached to non-orthogonal walls. 2022-01-13 20:55:55 +01:00
Christoph Oelckers
8d84bc2599 - disable window clipping entirely in outside areas.
This is a first grade performance killer on large maps and doesn't offer much in clipping robustness.
On maps like Clear the Coast or Wpudrichem omitting this check reduces map traversal time by 40%.
2022-01-13 19:46:04 +01:00
Christoph Oelckers
8976813fe1 - removed some overlooked debug code. 2022-01-13 13:14:00 +01:00
Christoph Oelckers
fcf04a7df1 - delete unused variable. 2022-01-13 12:27:40 +01:00
Christoph Oelckers
85cce1128a - do proper handling of the 'no shadow' case for Duke's bad guys.
Using a flag like RedNukem instead of hacking dispicnum, which occasionally does reach the renderer and causes problems.
2022-01-13 00:42:34 +01:00
Christoph Oelckers
1b162ececc - do not add two-sided walls outside of the visible range to the clipper
This caused a render glitch in Duke E4L2.
2022-01-13 00:04:32 +01:00
Christoph Oelckers
22afc25046 - fixed floor sprite normals. 2022-01-13 00:04:14 +01:00
Christoph Oelckers
f09bbb8b5e - fixed the normals for sloped planes. 2022-01-12 16:02:45 +01:00
Christoph Oelckers
e5dad53f6d - menu entries for light modes, plus handling of overbright shades. 2022-01-11 00:19:15 +01:00
Christoph Oelckers
f20bd94269 - the gl_fogmode hack is no longer needed 2022-01-11 00:18:56 +01:00
Christoph Oelckers
aa0e558af2 - use different fade ramps for 64 and 32 shades.
Also some optimization to eliminate redundant calculations of the fade strength.
2022-01-11 00:18:20 +01:00
Christoph Oelckers
07eeb147ab - tweaked light mode for weapon lighting and avoiding getting too dark. 2022-01-11 00:16:43 +01:00
Christoph Oelckers
aa7af0711a - fine tuning of the new light modes. 2022-01-11 00:13:31 +01:00
Christoph Oelckers
26223ffca2 - experimental new light mode, based on GZDoom's original light modes. 2022-01-11 00:12:50 +01:00
Christoph Oelckers
98c919fbe4 - g_visibility stuff 2022-01-11 00:12:32 +01:00
Christoph Oelckers
ddcee4ecbf - split up g_visibility into two variables.
This is preparation for experimenting with the weapon flashes that can be quite annoying with how they brighten distant parts of the level far more than nearby parts.
2022-01-11 00:12:32 +01:00
Christoph Oelckers
91d51d518b - this hack is needed because dragging vertices around can randomly create wall intersection.
In clear English: Geometry in Build maps is always broken by design. :(
2022-01-09 20:38:07 +01:00
Christoph Oelckers
a0e6ee0e2e - added a bit more logic to handle overlapping walls.
All this is needed to make the back door to the cinema in Duke E1L1 render properly without making the clipper break on complex overlapping sector setups, like some of the ducts in Duke E2L7.
2022-01-09 12:05:36 +01:00
Christoph Oelckers
36bb3e621f - fix typo. 2022-01-09 11:53:32 +01:00
Christoph Oelckers
fcba341546 - use proper aspect ratio to calculate the frustum's angle. 2022-01-08 23:43:08 +01:00
Christoph Oelckers
415dc5246d - fixed sprting of non-translucent sprites. 2022-01-08 21:18:18 +01:00
Christoph Oelckers
fe0581ed97 - disable palette emulation when rendering weapons.
The 2D code cannot handle transparency well with it.
2022-01-08 14:16:18 +01:00
Christoph Oelckers
70087ebc12 - fixed: The new renderer still called the Polymost screen finish function.
This led to a second, redundant postprocessing step with incorrect matrix values.
It now calls screen->Update() directly without the unneeded stuff, but this required a bit of reordering in the game code to ensure that the renderer receives the weapon data to display.
2022-01-08 13:50:47 +01:00
Christoph Oelckers
a3162f6ccf - renamed testnewrenderer CVAR. 2022-01-07 12:49:41 +01:00
Christoph Oelckers
0cfe6bbed3 - do the unlink properly when replacing a clip node. 2022-01-07 00:22:02 +01:00
Christoph Oelckers
98258e0bb2 - fix handling in the clipper for a new range that completely covers an existing one.
The handling for this was from the first draft of the clipper that made very different assumptions than the final version.
This cannot simply delete the old range - it has to explicitly alter it and recursively insert the outer sub-ranges separately.
2022-01-06 16:34:04 +01:00
Christoph Oelckers
159409d5d2 - allow a bit of tolerance when sorting walls, so that microscopic intersections can be ignored. 2022-01-06 00:43:47 +01:00
Christoph Oelckers
9f6d6a0e6d - block y-flipping of slope sprites only if they are actually sloped.
This mirrors Polymost's (buggy) handling.
2022-01-05 09:20:54 +01:00
Christoph Oelckers
d5daa8ee84 - fixed: The bunch drawer's gotwall array was cleared before resizing.
This means that on the first frame of a new map it'd operate on partially uninitialized data.
2022-01-04 17:18:26 +01:00
Christoph Oelckers
227ac0fca6 - RR: address a missing texture in E1L2.
The current texture on this wall is suboptimal but it's still better than glitchy HOM.
2022-01-04 17:18:25 +01:00
Christoph Oelckers
ac3546bdaa - fixed depth buffer use of slope sprites.
They cannot be treated like perfectly horizontal floor sprites and need to write to the depth buffer in the same pass as the regular pixels.
2022-01-04 12:42:45 +01:00
Christoph Oelckers
e2e3b4482d - do some better sorting of slope sprites.
Splitting by translucent floor plane is essential, splitting by wall not that much - sorting by center point should be sufficient here.
2022-01-03 12:31:54 +01:00
Christoph Oelckers
daa07b9e55 - an attempt to render "reflection" floor sprites by lifting them up to the floor and drawing them with 33% alpha. 2022-01-01 20:01:36 +01:00
Christoph Oelckers
6807086f3c - relaxed the FindWall check for wall sprites a bit so that slightly out-of-sector sprites can find a wall to attach to. 2022-01-01 18:55:42 +01:00
Christoph Oelckers
fcb3e43799 - fixed side check for sloped sprites. 2022-01-01 17:27:09 +01:00
Christoph Oelckers
9680ff1863 - ignore y-flipping when rendering slope sprites in the new renderer.
This is what Polymost, and apparently NBlood, do here.
2022-01-01 12:55:28 +01:00
Christoph Oelckers
551ff89778 - fixed signed/unsigned comparison warning. 2022-01-01 11:30:00 +01:00
Mitchell Richters
f1530a051f - Fix two signedness warnings in hw_sections.cpp. 2022-01-01 21:02:00 +11:00
Mitchell Richters
733b6a7367 - Fix GCC warning warning: ‘vec.TVector2<double>::X’ may be used uninitialized [-Wmaybe-uninitialized]. 2022-01-01 20:50:58 +11:00
Christoph Oelckers
f679b61a30 - fixed issue with wall sprite angle check.
The resulting value had no sign, so 'abs' did not work. It now uses some bit shifting magic to get a proper sign.
2021-12-30 22:56:33 +01:00
Christoph Oelckers
a9b162b8e9 - moved the tsprite flags from cstat2 to clipdist which was already holding other ones.
cstat2 should only hold flags for game-side sprites.
2021-12-30 19:00:35 +01:00
Christoph Oelckers
6c381d4392 - removed sector() method from low level sprite type. 2021-12-30 16:58:48 +01:00
Christoph Oelckers
88e4bb9f79 - moved sectno method to DCoreActor. 2021-12-30 16:39:43 +01:00
Christoph Oelckers
eb00fe52db - more spritetype references eliminated. 2021-12-30 16:11:14 +01:00
Mitchell Richters
9bbb54fe2e - Replace every line that just contains spaces or tabs with an empty line feed in all files except 3rd party libraries. 2021-12-30 20:30:21 +11:00
Christoph Oelckers
e670cf2786 - re-tabified several files that got mangled by repeated merging 2021-12-30 09:58:47 +01:00
Christoph Oelckers
d46a7abb0e - better wall sprite handling.
When they are directly on a wall, project their coordinates onto the wall to eliminate the imprecisions from Build's ad-hoc setup.
2021-12-30 09:58:46 +01:00
Christoph Oelckers
1a2b9d43f7 - fixed check for wallsprites on walls.
This completely ignored the case where a wall was flagged as one-sided which was the main reason with that sneaky sign in E2L1.
The problem is not entirely fixed with this but now it will detect that it's on a wall.
2021-12-30 09:58:46 +01:00
Christoph Oelckers
4f8f85c634 - backend update from GZDoom. 2021-12-30 09:58:46 +01:00
Christoph Oelckers
b1d8f92ded - added wall edge splitting for gl_seamless. 2021-12-30 09:58:44 +01:00
Christoph Oelckers
f7e7476010 - hooking up the vertex map with the rest of the engine. 2021-12-30 09:58:44 +01:00
Christoph Oelckers
27ae8d627b - vertex height map creator for precise render mode like in GZDoom. 2021-12-30 09:58:44 +01:00
Christoph Oelckers
059412b75e - first batch of routing all write access to sectortype::ceilingz and floorz through a function interface.
We need this for implementing "precise" rendering to flag vertices as dirty.
2021-12-30 09:58:14 +01:00
Christoph Oelckers
8710e76a2d - delete voxel models when shutting down 2021-12-30 09:58:10 +01:00
Christoph Oelckers
e5c9691166 - fixed clipping issue with sloped walls.
The window was calculated too narrow for this case, it needs to use the lower point of a floor slope and the upper point of a ceiling slope.
2021-12-30 09:58:09 +01:00
Christoph Oelckers
50bad91f14 - handle edge case in clipper where adding a new window will remove the entire clipper's content before adding the new range.
This case would have passed the actual logic but not the asserts.
2021-12-30 09:58:09 +01:00
Christoph Oelckers
04f3268893 - silenced the debug output that was still present in the section creator. 2021-12-30 09:58:08 +01:00
Christoph Oelckers
9e14b168bb - addressed more shadowed variables in common code. 2021-12-30 09:57:32 +01:00
Christoph Oelckers
ca9d73ffee - renamed some shadowing variables in common code. 2021-12-30 09:57:32 +01:00
Christoph Oelckers
3992dfae84 - fixed: When merging clip nodes the redundant one needs to be deleted with RemoveRange.
Calling Free is not enough.
2021-12-30 09:57:29 +01:00
Christoph Oelckers
b00f197be3 - fixed: RemoveClipRange did not shorten the range if it had to split it up. 2021-12-30 09:57:29 +01:00
Christoph Oelckers
5699488bea - get rid of spritetype in inactive code. (Search noise removal) 2021-12-30 09:57:20 +01:00
Christoph Oelckers
40a307650d - the really final parts of the shared code using s() cleaned up. 2021-12-30 09:57:15 +01:00
Christoph Oelckers
09634c4993 - use actors instead of sprites in the new renderer's API. 2021-12-30 09:57:15 +01:00
Christoph Oelckers
f602cf3806 - deal with s() in shared code.
clip.cpp was left alone, except for the actual call.
2021-12-30 09:57:14 +01:00
Christoph Oelckers
d0143db8fe - got rid of sx() and sm() inlines. 2021-12-30 09:57:13 +01:00
Mitchell Richters
baf78848eb - Replace spritetypebase z with pos.Z calls and eliminate spritetypebase pos union. 2021-12-30 09:57:06 +01:00
Mitchell Richters
cecb8dc48e - Replace spritetypebase y with pos.Y calls. 2021-12-30 09:57:05 +01:00
Mitchell Richters
33ca55023f - Replace spritetypebase x with pos.X calls. 2021-12-30 09:57:05 +01:00
Mitchell Richters
09e00a69fe - Replace walltype y with pos.Y calls and eliminate walltype pos union. 2021-12-30 09:57:04 +01:00
Mitchell Richters
51b647da87 - Replace walltype x with pos.X calls. 2021-12-30 09:57:04 +01:00
Mitchell Richters
b2ab64bb62 - Capitalise vec3_t z variable. 2021-12-30 09:57:03 +01:00
Mitchell Richters
68e2691be7 - Capitalise vec3_t y variable. 2021-12-30 09:57:03 +01:00
Mitchell Richters
c549cc5276 - Capitalise vec3_t x variable. 2021-12-30 09:57:02 +01:00
Mitchell Richters
118ceb18ca - Capitalise vec2_t y variable. 2021-12-30 09:57:02 +01:00
Mitchell Richters
3c9cd926ba - Capitalise vec2_t x variable. 2021-12-30 09:57:02 +01:00
Christoph Oelckers
d9d05e90b5 - globally replaced all occurences of '->s().' with '->spr.' 2021-12-30 09:57:00 +01:00
Christoph Oelckers
beddf1e1ca - add slope sprite support to the new renderer.
Some fudging was needed to avoid positioning problems as the renderer is more sensitive to this than Polymost.
2021-12-30 09:56:55 +01:00
Christoph Oelckers
df0c577cf4 - replaced most of numsectors, too. 2021-12-30 09:56:54 +01:00
Christoph Oelckers
f1c0298825 - replaced numwalls with wall.Size in several places. 2021-12-30 09:56:54 +01:00
Christoph Oelckers
6608096ea3 - added a bit more debug validation to the new clipper code. 2021-12-30 09:56:53 +01:00
Christoph Oelckers
fd741c4d49 - Disable debug output 2021-12-30 09:56:52 +01:00
Christoph Oelckers
756ed1c14b - removed the workaround to make Lunatic Fringe not glitch. 2021-12-30 09:56:52 +01:00
Christoph Oelckers
c141c89cfd - fixed the clipper.
* must do proper checks for merged ranges when inserting new ones. The checking code assumes that closed ranges are contiguous.
* when discarding parts of overlapping ranges this may not use merged clip values for its checks.
* ranges that have their clip values altered must be released and reinserted to ensure everything is correct.
2021-12-30 09:56:52 +01:00