Commit Graph

20 Commits

Author SHA1 Message Date
Ivan 'provod' Avdeev
28f2c06bdb rtx: cache and destroy model blases
Unfortunately Xash3D doesn't allow us to destroy models properly.
It doesn't call Mod_ProcessRenderData for all brush models (only map).
And by the time we get into R_Shutdown all models are already gone, so
we can't enumerate and destroy them properly.
2021-04-13 10:46:33 -07:00
Ivan 'provod' Avdeev
01e6a267d5 rtx: fix toilet crash
Toilet contained brush model with presumably water surfaces which
were not loaded due to how we treat surface flags. That ended up
creating a model with no geometries, which is just rude.
We don't try to render those kind of models now.
2021-04-13 10:13:17 -07:00
Ivan 'provod' Avdeev
ad7b210228 rtx: improve surface lights
use bsp/pvs-based visibility data for acceleration:
+ fps 5 -> 60
- correctness: some areas have too many lights, which ends up culling visible ones too

also fix shadow artefacts
2021-04-12 11:07:41 -07:00
Ivan 'provod' Avdeev
3a8f2ebc45 rtx: build blas and tlas only once 2021-04-09 14:59:04 -07:00
Ivan 'provod' Avdeev
af5e20269d add persistent model api and use it for brushes
this needed for better rtx blas management
2021-04-07 12:11:20 -07:00
Ivan 'provod' Avdeev
cbed97948c add preliminary support for dlights
Move descriptors away from vk_core
Add UBO for dlights
Add test lighting in brush shader
Add brush normals
2021-03-06 16:40:35 -08:00
Ivan Avdeev
973ef4c677 separate buffer space allocation from buffer uploading
Now each geometry is first allocated a slot with VK_RenderBufferAlloc,
and then VK_RenderBufferLock/Unlock are used to upload buffer contents.

This allow for two things:
1. Uploading buffer data to GPU memory on/after Unlock.
2. (Re)building BLAS for RTX on/after Unlock.

These buffers are now directly referenced by render_draw_t, which also
will be helpful in the future for both renderers.
2021-02-22 18:57:46 -08:00
Ivan Avdeev
8dc0d4256d add VK_RenderDebugLabelBegin/End calls; fix studio model labeling 2021-02-20 12:35:04 -08:00
Ivan Avdeev
e66810a05b remove ubo management from "public" vk_render api
Now rendering submodules specify their colors and matrices using
VK_RenderState global stat api. This is a trade-off between making all
submodules track their state on their own, or managing that state
centrally.
2021-02-20 12:00:31 -08:00
Ivan Avdeev
3b1e7be112 add beams rendering
not all beam types are supported yet

also changes studio api init sequence, fixes missing cvars
vertex type struct is no longer names as brush-specific
uniform buffer allocation is now in vk_render

blending issues still remain
2021-02-17 13:26:09 -08:00
Ivan Avdeev
778cc60453 add broken studio models drawing
there are several issues with it:
- there are holes in models
- movement is jerky
- no lighting applied
2021-02-13 17:19:59 -08:00
Ivan Avdeev
e14f004785 Merge remote-tracking branch 'upstream/vulkan-anim-textures' into vulkan 2021-02-10 11:08:49 -08:00
Ivan Avdeev
5ebe36c54c move buffer allocation to vk_render.c from vk_bruh.c 2021-02-10 10:33:44 -08:00
cbdca0abf9 implement texture animation and random tiling 2021-02-10 03:45:38 +03:00
Ivan Avdeev
ad5d515200 move entity enumeration from vk_brush to vk_scene 2021-02-08 10:57:27 -08:00
Ivan Avdeev
e5b14c0393 fix glitches on intel gpus due to misaligned uniform buffer offsets
Use VkPhysicalDeviceLimits.minUniformBufferOffsetAlignment to align dynamic uniform buffer offsets used per brush.
2021-02-07 23:19:22 -08:00
Ivan Avdeev
8c1c418b35 rename map to brush 2021-02-06 11:38:08 -08:00
Ivan Avdeev
b11501e4ef improve blending; add alpha test
Set blending modes according to existing GL renderer.
Cull back faces.
Implement alpha test.

Add TODO.md file
2021-02-06 11:07:00 -08:00
Ivan Avdeev
eb14e858a6 add transparency for brush models
Doesn't do alpha test yet though.
2021-02-03 12:24:04 -08:00
Ivan Avdeev
8870650466 split vk_map into vk_scene and vk_brush
Scene controls entity list for scenes
Brush is only responsible for drawing brush models
2021-02-01 11:05:04 -08:00