Commit graph

12660 commits

Author SHA1 Message Date
Bill Currie
600e7ecbea [renderer] Resurrect r_dlightframecount
This fixes dynamic light map updates for gl, glsl, and sw, but gl has
problems with map submodels not being dynamically lit.
2022-05-10 17:07:16 +09:00
Bill Currie
be7a7d8bec [renderer] Fix the other renderers for qwaq not loading gfx.wad
The whole draw system needs an overhaul :/
2022-05-09 16:30:05 +09:00
Bill Currie
2ebefd7850 [wad] Return 0 if no wad file is loaded
This allows QF to load without a wad file as it will use the internal
character definition.
2022-05-08 23:56:11 +09:00
Bill Currie
d1d1cc4362 [qwaq] Generate a palette and colormap
The palette is a modified version of the default VGA colormap as
explained by Noah Johnson (https://github.com/canidlogic/vgapal) and the
generation code is heavily influenced by his code. However, I've
reversed the HSV groups so I could have the pure bright colors in the
fullbright range and added a few colors in the 248-255 range (mostly
greens and ambers meant to be close to the old phosphor monitors).

The colormap is generated by laying the colors from the palette across
the middle of the map (rows 31 and 32) then linearly interpolating from
0 to the color, and the color to 2x the color (clamped) and then
converting back to a palette. Mr Fixit actually looks ok still in the
software renderer (unaffected in the others) though quakeguy is a hoot
in all the renderers :).
2022-05-08 23:54:32 +09:00
Bill Currie
b33df8b698 [vulkan] Clean up a pile of unnecessary includes 2022-05-08 17:57:40 +09:00
Bill Currie
09d5c76fe9 [vulkan] Implement IQM animations
Unfortunately, the animations are pre-baked (by the loader) blocking
run-time determined animations (IK etc). However, this at least gets
everything working so the basics can be verified (the shader posed some
issue resulting in horror movies ;).
2022-05-08 14:21:40 +09:00
Bill Currie
e62b7d7b05 [vulkan] Allow QFV_ImageFormat to select unorm or srgb
This is definitely something that should be selectable per image and not
hard-coded into the engine.
2022-05-08 14:15:20 +09:00
Bill Currie
1dff24dbd0 [scene] Implement Hierarchy_Copy
It copies an entire hierarchy (minus actual entities, but I'm as yet
unsure how to proceed with them), even across scenes as the source scene
is irrelevant and the destination scene is used for creating the new
transforms.
2022-05-08 11:14:00 +09:00
Bill Currie
2a0bbfb4e9 [io_mesh_qfmdl] Use an int for NLA start frame
At at some stage blender enforced frames being integers (In the past,
there was support for fractional, I think, but I also seem to remember
it not working) (yes, for anybody looking, this commit message is more
or less copied from io_object_mu).
2022-05-08 02:15:50 +09:00
Bill Currie
c924329843 [scene] Use same id for entity queue test and add
This fixes the multiple draws of the same entity. Should be a small
speedup for all renderers :)
2022-05-07 15:45:11 +09:00
Bill Currie
08c8b8d51b [vulkan] Add entity labels to command queues
Brush models looked a little too tricky due to the very different style
of command queue, so that's left for now, but alias, iqm and sprite
entities are now labeled. The labels are made up of the lower 5 hex
digits of the entity address, the position, and colored by the
normalized position vector. Not sure that's the best choice as it does
mean the color changes as the entity moves, and can be quite subtle
between nearby entities, but it still helps identify the entities in the
command buffer.

And, as I suspected, I've got multiple draw calls for the one ogre. Now
to find out why.
2022-05-07 15:45:11 +09:00
Bill Currie
18af340160 [vulkan] Normalize iqm normals
Same mistake as for alias, I simply forgot to do it for iqm when I got
it working.
2022-05-07 15:45:11 +09:00
Bill Currie
c59ab8882d [vulkan] Label renderpass and subpass sections
This makes finding the relevant commands in render doc much much easier.
2022-05-07 15:45:11 +09:00
Bill Currie
8204e8a8c1 [vulkan] Clear lights when the scene is cleared
Fixes a segfault when shutting down my test program.
2022-05-07 12:12:02 +09:00
Bill Currie
8795b8eb91 [vulkan] Get IQM rendering working
The bones aren't animated yet (and I realized I made the mistake of
thinking the bone buffer was per-model when it's really per-instance (I
think this mistake is in the rest of QF, too)), skin rendering is a
mess, need to default vertex attributes that aren't in the model...
Still, it's quite satisfying seeing Mr Fixit on screen again :)

I wound up moving the pipeline spec in with the rest of the pipelines as
the system isn't really ready for separating them.
2022-05-07 10:14:22 +09:00
Bill Currie
3f7cbae4d0 [vulkan] Rework builtin plist handing
The plists can now be accessed by name and the forward render pass
config is available (but not used, or tested beyond syntax). I was going
to have the IQM pipeline spec separate but ran into limitations in the
system (which needs a lot of polish, really).
2022-05-07 10:08:30 +09:00
Bill Currie
ea8f991bf3 [ruamoko] Clear efrags when destroying an entity
This ensures the rendering system won't attempt to draw the entity after
it has been destroyed.
2022-05-07 09:53:26 +09:00
Bill Currie
91c877b1a1 [scene] Zero freshly allocated entity memory
I don't remember why I didn't want to clear it. I hope this doesn't
cause other trouble.
2022-05-07 00:51:44 +09:00
Bill Currie
f41031f270 [ruamoko] Add style parameter to Light_AddLight
It's there in the builtin, but I forgot it in the header/lib.
2022-05-07 00:50:27 +09:00
Bill Currie
ae9e8f8f4e [plist] Report line-relative character position in errors
Far better than string-relative.
2022-05-06 20:10:41 +09:00
Bill Currie
b69b7b6a4a [vulkan] Clean up duplication in qfpipeline
That @inherit is pretty useful :) This makes it much easier to see how
different pipelines differ or how they are the similar. It also makes it
much clearer which sub-pass they're for.
2022-05-06 19:38:14 +09:00
Bill Currie
79add5590b [build] Fix some make distcheck issues
The never ending battle against bit-rot.
2022-05-06 15:50:13 +09:00
Bill Currie
9c7c081772 [io_mesh_qfmdl] Skip space after parsing a value
Fixes a bogus error on the likes of offset = { x = 0; y = 0 }; (ie,
between the 0 and } )
2022-05-06 15:08:56 +09:00
Bill Currie
5b103f2570 Merge branch 'wip-rua_scene' 2022-05-06 08:34:31 +09:00
Bill Currie
551c6b82cb [vulkan] Tweak spotlight cone edges a little 2022-05-06 08:32:19 +09:00
Bill Currie
ed82b5f299 [ruamoko] Clean up lighting data blocks
Don't want to leak memory.
2022-05-06 08:26:55 +09:00
Bill Currie
4abcaff980 [vulkan] Normalize the normal vectors on alias models
I was wondering why scaled-down quake-guy was dimmer than full-size
quake-guy. And the per-fragment normalization gives the illusion of
smoothness if you don't look at his legs (and even then...).
2022-05-05 23:49:31 +09:00
Bill Currie
72cb7d3fdd [scene] Make the empty world work with lights
Needed visibility and a sky surf flag, otherwise no lights were visible
(why does this seem familiar?).
2022-05-05 23:49:31 +09:00
Bill Currie
d14b17567e [ruamoko] Add builtins for adding lights to scenes
Pretty much just raw wrappers around the C versions. I'm not sure about
Light_EnableSun (even in C), but it does build the sky surf pvs.
2022-05-05 23:49:31 +09:00
Bill Currie
95264b3a54 [ruamoko] Move emtpy_world into scene
And use it as the default worldmodel for new scenes. Since it's
statically allocated, it shouldn't cause any harm so long as no one
tries to free it.
2022-05-05 23:49:31 +09:00
Bill Currie
d850285e3f [ruamoko] Allow scenes to be fetched by C code
Need to clean up that part of the API, though.
2022-05-05 23:49:31 +09:00
Bill Currie
7b275ebab6 [vulkan] Don't update lights that don't exist
However, the lighting pass still needs to be run in order to generate
the solid color image.
2022-05-05 23:49:31 +09:00
Bill Currie
2818fc12a5 [model] Initialize r_notexture_mip in the right places
That being in the renderer. This is why qwaq needed that call to
Mod_ProcessTexture (but no longer does :)
2022-05-05 23:49:31 +09:00
Bill Currie
41a12f066b [client] Clean up light loading
By adding Light_AddLight to scene light management
2022-05-05 23:49:31 +09:00
Bill Currie
b2928b5ed7 [client] Reverse the direction of sunlight
Maps specify sunlight as shining in a specific direction, but the
lighting system wants the direction to the sun as it's used directly in
shading calculations. Direction correctness confirmed by disabling other
lights and checking marcher's outside scene (ensuring the flat ground
was lit). As a bonus, I've finally confirmed I actually have the skybox
in the correct orientation (sunlight vector more or less matched the
position of the sun in marcher's sky).
2022-05-05 23:49:31 +09:00
Bill Currie
d60602421b [vulkan] Ensure dynamic lights are positional
I'm not sure what's up with the weird lighting that results from dynamic
lights being directional (sunlight works nicely in marcher, but it has a
unit vector for position).
2022-05-05 23:49:31 +09:00
Bill Currie
df5b471342 [scene] Support ambient lighting in worldspawn
Abyss of Pandemonium uses global ambient light a lot, but doesn't
specify it in every map (nothing extracting entities and adding a
reasonable value can't fix). I imagine some further tweaking will be
needed.
2022-05-05 23:49:30 +09:00
Bill Currie
c26c3b2739 [mdl] Show bytes remaining if not enough for unpack
It turns out Abyss of Pandemonium has a truncated mdl file causing
buffer overruns.
2022-05-05 23:49:30 +09:00
Bill Currie
a31ff3153c [gamecode] Fail gracefully on invalid entity strings
Returning null (and printing some error messages) is far friendlier than
aborting.
2022-05-05 23:49:30 +09:00
Bill Currie
4a4e16399a [client] Clean up world entity parsing a bit
Now the entities are parsed only once and the resulting data reused.
2022-05-05 23:49:30 +09:00
Bill Currie
9ee0eada1f [vulkan] Move non-specific lighting code out of Vulkan
The parsing of light data from maps is now in the client library, and
basic light management is in scene. Putting the light loading code into
the Vulkan renderer was a mistake I've wanted to correct for a while.
The client code still needs a bit of cleanup, but the basics are working
nicely.
2022-05-05 23:49:30 +09:00
Bill Currie
e9ad7b748b [renderer] Use scene_t to set the model data
This replaces *_NewMap with *_NewScene and adds SCR_NewScene to handle
loading a new map (for quake) in the renderer, and will eventually be
how any new scene is loaded.
2022-05-05 14:46:02 +09:00
Bill Currie
e323fbbbed [vulkan] Rework lighting model to be more algebraic
This leaves only the one conditional in the shader code, that being the
distance check. It doesn't seem to make any noticeable difference to
performance, but other than explosion sprites being blue, lighting
quality seems to have improved. However, I really need to get shadows
working: marcher is just silly-bright without them, and light levels
changing as I move around is a bit disconcerting (but reasonable as
those lights' leaf nodes go in and out of visibility).
2022-05-05 08:40:02 +09:00
Bill Currie
e1f4df27c3 [qw] Fix inverted chat mode
This has been bugging me for a while whenever I tested qw. Just a silly
logic error. The whole system needs work, though.
2022-05-04 23:53:54 +09:00
Bill Currie
5dd2ea242e [qw] Fix inverted chat mode
This has been bugging me for a while whenever I tested qw. Just a silly
logic error. The whole system needs work, though.
2022-05-04 23:52:26 +09:00
Bill Currie
618453629f [qw] Call SV_Physics_Init_Cvars during server init
This fixes the broken physics. Really, not that bad considering how
extensive the cvar revamp was.
2022-05-04 23:16:12 +09:00
Bill Currie
bbb66e13f8 [nq] Fix incorrect handling of argv in PF_WriteBytes
This fixes an illegible server message error on going through a teleport
in the start map (how I noticed the problem). Funnily enough, I had
spotted the mistake when editing the qw version, but forgot to correct
the nq version.
2022-05-04 23:16:12 +09:00
Bill Currie
a4d3352ca1 [qw] Call SV_Physics_Init_Cvars during server init
This fixes the broken physics. Really, not that bad considering how
extensive the cvar revamp was.
2022-05-04 23:13:24 +09:00
Bill Currie
3bd50c1555 [nq] Fix incorrect handling of argv in PF_WriteBytes
This fixes an illegible server message error on going through a teleport
in the start map (how I noticed the problem). Funnily enough, I had
spotted the mistake when editing the qw version, but forgot to correct
the nq version.
2022-05-04 22:37:52 +09:00
Bill Currie
675c82b47b [nq,qw] Do a little more diff reduction on sbar.c
It's rather difficult due to hipnotic and roque in nq, but still,
progress is progress.
2022-05-04 21:03:34 +09:00