Commit Graph

3318 Commits

Author SHA1 Message Date
Ivan Avdeev
22d4202ad9 vk: profiler: draw total gpu time
Use VK_EXT_calibrated_timestamps to convert to host time.
2023-03-21 11:59:57 -07:00
Ivan Avdeev
a66c44a266 vk: convert query timestamps to ns
also, fix linux build
2023-03-21 11:59:57 -07:00
Ivan 'provod' Avdeev
93a539df74 vk: display gpu time taken for a previous frame
its value will be incorrect for non-nv cards which have non-1 timestampPeriod
2023-03-21 11:59:57 -07:00
Ivan 'provod' Avdeev
be95b65b22 vk: add better scope macro for profiler
also cover synchrnoized slow uploading for staging
2023-03-21 11:59:57 -07:00
Ivan 'provod' Avdeev
9a5e1fec4a vk: scale profiling bars the same way the font is scale
make sizes consistent with the default font on hidpi displays
2023-03-21 11:59:57 -07:00
Ivan Avdeev
2872b4d237 vk: add profiling pause, add swapchain acquire scope 2023-03-21 11:59:57 -07:00
Ivan Avdeev
1c9ff300a9 vk: draw profiler scope blocks
also add a couple more scopes to rendering
2023-03-21 11:59:57 -07:00
Ivan Avdeev
be59d1d8e9 vk: tune profiler colors and animation a bit 2023-03-21 11:59:57 -07:00
Ivan Avdeev
39f2d78199 vk: start refactoring profiler
Convert direct stack manipulation to simple and cheap event writing.
Draw rudimentary frame times graph.

Related to #412
2023-03-21 11:59:57 -07:00
NightFox
190a691c6d Add simple soft shadows by @LifeKILLED
This is a temporary solution.
2023-03-18 11:39:56 -07:00
NightFox
e5658f59cd
Update rads & patches (#479) 2023-03-18 11:38:11 -07:00
Ivan Avdeev
01de5957d8
vk: respect TF_NEAREST/CLAMP/BORDER flags (#471)
Use these flags to pick the right sampler. Fixes issues with blurry and leaking fonts, lines in main menu tiles, etc.

fixes #439, fixes #79
2023-03-08 14:16:21 -08:00
Ivan 'provod' Avdeev
6d7fd41494 rt: increase model cache size, fix #449
Apparently just increasing the model cache size limit is fine.
"LRU" cache eviction was not even used when testing.
2023-03-04 12:46:37 -08:00
Ivan 'provod' Avdeev
21534c044b rt: fix uploading too many light cells, fix #451
c5a1 has ~230k light cells, and tries to upload 77MiB of them. Previous staging size of 64MiB wasn't enough.
2023-03-04 12:46:37 -08:00
Ivan 'provod' Avdeev
62392ac4b6 rt: increase kusochki limit to 32768, fix #85
boot_camp worldmodel has ~11k surfaces, which means it will need at least 22k kusochki for 1:1 static:dynamic split.
2023-03-04 12:46:37 -08:00
Ivan 'provod' Avdeev
c1483216ef rt: increase MAX_ACCELS to 2048, fix #366
test_shaders_room3 has lots of sprites, and currently we create a new BLAS for each sprite.
This is not great, and a proper fix would probably mean consolidating all dynamic transparent things into BLASes per render mode or something. But for now we can just increase the limit
2023-03-04 12:46:37 -08:00
Ivan 'provod' Avdeev
78a1b24e11 rt: enable entity light, fix #115 2023-03-04 12:46:37 -08:00
Ivan 'provod' Avdeev
dc698c16dc vk: make sure deleted textures are not referenced in staging
This fixes -vkvalidate and fixes #464
2023-03-04 12:46:37 -08:00
NightFox
8ed23cb40f
More correct emissive textures (#456)
Я подобрал новое компромиссное значение которое не требует clamp.
Это не идеально, но пока сойдёт. Может давать немного больше солнечных зайчиков чем с clamp.
Позже надо будет разобраться с самим kusok.emissive.
2023-03-04 09:41:05 -08:00
Ivan Avdeev
d1376a89e4
Merge "Enable live reloading light data" #457
- [x] Fixes #417 
- [x] Fixes #330 
- [x] Fixes #104
2023-03-03 16:50:41 -08:00
Ivan Avdeev
c47c314512 rt: clear geom emissive values prior to loading light data
fix #104
2023-03-03 16:41:16 -08:00
Ivan Avdeev
4f2eb7680b rt: propagate emissive color patches to kusochki
Fixes #330

Also, fix incorrect patch application introduced by previous commit, it
would not read the patch color value, and could only switch the light
off.
2023-03-02 23:23:31 -08:00
Ivan Avdeev
a284567002 rt: refactor loading surface lights, fix #417
Do not entangle brush model loading with loading surface lights.
Do a separate pass over brush model surfaces for the sole purpose of
finding light sources. Enables consistent live-reloading light data
after patching entities/surface/rad files.
2023-03-02 22:32:08 -08:00
Ivan Avdeev
58c9a9920e rt: do not allow direct access to pached surfaces 2023-03-02 20:27:18 -08:00
NightFox
ed9a06cae1 Update lighting patches 2023-03-01 22:50:02 -08:00
Ivan 'provod' Avdeev
8a457a17c2 rt: compute tangents for studio models
Enables applying normal maps to studio models.

Fixes #220, fixes #241
2023-03-01 10:47:31 -08:00
Ivan Avdeev
bd2bda9a41
Fix: additive soft particles, skybox shadow
Add another flag to kusochki for glow geometry. Move flags to a new kusok.flags field.
- [x] Fixes #231 (or at least makes it not stand out too much)

Fix the way we check for environment/skybox lights, explicitly look for closest hit instead of any.
- [x] Fixes #424 and #413
2023-02-28 18:58:02 -08:00
Ivan 'provod' Avdeev
6b1e84308a rt: fix checking for skybox shadow intersection
Doing tereminate-on-first-hit is incorrect, as we might accidentally hit the skybox geometry first, and consider this as no shadow.
Unfortunately we have to explicitly find a closest hit and check whether that was a skybox.

Maybe there's even a better way, e.g. querying for skybox-only geometry first, and only then checking for a terminate-on-first-hit for everything else. But it likely doesn't matter that much, and would need profiling anyway.

Fixes #424 and #413
2023-02-28 18:50:07 -08:00
Ivan 'provod' Avdeev
59e8a8c4c3 rt: only overshoot additive for glow mode
Add another flag to kusochki for glow geometry.
Move flags to a new kusok.flags field.

Fixes #231 (or at least makes it not stand out too much)
2023-02-28 17:50:50 -08:00
Ivan Avdeev
149dc7cade
Merge pull request #446 from LifeKILLED/reprojection-fix
vk rt: fix reprojection
Right way to put previous model matrix
Fix bad index of previous frame
Fallback to current frame if previous frames are outdated
2023-02-28 12:08:19 -08:00
LifeKILLED
2f050a6618 Merge branch 'reprojection-fix' of https://github.com/lifekilled/xash3d-fwgs into reprojection-fix 2023-02-28 23:07:08 +04:00
LifeKILLED
f4b0f5016b vk rt: fix reprojection 2023-02-28 23:06:09 +04:00
LifeKILLED
5fbee4a97a vk rt: fix linux build 2 2023-02-28 22:58:54 +04:00
LifeKILLED
70c52622e7 vk rt: try to fix linux build 2023-02-28 22:48:20 +04:00
LifeKILLED
ed69eeb5af vk rt: fix reprojection 2023-02-28 22:30:54 +04:00
Ivan Avdeev
da447d9e5b
Merge pull request #445 from FWGS/master
Merge from upstream
2023-02-27 17:11:04 -08:00
NightFox
429fb82f52 Update README.md 2023-02-27 16:55:59 -08:00
Ivan Avdeev
19603722ed
vk: add more beam types, tracers, triapi
- [x] fixes #293 
- [x] fixes #162 
- [x] add tracers, fix #263 
- [x] add basic triapi
2023-02-27 11:17:28 -08:00
Ivan 'provod' Avdeev
c8e4ce0619 vk: fix tracers colors 2023-02-27 11:00:34 -08:00
Ivan 'provod' Avdeev
d87690876f vk: fix TRI_QUADS and primitive_mode tracking 2023-02-27 10:51:11 -08:00
Ivan Avdeev
421c0ea733 vk: add tracers (not tested) 2023-02-27 10:37:03 -08:00
Ivan 'provod' Avdeev
30334db159 vk: draw the rest of the beams 2023-02-27 09:49:56 -08:00
Ivan 'provod' Avdeev
2daa130453 vk: set beam/triapi texture and render mode explicitly 2023-02-27 09:20:13 -08:00
Ivan 'provod' Avdeev
cf5d3d9d47 vk: increase limits for triapi
c4a1 was using too many indices
2023-02-27 08:46:12 -08:00
Ivan 'provod' Avdeev
a118e12e01 vk: stub just enough triapi to render more beam types
it is still drawn incorrectly, but at least something is visible, and we can iterate from here
2023-02-26 20:45:29 -08:00
Ivan 'provod' Avdeev
ee4def1141 rt: modulate additive kusochki by vertex color attribute 2023-02-25 18:41:01 -08:00
Ivan 'provod' Avdeev
1fadbce860 vk: remove flag attribute in vertex
make color computation more uniform and not mode-specific
2023-02-25 18:38:22 -08:00
Ivan 'provod' Avdeev
e4ad18f220 vk: do not modulate beam color twice
color is already applied at model/ubo level
2023-02-25 16:58:59 -08:00
Ivan 'provod' Avdeev
f2182bb255 vk: fix beams per-vertex blending 2023-02-25 16:47:23 -08:00
Ivan Avdeev
26ad10483f
Merge pull request #432 from w23/sprite-improvements
- [x] fixes #297 
- [x] fixes #256 
- [x] Sprite rendering differs from GL, especially with glow(3) and solid/transalpha(4)
2023-02-25 14:27:20 -08:00