Commit Graph

46 Commits

Author SHA1 Message Date
Ivan Avdeev
b67668430b rtx: fix missing flashlight in c1a4i
Just increase point lights limit per light cell.

Also:
- update infotool to show point lights info
- move light cluster finalization to vk_scene to make sure infotool has
  the recentmost data
2021-12-26 23:56:21 -08:00
Ivan Avdeev
a94674b11a rtx: allow creating new pbr materials 2021-12-22 12:33:33 -08:00
Ivan Avdeev
659402cb2a patch: enable live reloading
Does not yet reload emissive patches ("_light" argument for surfaces).
Does not reload deleted surfaces.
2021-12-21 18:37:04 -08:00
NightFox
ea1767f2c2 cvar improvements №2
added vk_only for old -rtx behavior (full disable rtx pipeline)
remove -vkskipdev and skip_first_device as unused and obsolete
remove obsolete check ("missing ray tracing extensions")
addedv VK_LoadCvarsRTX for rtx commands
remove vk_rtx_prev_frame_blend_factor as an outdated command
added vk_deviceid as a stub for video device selection
vk_rtx_reload_materials no longer shown when vk_core.rtx = 0
2021-12-11 13:14:54 -08:00
Ivan Avdeev
28d047a904 rtx: enable patching surface textures
example:
```
{
	"_xvk_surface_id" "489"
	"_xvk_texture" "#maps/test_material.bsp:debug_normal1.mip"
}
```

if _xvk_texture is empty, then the surface will be deleted

surfaces can be deleted or their
2021-11-26 23:59:48 -08:00
Ivan Avdeev
dc3e75bd44 add skybox from which we only render UP plane kek #140 2021-11-19 11:46:44 -08:00
Ivan Avdeev
6df830dd0a add initial normalmaps support 2021-11-17 09:43:10 -08:00
Ivan 'provod' Avdeev
bd4de6128c rtx: add metalness and roughness map support
overrides existing textures. loads override data from pbr/materials.map
2021-11-16 09:34:36 -08:00
Ivan 'provod' Avdeev
e8359b12e8 rtx: add material support stub 2021-11-16 09:34:36 -08:00
Ivan Avdeev
36cf2146da add ui_infotool to print entity info under crosshair for debugging, fix #34 2021-11-03 10:53:56 -07:00
Ivan Avdeev
9a0fc7cdac move camera related things to camera.{h,c} 2021-11-03 10:53:56 -07:00
Ivan 'provod' Avdeev
4d78c44ed6 rtx: collect static surface lights only once on map load, fix #122
also fix buffer overflow on >255 lights
2021-10-25 10:17:49 -07:00
Ivan Avdeev
9006d679ec rtx: associate msurfaces with mleafs 2021-10-13 12:27:24 -07:00
Ivan 'provod' Avdeev
fe931fcfd7 rtx: collect d/elights and static entity point lights
sample all of them unconditionally for now
2021-09-20 23:35:49 -07:00
Ivan Avdeev
5208219b44 join alloc+lock operations on buffer init
this simplifies the api and implementation
2021-08-11 11:43:33 -07:00
Ivan Avdeev
94ac51a527 rtx: sample mip levels based on ray cone width
this is mostly copied from ray tracing gems 2 chapter 7 (Texture Coordinate Gradients Estimation for Ray Cones, by Wessam Bahnassi).
There's a weird bit about radians vs degrees. We'll figure it out later when the book becomes available.
2021-08-04 18:36:53 -07:00
Ivan 'provod' Avdeev
531fcd9393 move water warping to vk_brush 2021-06-19 13:44:28 -04:00
Ivan 'provod' Avdeev
74e0fb2947 add initial water surfaces
still need to cull them, generate normals, etc.
2021-06-19 13:44:28 -04:00
Ivan 'provod' Avdeev
00518d3251 rtx: implement dynamic lights
track brush models movement and update lights grid clusters with model transform and stuff

also implement animated textures for rtx

and also increase per-cluster lights limits
2021-06-05 12:48:16 -07:00
Ivan 'provod' Avdeev
eaaadf024e rtx: coalesce building blases in a single command buffer 2021-05-28 10:10:20 -07:00
Ivan 'provod' Avdeev
be42bd29a5 add ring temp allocator logic 2021-05-03 11:17:01 -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
573c291cef rtx: fix tlas rebuild 2021-04-10 10:58:46 -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 Avdeev
39a5568614 rtx: wip bake lighting data using bsp/pvs 2021-03-28 13:52:25 -07:00
Ivan 'provod' Avdeev
379f6ee409 rtx: add static light entities
This was an attempt to add map lighting w/o lightmaps. Unfortunately
there are just not enought of them to explain all light in maps. We're
missing something else. A lot of it.
2021-03-13 16:33:17 -08:00
Ivan 'provod' Avdeev
7fa3f2dc8d render: split mvp matrix to separate model,view,projection matrices
This will help with RTX model transformations.
2021-03-13 13:35:50 -08:00
Ivan 'provod' Avdeev
78d9a87344 fix projection matrix vulkan fixup
we were mixing up row vs column major matrices
now RTX ray generation is fixes, and traditional rasterizer rendering
should also be projecting similar to gl render
2021-03-06 13:26:38 -08:00
Ivan 'provod' Avdeev
28cdeaeb1d propagate proj/view matrices to rtx shader
And get RTX picture we deserve (i.e. glitchy and incorrect).
Will fix later.
2021-03-03 11:58:40 -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
3f70b76208 engage scene rendering in VK_RenderFrame and not in EndFrame
Rework a bit how matrices are computed. More global state dependencies
;_;

Buffer-up draw commands, and only schedule them for drawing at EndFrame.
2021-02-20 14:54:57 -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
56c68dea0b fix beam entities piling up 2021-02-17 13:48:41 -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
b22cd90184 add initial sprite rendering
alpha blending is broken
animations are weird, but we do draw them nonetheless somehow
2021-02-15 12:20:25 -08:00
Ivan Avdeev
c53bfaf484 add view(weapon) models 2021-02-15 09:55:42 -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
eb14e858a6 add transparency for brush models
Doesn't do alpha test yet though.
2021-02-03 12:24:04 -08:00
Ivan Avdeev
fc9eedbd9d apply proper lightstyles on map load
Lightstyles remain fixed for the entire map duration. Need to implement either texture reupload in VK, or devise some other scheme of updating ligtmaps w/o texture reupload (lightstylevalues uniform buffers?).
2021-02-03 10:06:21 -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