Commit Graph

4351 Commits

Author SHA1 Message Date
Bill Currie 5b1ee0e6f6 [vulkan] Fix an inappropriate cast
I'm surprised that worked at all (and more surprised it got past linux
gcc).
2021-03-27 19:55:43 +09:00
Bill Currie a9bd436837 [build] Autoconfiscate printf format attribute
I don't know if gnu_printf is appropriate for all cases, but it is
needed for mingw32.
2021-03-27 19:52:59 +09:00
Bill Currie 7c788a6e7a [util] Use size_t for dstring length params
While not overly wrong, unsigned is not really appropriate.
2021-03-27 19:08:18 +09:00
Bill Currie 0167456b21 [util] Loosen up SEB relative epsilon a little
1e-8 is a little too tight, the normal was 4.5x the computed epsilon.
Going to 1e-6 still keeps things tight.
2021-03-27 15:04:13 +09:00
Bill Currie a32e2319e2 Merge branch 'master' into win-merge 2021-03-25 22:42:16 +09:00
Bill Currie c9f1d770e0 Merge master into csqc-improvements
That was a mess
2021-03-25 22:01:31 +09:00
Bill Currie 0cae54d25d Move the tex conversion to libQFimage.
This is for the conversion /to/ paletted textures. The conversion is
necessary for csqc support. In the process, the conversion has been sped up
by implementing a color cache for the conversion process. I haven't
measured the difference yet, but Mr Fixit does seem to load much faster for
the sw renderer than it did before the change (many months old memory).
2021-03-25 18:16:24 +09:00
Bill Currie 67c220de76 Make R_SetVrect const-correct. 2021-03-25 18:14:17 +09:00
Bill Currie 91e3769c05 Recalculate the fov when the cvar changes.
This separate the FOV calculations from other refdef calcs, cleaning up the
renderer proper and making it easier for other parts of the engine (eg,
csqc) to update the fov.
2021-03-25 18:14:03 +09:00
Bill Currie 66fda1fddb Rewrite edict access.
The server edict arrays are now stored outside of progs memory, only the
entity data itself (ie data accessible to progs via ent.fld) is stored in
progs memory. Many of the changes were due to code accessing edicts and
entity fields directly rather than through the provided macros.
2021-03-25 18:13:48 +09:00
Bill Currie 32c2e013ca [vulkan] Add missed screen capture files
Rather critical to the build (and screenshots)
2021-03-25 16:00:19 +09:00
Bill Currie 999dd8248b [vulkan] Implement sky box loading and rendering
Loading is broken for multi-file image sets due to the way images are
loaded (this needs some thought for making it effecient), but the
Blender environment map loading works.
2021-03-25 15:54:34 +09:00
Bill Currie c5c44da727 [vulkan] Implement screenshot
Finally, I can brag about my progress on irc :)
2021-03-24 19:20:53 +09:00
Bill Currie 51d6ec7c8c [vulkan] Fix what looks like a thinko
It looked like the code would have deleted a replacement swapchain
instead of the one being replaced.
2021-03-24 12:04:09 +09:00
Bill Currie a0d47de439 [vulkan] Suppress all the debug output
silence is golden
2021-03-23 13:04:22 +09:00
Bill Currie 5d9bf32d3c Merge branch 'vulkan' 2021-03-23 12:31:58 +09:00
Bill Currie 7e946a4de9 [vulkan] Implement water surface rendering
They're unlit (fullbright, but that's nothing new for quake), but
working nicely. As a bonus, sort out the sky pass (forced to due to the
way command buffers are used).
2021-03-23 12:24:24 +09:00
Bill Currie 6e0312658d [vulkan] Fix sky depth issues
There were actually several problems: translucency wasn't using or
depending on the depth buffer, and the depth buffer wasn't marked as
read-only in the g-buffer pass. Getting that correct seems to have given
bigass1 a 0.5% boost (hard to say, could be the usual noise).
2021-03-23 11:26:24 +09:00
Bill Currie 5ac807d4b2 [vulkan] Remove the old forward renderpass spec
I doubt I'll go back to it, and it was in the wrong place anyway.
2021-03-23 10:12:26 +09:00
Bill Currie d4e1bfb8b8 [vulkan] Clean up the pipeline specifications
While being able to write pipeline specs like this was the end goal of
the parsing sub-project, I didn't realize it was already usable. This
sure makes going through the pipeline specs much easier.
2021-03-23 10:01:13 +09:00
Bill Currie 81956095f1 [vulkan] Use correct vertex shader for skys
This gets skys rendering again, but their depth is incorrect.
2021-03-23 08:25:56 +09:00
Bill Currie de581501fb [vulkan] Early out from lights that are too distant
Gives a 43% speed boost to bigass1 timedemo (366 -> 525 fps).
2021-03-22 20:33:42 +09:00
Bill Currie 4eecbe867d [vulkan] Implement deferred emission (fullbrights)
That was... easier than expected. A little more tedious that I would
have liked, but my scripting system isn't perfect (I suspect it's best
suited as the output of a code generator), and the C side could do with
a little more automation.
2021-03-22 19:08:16 +09:00
Bill Currie 5173414d97 [vulkan] Implement light styles
Other than dealing with shader data alignment issues, that went well :).
Nicely, the implementation gets the explicit scaling out of the shader,
and allows for a directional flag.
2021-03-22 13:13:26 +09:00
Bill Currie 410fecd67b [client] Fix the transform memory leak
The transforms aren't actually freed at the end (more work), but at
least they aren't lost any more, though one is still lost for the
viewent (weapon). The obvious fix didn't work.
2021-03-21 23:05:13 +09:00
Bill Currie ce2ffac078 [entity] Free all memory in the unit test
Now I know that deleting transforms works properly.
2021-03-21 22:33:57 +09:00
Bill Currie 56cf181a11 [gamecode] Make PR_RESMAP macros more function-like
I never liked that some of the macros needed the type as a parameter
(yay typeof and __auto_type) or those that returned a value hid the
return statement so they couldn't be used in assignments.
2021-03-21 21:26:36 +09:00
Bill Currie 003910612a [entity] Fix tests for changed forward/right
I had forgotten that Quake has forward as +X and right as -Y (still a
right-handed system, just that with X forward, Y points left).
2021-03-21 20:45:43 +09:00
Bill Currie cc4167668c Fix a pile of leaks and uninit errors
Still "some" more to go: a pile to do with transforms and temporary
entities, and a nasty one with host_cbuf. There's also all the static
block-alloc lists :/
2021-03-21 19:56:17 +09:00
Bill Currie a3c1b2e992 [util] Rename qfplist.[ch]
The name is a hold-over from before the current quakeforge tree and the
QF include directory.
2021-03-21 16:13:03 +09:00
Bill Currie 66e6627780 [vulkan] Use the correct character data
I got tired of not being able to read 90% of quake's output :P
2021-03-21 11:37:36 +09:00
Bill Currie 6e0cc59e8f [util] Make wad lump failure a soft error
Can't recover from an error if the program is swept out from underneath
you.
2021-03-21 11:36:18 +09:00
Bill Currie 7650df3400 [model] Handle brush models with empty texture slots
It seems some maps have some empty texture slots (eg, e1m2).
2021-03-21 10:08:44 +09:00
Bill Currie 0a79348ce9 [vulkan] Tweak the lighting to look a bit better
Reduced the gamma correction a bit and increased the intensity of
dynamic lights. Not sure the latter is correct, but it looks much
better.
2021-03-20 19:15:06 +09:00
Bill Currie cadea27577 [vulkan] Disable lightmap support
Hopefully, it won't be needed.
2021-03-20 18:02:27 +09:00
Bill Currie 0246e55983 [vulkan] Support colored lights
Now my dizzy map looks like it used to (more or less, possibly too dark,
but I suspect I used some command-line settings to qflight).
2021-03-20 16:50:37 +09:00
Bill Currie dccd6989b2 [vulkan] Implement gamma correction
Currently hard-coded to 0.67 (1/1.5), but it does the job for now.
2021-03-20 16:50:11 +09:00
Bill Currie bab3e0720f [vulkan] Implement real-time lighting
Light styles and shadows aren't implemented yet.

The map's entities are used to create the lights, and the PVS used to
determine which lights might be visible (ie, the surfaces they light).
That could do with some more improvements (eg, checking if a leaf is
outside a spotlight's cone), but the concept seems to work.
2021-03-20 16:08:44 +09:00
Bill Currie e0eacf4014 [model] Make set and mix versions of Mod_LeafPVS
The re-entrant version was a good start, but being able to mix while
decompressing saves having to have a temporary buffer somewhere.
2021-03-20 16:06:15 +09:00
Bill Currie e3444b726f [model] Add a re-entrant Mod_LeafPVS
Double benefit, actually: faster when building a fat PVS (don't need to
copy as much) and can be used in multiple threads. Also, default visiblity
can be set, and the buffer size has its own macro.
2021-03-20 12:13:58 +09:00
Bill Currie 0ace799b27 [util] Support commands with a data parameter
Useful for avoiding a pile of wrapper functions that merely pass on
command-specific data to the actual implementation. Used to clean up the
wrappers in nq and qw cl_input.c
2021-03-20 03:56:16 +09:00
Bill Currie 8f7d6b1d02 [vulkan] Initialize skins
This allows the qw client to run with Vulkan.
2021-03-20 00:08:21 +09:00
Bill Currie 5bf21931c7 [renderer] Remove more old fields from entity_t
The only transform related field remaining is old_origin. This also
brings the renderer closer to using simd (lots of stuff to fix still,
though).
2021-03-20 00:08:21 +09:00
Bill Currie 5158cc5527 [util] Add normal and magnitude float vector functions 2021-03-19 11:09:57 +09:00
Bill Currie 2015474468 Move and clean up clview.h
Redundant or dead prototypes deleted, and the client/view.h seems a good
place for the file.
2021-03-12 11:48:53 +09:00
Bill Currie 8466de2325 [client] Use vec4_t in entity_state_t
And clean up the mess (sort of:P)
2021-03-11 16:19:49 +09:00
Bill Currie 36761192a6 [qw] Partially clean up muzzle flash handling
It needs some more work (see FIXME in the code).
2021-03-11 15:23:35 +09:00
Bill Currie abaccbec53 [client] Move qw's loc code into client
This makes the location code available to nq (not used yet) but more
importantly moves some definitely client-side code into the right place.
2021-03-11 11:53:38 +09:00
Bill Currie b8267f2edd [client] Merge nq/qw entity effects code 2021-03-11 11:25:04 +09:00
Bill Currie c05a15dec5 [glsl] Use vec4f_t in a few more places
No idea if it makes a noticeable speed difference, but it makes a huge
readability difference.
2021-03-10 21:17:34 +09:00