Commit Graph

5154 Commits

Author SHA1 Message Date
Bill Currie 75d7f4cecb [renderer] Clean up particles a little
The quake-specific enums are now in the client header, and the particle
system now has a gravity field rather than getting it from
vid_render_data (which I hope to eventually get rid of entirely).
2022-03-29 14:43:38 +09:00
Bill Currie ca9e18b9d6 [renderer] Use initializer labels for vid_render_data
Got tired of figuring out which initializers to remove when editing
vid_render_data_t.
2022-03-29 14:43:38 +09:00
Bill Currie d53b0b0064 [sw] Clean up use of vid.colormap8
The main goal was to not update the colormap pointers when only the
viewport or fov changed.
2022-03-29 14:43:38 +09:00
Bill Currie 3103f400fd [sw] Clean up r_refdef and R_ViewChanged
r_refdef is really meant for holding the various screen "constants" for
the software renderer rather than the more generic scene stuff. All the
fields referenced by the low level rendering code (especially assembly)
have been moved to the beginning of the struct (and nicely fit within 64
bytes). The other fields should be moved elsewhere, but not this commit.

On top of that, R_ViewChanged is much easier to read, and there are
fewer static globals.
2022-03-27 15:32:00 +09:00
Bill Currie aafd5c3d81 [gl] Make perspective matrix setup consistent
Now GL perspective matrix setup matches that of GLSL and Vulkan, and
GL's z_up matrix matches GLSL's (as it should, since they're really
going through the same API). GL also needs the depth adjustmet matrix
now. Other than having to google the docs for glFrustum, there's nothing
wrong with the function itself, but it's nice to have direct control
over the matrices.

In the process, I discovered how horribly confused I've been at times
with respect to the handedness of GL and Quake: GL is right-handed
(y-up, z-out, x-right), as is Quake itself (but z-up, y-left, x-in), but
as the perspective matrix used in the three renderers expects z-in,
having x-right and y-up makes the matrix effectively left-handed (not
for Vulkan though, because there it's y-down, x-right, z-up, so
right-handed again).
2022-03-27 13:23:44 +09:00
Bill Currie 12776e487a [gl] Implement screen warping for liquids
It's not the most efficient code (uses sin() directly), but at least it
works (and with about 75% cpu headroom at 72fps on my machine).
2022-03-26 18:13:37 +09:00
Bill Currie a0adca011f [gl] Get fisheye working with frame buffers
Of course, it's not as correct as glsl or sw due to using polygons and
uvs rather than a fragment shader (not that such is out of the question
since GL 3.0 is requested, but I don't feel like getting shaders going
just for a couple of post-processing effects in an obsolete renderer).
2022-03-26 12:51:31 +09:00
Bill Currie aa41259008 [gl] Clean out the last of the mirror code
Stragglers...
2022-03-26 10:27:16 +09:00
Bill Currie 303756b41b [gl] Remove the envmap command
It has never worked, but it should be easy enough to implement for all
renderers since fisheye does the same thing.
2022-03-26 10:27:16 +09:00
Bill Currie 77a797d04b [renderer] Clean up viewport setting
Software is still a mess, and vulkan never supported viewsize, but
otherwise everything seems fine.
2022-03-26 10:27:16 +09:00
Bill Currie f2bc5b560f [renderer] Clean up post processing
While it's not where I want it to be, it at least now no longer messes
with frame buffer binding or the view ports. This involved switching
around buffers in D_WarpScreen so that the main buffer could be bound
before post-processing.
2022-03-26 00:42:43 +09:00
Bill Currie 25e6865fa5 [glsl] Update particle arrays when maximum changes
The cvar setup for particles is a bit wonky in that the arrays get
initialized using the default max particle count but never updated.
Though things could be improved some more, this solution works (and has
been more or less copied to gl, but I couldn't reproduce the crash
there, or even the valgrind error).
2022-03-25 14:48:01 +09:00
Bill Currie 286344c7b6 [glsl] Implement fisheye rendering
The code dealing with state is a bit of a mess, but everything is
working nicely. Get around 400fps when all 6 faces need to be rendered
(no surprise: it should be about 1/6 of that for normal rendering). The
messy state handling code did not come as a surprise as I suspected
there were various mistakes in my scene rendering "recipe", and fisheye
highlighted them nicely (I'm sure getting this stuff working in Vulkan
will highlight even more issues).
2022-03-25 12:22:16 +09:00
Bill Currie 18aae8205e [glsl] Implement screen warp when in liquids
Finally, after a decade :P Looks pretty good, too, and is (almost)
properly scaled to the resolution (almost because the effect is a little
squashed, but I think the sw renderer does the same).
2022-03-25 09:01:27 +09:00
Bill Currie e263521330 [glsl] Put #line after any #version lines in the chunks
The GLSL compiler requires any #version lines to be the first (real)
line of the program, even #line causes an error, so if the first line of
the chunk starts with #version, insert the #line directive as the second
line.
2022-03-25 09:01:27 +09:00
Bill Currie 00362e9f4e [gl] Explicitly request compatibility profile
And core profile for glsl
2022-03-25 09:01:11 +09:00
Bill Currie 7ca3b56620 [glsl] Fix a silly typo in a comment 2022-03-24 15:54:23 +09:00
Bill Currie 20a2e7e06f [renderer] Get sw fisheye working again
Again, gl/vulkan not working yet (on the assumption that sw would be
trickier).

Fisheye overrides water warp because updating the projection map every
frame is far too expensive.

I've added a post-process pass to the interface in order to hide the
implementation details, but I'm not sure I'm happy about how the
multi-pass rendering for cube maps is handled (or having the frame
buffers as exposed as they are), but mainly because Vulkan will make
implementation interesting.
2022-03-24 15:50:41 +09:00
Bill Currie 0c437492b4 [renderer] Move to using dynamic frame buffers
For now, OpenGL and Vulkan renderers are broken as I focused on getting
the software renderer working (which was quite tricky to get right).

This fixes a couple of issues: the segfault when warping the screen (due
to the scene rendering move invalidating the warp buffer), and warp
always having 320x200 resolution. There's still the problem of the
effect being too subtle at high resolution, but that's just a matter of
updating the tables and tweaking the code in D_WarpScreen.

Another issue is the Draw functions should probably write directly to
the main frame buffer or even one passed in as a parameter. This would
remove the need for binding the main buffer at the beginning and end of
the frame.
2022-03-24 12:56:29 +09:00
Bill Currie 4a917449b7 [sw] Clean up a bunch of unnecessary casts
They won't affect performance, but they cluttered the code making it
harder to read.
2022-03-21 23:15:14 +09:00
Bill Currie 8ee776e8fb [sw] Rename d_pzbuffer to d_zbuffer 2022-03-21 23:12:22 +09:00
Bill Currie 376a173e66 [sw] Set FP precision in R_DrawEntitiesOnList
This used to be handled by R_RenderView (encompassing all of the
rendering) before the scene rendering was moved out to r_screen. This
fixes the stuck time in 32-bit nq-win.
2022-03-21 21:59:07 +09:00
Bill Currie 2e1ddfed0d [sw] Fix some missed symbol renames
Missed due to assembly language :P
2022-03-21 19:24:43 +09:00
Bill Currie 939a73fb52 [sys] Override strdup for 32-bit windows
This fixes some nasty segfaults when calling free due to different
allocators being used.
2022-03-21 19:23:49 +09:00
Bill Currie 296c04c8eb [console] Ensure console lines doesn't exceed view
This fixes a segfault in 32-bit nq-win caused by negative frame times
(due to something going weird with Sys_DoubleTime).
2022-03-21 19:21:54 +09:00
Bill Currie 4c90c3c4bb [sw] Remove pixbytes from sw_ctx_t
It's no longer needed as the sw renderer is 8-bit only.
2022-03-21 14:37:28 +09:00
Bill Currie b82a353a20 [vid] Remove VID_InitBuffers
Its guts have been moved to D_Init temporarily while I work on the
frame buffer design. This is actually a big part of that work as it
moves most of the frame buffer creation into the one place, making it
easier to ensure I get all the sub-buffers and caches created.
2022-03-21 14:35:11 +09:00
Bill Currie 3b4608a0cd [vid] Update glx handling to ensure GL 3.0
With what I have planned for frame buffers etc, GL 3.0 will be needed
even for the fixed-function GL renderer, and then I might even take the
GLSL renderer to 4.6 (dunno yet). This means that wgl will need to be
updated too, and I've found the info I need for that, but it's a bit
much to take on just yet.
2022-03-20 12:52:20 +09:00
Bill Currie 0f30f0a133 [mathlib] Remove suspicious IS_NAN
The implementation looks wrong (more like infinity). Where it was used
is currently disabled, but the usages were replaced with C99's isnan.
2022-03-19 12:50:08 +09:00
Bill Currie 65af7fb4a4 [mathlib] Remove frustum global
It should never have been there and is now in the refdef (not its final
home: it should probably be part of the camera).
2022-03-19 12:33:12 +09:00
Bill Currie b912c2a667 [renderer] Clean up R_SetFrustum
The only global it touches now is frustum, and that needs fixing in
mathlib (good grief, we (probably I) did some weird things when merging
the code).
2022-03-19 10:06:38 +09:00
Bill Currie c3f38e1c79 [renderer] Remove player_entity field
This was a hold-over from the gl mirror code.
2022-03-19 09:46:53 +09:00
Bill Currie ee51d06aa3 [renderer] Clean up a lot of recalc_refdef use
I think the widespread use of recalc_refdef (and force_fullscreen) was
the result of a rushed merge of the renderer and video code (I do seem
to remember sprinkling them around). This cleans the two out of the
client code.
2022-03-19 00:56:30 +09:00
Bill Currie a4479f4840 [cvar] Ensure floats can round-trip when setting
The way Cvar_SetValue is used, floats need to be able to round-trip
reliably and thus need up to 9 digits of precision.
2022-03-18 11:42:14 +09:00
Bill Currie c8c742b240 [renderer] Use a better calculation for fov_y
This avoids the possibility of a singularity (and thus the temptation to
use Sys_Error). While the rendering is rubbish, 0 degrees is allowed
because values less than 1 should be allowed, but where does one stop?
170 is the maximum in order to avoid any issues with (near) parallel or
inverted frustum planes (or other fun things) in the low level code.
2022-03-18 11:14:24 +09:00
Bill Currie 2b72506868 [renderer] Handle transparent surfaces
Other than the view model (undecided on the approach) this has
R_RenderView pretty much pulled out of the low level renderers. With
this, I'll be able to focus on scene handling for a bit then getting
shadows and fisheye working (again for fisheye).
2022-03-18 01:08:19 +09:00
Bill Currie c05476f94b [renderer] Move most of the scene rendering into r_screen
r_screen isn't really the right place, but it gets the scene rendering
out of the low-level renderers and will make it easier to sort out
later, and hopefully easier to figure out a good design for vulkan.
2022-03-17 17:57:50 +09:00
Bill Currie 961e6d9e6c [gl] Remove unnecessary light map update code
gl_overbright_f shouldn't need to run through any entity queues to
update the light maps as only the world model has light maps, and
hitting the world model should hit all its sub-models.
2022-03-17 17:46:25 +09:00
Bill Currie 833fb2f4f8 [sw] Make alight_t lightvec an actual vector
The change to using separate per-model-type entity queues resulted in
the lighting vector used for alias and iqm models being in an ephemeral
location (in the shared setup_lighting function's stack frame). This
resulted in the model rendering code getting a garbage vector due to it
being overwritten by another stack frame. What I don't get is why the
garbage varied from run to run for the same demo (demo2, the first scrag
behind the start door showed the bad lighting nicely), which made
tracking down the offending commit (and thus the code) rather
troublesome, though once I found it, it was a bit of a face-palm moment.
2022-03-17 15:38:22 +09:00
Bill Currie 6c29904b1d [sw] Clean up R_SetSkyFrame a little
Move the constant data into R_InitSky so it doesn't get calculated every
frame (doesn't make much difference of course, but...)
2022-03-17 13:37:21 +09:00
Bill Currie d8a4c8dbe9 [renderer] Clean up r_bsp a little
Move r_pcurrentvertbase into the sw renderer, cleaning up gl's use of
(not really needed there). Not ready to move r_bsp into the main bin yet
as there are linking issues since only the low-level code references any
of its symbols.
2022-03-17 13:09:20 +09:00
Bill Currie 7ee9159638 [renderer] Move common R_SetupFrame code to r_screen
The code is really part of scene (not a typo wrt r_screen: that is
misnamed as such, or at least SCR_UpdateScreen needs to be split into
screen (2d overlay, really) and scene updates).

This breaks fisheye rendering as the fisheye code calls the actual scene
render code multiple times, but the fisheye code is called by said scene
render code via a diversion. The fisheye needs to be moved out to the
high level scene render, but that will takes some extra work for frame
buffer setup.
2022-03-17 12:00:43 +09:00
Bill Currie 335d387ba8 [renderer] Clean up some stray vup etc
Now vup, vfwd, vright names are restricted to only the software renderer
(the only one that has such global variables).
2022-03-17 11:55:58 +09:00
Bill Currie 0e58f96d37 [renderer] Fix more plugin linking errors 2022-03-17 11:21:38 +09:00
Bill Currie 1458f61a48 [renderer] Fix non-static linking of graph code
Obviously forgot to test the changes I made to graph rendering in
non-static builds. Oops :P
2022-03-17 10:51:29 +09:00
Bill Currie d3bfc54a68 [sw] Disable water warp when doing fisheye
The two aren't compatible (but warping might be doable in the fisheye
code). The whole frame setup code needs a rework, and really, even the
buffer handling.
2022-03-17 09:42:09 +09:00
Bill Currie 9241efaf1e [sw] Use a smaller size for the fish eye cube map
This speeds up sw rendering of the fish eye effect.
2022-03-16 13:55:44 +09:00
Bill Currie ab78e9d2ff [sw] Make worldent local static
It being on the stack was a bad idea as R_RenderWorld returns before the
scans are rendered and thus the entity pointer winds up pointing to
abandoned stack space.
2022-03-15 16:54:59 +09:00
Bill Currie 91d7a80dff [renderer] Get timegraph and zgraph working
Only for sw and gl right now, but this sorts out the issues that
prevented the graphs working at all.
2022-03-15 15:42:43 +09:00
Bill Currie 5a57280aa9 [gl] Use glGenTextures to allocate texture numbers
While the scheme of using our own allocated did work just fine, fisheye
rendering uses glGenTextures which caused a texture id clash and thus
invalid operations (the cube map texture happened to be the same as the
console background texture). Sure, I could have just "fixed" the fisheye
init code, but this brings gl closer in line with glsl (which makes
extensive use of glGenTextures and glDeleteTextures). This doesn't fix
any texture leaks gl has (plenty, I imagine), but it's a step in the
right direction.
2022-03-15 13:29:05 +09:00
Bill Currie fb4fd979ec [gl] Move error check support into a better place
This makes it a little easier to spam checks everywhere and thus narrow
down the location of the error.
2022-03-15 12:33:25 +09:00
Bill Currie 1d93bcfc34 [gl] Clean out some missed mirror code 2022-03-15 00:09:37 +09:00
Bill Currie fd805886f7 [renderer] Get fisheye working again
Only for gl and sw at the moment (want to merge things further before I
do anything for glsl or vulkan). However, with with I've learned getting
gl and sw to work, glsl and vulkan will be trivial.
2022-03-14 23:51:30 +09:00
Bill Currie 7402fcfd0c [renderer] move r_worldentity and r_viewleaf into refdef
More cleanup of globals that seem to be quake specific.
2022-03-14 15:27:43 +09:00
Bill Currie 2641fe3241 [gl] Remove some dead code
R_RecursiveLightUpdate has been obsolete for a very long time, and
R_Mirror is just wrong (needs envmaps etc, wonder if it can be done in
the fixed function code using skyclip?)
2022-03-14 15:12:33 +09:00
Bill Currie 56c39c34ba [renderer] Remove namehack.h
Finally. I never liked it (felt bad adding it in the first place), and
it has caused confusion with function and global variable names, but it
did let me get the render plugins working.
2022-03-14 14:31:23 +09:00
Bill Currie 04ba724382 [sw] Clean up alias and iqm matrix setup
This removes some FIXMEs and might even speed things up ever so
slightly.
2022-03-14 11:56:10 +09:00
Bill Currie 16440bce2d [mathlib] Clean up AngleVectors comments a little
They're still slightly confusing, but the situation itself is confusing,
but the comments should be a little more helpful now as they are more
explicit about the orientation of the matrices and just which axis
points where.
2022-03-14 11:51:50 +09:00
Bill Currie bce7d5b832 [renderer] Clean up use of vup/vright/vpn
This moves the common camera setup code out of the individual drivers,
and completely removes vup/vright/vpn from the non-software renderers.
This has highlighted the craziness around AngleVectors with it putting
+X forward, -Y right and +Z up. The main issue with this is it requires
a 90 degree pre-rotation about the Z axis to get the camera pointing in
the right direction, and that's for the native sw renderer (vulkan needs
a 90 degree pre-rotation about X, and gl and glsl need to invert an
axis, too), though at least it's just a matrix swizzle and vector
negation. However, it does mean the camera matrices can't be used
directly.

Also rename vpn to vfwd (still abbreviated, but fwd is much clearer in
meaning (to me, at least) than pn (plane normal, I guess, but which
way?)).
2022-03-14 09:45:27 +09:00
Bill Currie f3768e3dfb [renderer] Remove currententity
One more global in the trash :)
2022-03-11 16:39:08 +09:00
Bill Currie 64666cfa5b [renderer] Clean up most uses of currententity
Just some brush model related code in the software renderer remaining.
2022-03-11 15:07:38 +09:00
Bill Currie 3bdec49587 [sw] Remove r_origin entirely
And clean up a lot of modelorg (a little trickier than it was for gl due
to messy usage).
2022-03-11 13:10:20 +09:00
Bill Currie 2606564955 [sw] Remove some dead code 2022-03-10 11:37:19 +09:00
Bill Currie 0cfff27cd0 [sw] Move surf and edge stats printing to begin_frame
Part of cleaning up SetupFrame
2022-03-09 22:53:15 +09:00
Bill Currie 3414eb12a3 [renderer] Move r_ambient and r_drawflat to client code
It makes more sense for these cvars to be under client control via
r_refdef. Completely disabled in qw, and currently ignored in nq.
2022-03-09 22:51:21 +09:00
Bill Currie 5477352e93 [renderer] Abandon sw32 altogether
I'd been considering it for a while, but in the end, all the issues it
presented made me decide it wasn't worth merging and was never really
worth keeping: it was a neat proof of concept but of little actual use,
especially now everyone either has an OK GPU or would want to stick to
8-bit rendering anyway (sorry L-Havoc).

However, both it and my merge work are preserved in git history :)
2022-03-09 21:36:15 +09:00
Bill Currie 19348f678f [win] Get the software renderer hobbling
16 and 32 bit rendering are disabled at the moment because there's a
weird segfault I need to fix, but the 8-bit dynamic lights are doing
weird things (for x11, too) when updating the light maps.
2022-03-09 20:00:59 +09:00
Bill Currie dce1a4d292 [util] Force 32-bit windows malloc to be 16-byte aligned
By replacing it :P (and its friends). This gets the non-sw renderers
working with recent scene changes.
2022-03-09 20:00:51 +09:00
Bill Currie 747494c03a [sw] Fix 16 and 32 bit alias model rendering
Intel asm needs testing still, but C is working nicely.
2022-03-09 16:56:36 +09:00
Bill Currie 6377734e32 [renderer] Merge the two software renderers
I got tired of having to maintain two separate software renderers, but
didn't want to just nuke sw32, so its core changes are merged into sw.

Alias model rendering is broken, but I know exactly what's wrong and how
to fix it, just need to take care due to asm.
2022-03-09 15:56:19 +09:00
Bill Currie 5c8f3ec3ac [renderer] Fix some non-static linking issues
Well, hopefully I'll get the root cause sorted eventually. I really hate
globals.
2022-03-09 06:55:31 +09:00
Bill Currie 1fef0e50e0 [particles] Use read data instead of written data
I'm not sure this makes any difference (at 2500fps, the noise is crazy),
but fewer instructions can't hurt.
2022-03-09 06:47:43 +09:00
Bill Currie a9cc51b22c [particles] Use correct index for source ramp
This fixes both the weird colors and a segfault in the 32-bit software
renderer.
2022-03-08 20:16:18 +09:00
Bill Currie 20536d83eb [vulkan] Clean up r_origin and modelorg
Same deal as for GL and GLSL.
2022-03-08 18:41:09 +09:00
Bill Currie 075a0fe326 [renderer] Clean up r_origin and modelorg
So far, in gl and glsl, but viewposition is much clearer than r_origin
(despite being the same thing), and modelorg is just confusing (I think
it's the view position relative to the current model).
2022-03-08 03:47:36 +09:00
Bill Currie 48c225da89 [renderer] Merge the fog support code
GL still has its own functions for enabling and disabling fog while
rendering, but GLSL doesn't need such (thanks to the shaders), nor will
vulkan (and the software renderers don't support fog).
2022-03-08 02:28:19 +09:00
Bill Currie af0c66dff9 [renderer] Move frame rendering out a layer.
This is a step towards high-level unification of the renderers, as far
as possible keeping only actual low-level implementation details in the
individual renderers (some higher level stuff, eg shadows, is expected
to be per-renderer as some things are just not feasible to implement in
all renderers). However, the idea is to move the high-level
functionality into scene rendering.
2022-03-08 01:04:40 +09:00
Bill Currie e1d38a9373 [renderer] Force-link r_efrag.o for static qwaq
As qwaq doesn't yet do any 3d rendering, it doesn't use efrags and thus
wasn't pulling in the object file, but the various renderers were trying
to access it. And I thought plugin builds were more difficult (I had
forgotten).
2022-03-07 16:59:01 +09:00
Bill Currie ea223f6312 [sw] Clean up use of r_rectdesc
I have no idea why the struct even had a local vrect that was used for
temporary storage.
2022-03-07 16:57:22 +09:00
Bill Currie ea2fd32228 [renderer] Merge screenshot code as much as possible
Only CaptureBGR is per-renderer as the rest of the screenshot code uses
it to do the actual capture (which is target dependent). Vulkan is
currently broken due to capture being an asynchronous process and the
rest of the code expecting capture to be synchronous (also, bgr vs rgb).

The best thing is all renderers now write the same format (currently
png).
2022-03-07 15:04:54 +09:00
Bill Currie 2eae2e5d74 [renderer] Move some functions from plugins to main lib
One step in cleaning up vid_render_funcs.
2022-03-07 13:40:04 +09:00
Bill Currie 2a87983bf4 [sw] Remove some unnecessary casting
I'm not sure what the author of that code was thinking (maybe trying to
do 4 pixels at a time?), but the resulting code still did only one.
Better to remove all the casts, use the right pointer type, and keep the
code clear.
2022-03-07 08:47:54 +09:00
Bill Currie 5eb397dd31 [renderer] Remove more dead code
The back-buffer and video buffer locking code was pretty much never more
than stubs (except maybe in dos quake).
2022-03-07 08:44:53 +09:00
Bill Currie 04fd9baff5 [glsl] Reorder some code for consistency 2022-03-07 08:43:23 +09:00
Bill Currie 9514ad1ae4 [gl] Draw sky chains before brush entities
Drawing sky chains first ensures that sky surfaces correctly block parts
of the map that should not be visible (by writing the correct depth to
the depth buffer when doing box or dome skies). Writing brush models
first means that the models (ammo boxes etc) could be visible when they
should not be.
2022-03-07 08:40:39 +09:00
Bill Currie 71c1b4e0c4 [gl] Clean up some triple buffer and multi-texture cvar mess
Excess declarations for gl_multitexture_f, and move gl_triplebuffer into
a callback.
2022-03-07 08:38:38 +09:00
Bill Currie 1ea3a3807e [renderer] Clean up a pile of dead screen declarations
The declarations were either unused, or the functions empty stubs for
all renderers.
2022-03-06 13:47:41 +09:00
Bill Currie 45c3c6d7be [screen] Clean up some dead declarations 2022-03-05 14:35:56 +09:00
Bill Currie 73444c3b7a [ruamoko] Give the scene resource block a rua prefix
No effect on the code itself, but it makes debugging much easier when
there aren't two very different structs with the same name.
2022-03-05 02:05:59 +09:00
Bill Currie d69355f521 [renderer] Support multiple entity queues
While there's currently only the one still, this will allow the entities
to be multiply queued for multi-pass rendering (eg, shadows). As the
avoidance of putting an entity in the same queue more than once relies
on the entity id, all entities now come from the scene (which is stored
in cl_world in the client code for nq and qw), thus the extensive
changes in the clients.
2022-03-05 02:05:39 +09:00
Bill Currie 6ec8e29429 [scene] Track hierarchies instead of root transforms
The root transform of each hierarchy can be extracted from the first
transform of the list in the hierarchy, so no information is lost. The
main reason for the change is I discovered (obvious in hindsight) that
deleting root transforms was O(n) due to keeping them in an array, thus
the use of a linked list (I don't expect a hierarchy to be in more than
one such list), and I didn't want the transforms to be in a linked list.
2022-03-04 06:43:30 +09:00
Bill Currie 7906db5a37 [client] Set camera rotation for chase mode 1
With the change in cl_view separating chase cam updates from
first-person updates, the auto-rotation of the camera was lost.
2022-03-02 19:13:58 +09:00
Bill Currie f296cb897e [renderer] Make draw order a little more consistent
GL and GLSL were drawing the view model after particles instead of
before. For GL, this is likely due to avoiding fog affecting the view
model (which I think is not the right thing to do), and GLSL due to
copying GL (because I had no idea at the time). This makes the two
renderers consistent with the software renderers, and might even speed
things up a little as that's one less set of blends to do when the
particles are covered by the view model (I don't expect much
difference).
2022-03-02 16:29:40 +09:00
Bill Currie ae6970a005 [renderer] Split entity queue into per-model-type
While I doubt the difference is all that significant, this should speed
up entity rendering because it cuts out a lot of branching, and
eliminates scanning the same list multiple times only to not do anything
for large chunks of the list.
2022-03-02 15:00:32 +09:00
Bill Currie ab91d73635 [scene] Use scene resources for the main hierarchy block
This will reduce the memory churn when creating hierarchies as
transforms switch between being root and child.
2022-03-02 10:49:41 +09:00
Bill Currie b210f01837 [scene] Manage scene roots in transform
Since transforms now know the scene to which they belong, and they know
when they are root and when not, getting the transform code to manage
the scene roots is the best way to keep the list of root transforms
consistent.
2022-03-02 10:43:52 +09:00
Bill Currie 54c3b4cc53 [client] Get the chase camera working with input
It turns out cam_controls is for pointing the player model in the
direction of movement rather than controlling the camera (I should add
proper camera controls).
2022-03-01 16:07:04 +09:00
Bill Currie ee3c9fa59f [client] Sort out the chase mode input FIXME
It's messing with player motion (so not working properly), but at least
now it compiles, I can get it working.
2022-03-01 15:31:00 +09:00
Bill Currie 8407e3acd1 [client] Make input axes accessible and add camera axes
And clean up the names (viewdelta_position_forward -> in_move_forward).
2022-03-01 15:15:33 +09:00
Bill Currie 7c07118541 [mathlib] Clean up AngleVectors comment
I finally spent the time to work out what it was trying to say. Still
not sure it's clear, but what is clear is that there was probably some
disagreement at Id about the orientation of the world.
2022-03-01 14:52:45 +09:00