Commit Graph

2743 Commits

Author SHA1 Message Date
Ivan Avdeev
1f774c6400
Merge significant ray tracer improvements #341 from w23/better-sampling-passes
Initial observation: our vgpr story is abysmal, so need to split the one uber-rt-shader into pieces.

Done here:
- ray tracing pipeline uber shader is split into separate compute phases -> perf x2 (with a possibility of further radical improvements)
- "programmable render": read spirv, extract bindings, auto-create missing resources, etc.
- better light sampling, significant image quality improvements
- better synchronization. cpu can continue preparing the next frame while previous one is still being drawn on GPU
- lots of other small fixes
2023-02-14 13:00:53 -08:00
Ivan 'provod' Avdeev
4dd793569c rt: add alpha-quality alpha blending
Do translucency in bounce stage. It's not great, but lets us see thing through.

Also fix reading OOB uninitialized memory for color/alpha.
2023-02-14 12:55:40 -08:00
Ivan Avdeev
eaf8b3c55a
Merge pull request #421 from w23/denoiser-massage
1. Denoise different channels (diffuse, specular, indirect) differently.
2. Make indirect bounce half res.
2023-02-11 12:39:07 -08:00
Ivan 'provod' Avdeev
64ac964dfc rt: make indirect light run at half res 2023-02-11 12:12:57 -08:00
Ivan 'provod' Avdeev
218bd0a9c2 rt/denoiser: blur different channels differently 2023-02-11 11:36:45 -08:00
Ivan 'provod' Avdeev
e9712f36e3 rt/denoiser: split into diffuse/specular/direct/indirect channels
apply to lighting only, not to the final color
2023-02-11 11:06:33 -08:00
Ivan Avdeev
780b225735 mark a bunch of things as done 2023-02-08 14:55:17 -08:00
Ivan Avdeev
a46d82f3b5
Merge pull request #419 from w23/bounces
Add indirect illumination
2023-02-08 10:32:02 -08:00
Ivan 'provod' Avdeev
3ecd21a25b rt: simplify bounce computations
use simpler polygon sampling
use smaller texture lods
2023-02-08 10:11:00 -08:00
Ivan 'provod' Avdeev
c5a1343fc6 rt: add additive to bounces 2023-02-08 09:44:28 -08:00
Ivan 'provod' Avdeev
5b59c387c1 rt: add emissive to specular bounce
makes it sample skybox, but is probably incorrect in other circumstances
2023-02-08 09:35:21 -08:00
Ivan 'provod' Avdeev
62720a7ed3 rt: fix uninitialized memory denoiser glitches
was reading garbage when ray doesn't hit anything
2023-02-08 09:34:40 -08:00
Ivan 'provod' Avdeev
19c4e2a1d8 rt: add reflections
i was trying to add specular properly: replace them with specular bounce. but it doesn't really work that easily. need some kind of color mapping and figuring out how to make them look consistent.

this commit still does them separately, i.e. specular is done in direct lighting pass. no emissive is added on bounce. this probably makes it not reflect skybox ;_;.
2023-02-08 09:25:40 -08:00
Ivan 'provod' Avdeev
ea7879bff8 rt: add lighting to bounce
no specular just yet
2023-02-07 11:13:10 -08:00
Ivan 'provod' Avdeev
7188711451 rt: add test color-only bounce
no lighting yet, just base color
2023-02-07 10:46:57 -08:00
Ivan Avdeev
3edcb7c007
Upload only dirty light clusters regions, PR #418
Ends up uploading only a few megs per frame, spread across a hundred or so ranges on average.
Still not great, now validation is too slow. But otherwise it's back to ~60fps.

I think it's end of the line for this approach. Even betterer light clusters would need a complete overhaul, e.g. being moved completely to GPU compute.

Fixes #385
2023-02-07 09:26:43 -08:00
Ivan 'provod' Avdeev
0573186334 rt: upload dirty light clusters; use them in shaders
known issues:
- -vkvalidate performance is bad, as it has to validate dozens-hundreds of buffer uploads
- still doesn't solve the case where entire map ends up being updated
2023-02-05 23:35:08 -08:00
Ivan Avdeev
5da5a1bc94 rt: collect stats on dirty light cells 2023-02-04 10:32:27 -08:00
Ivan Avdeev
18a7c61505
#411 Trace alpha masked and transparent surfaces
Tracing alpha masked shadows is now extremely expensive, fps is roughly cut in half :(

Will need to address it separately
2023-02-03 12:22:43 -08:00
Ivan 'provod' Avdeev
51641234ab rt: fixup additive color 2023-02-03 12:00:29 -08:00
Ivan 'provod' Avdeev
de6da4f03f rt: add additive transparency
known issues:
- colors are incorrect (probably because of kusok.color having the wrong value)
- mixes weirdly with denoiser
2023-02-03 11:52:39 -08:00
Ivan 'provod' Avdeev
c615b9355a rt: only do alpha test shadows after opaque geometry
this honestly barely helps ;_;
2023-02-03 11:00:34 -08:00
Ivan 'provod' Avdeev
8ec8502a53 rt: unify shadowed with shadowedSky 2023-02-03 10:18:17 -08:00
Ivan Avdeev
3ebfb72819 fix linux linking 2023-02-02 11:07:41 -08:00
Ivan 'provod' Avdeev
395d5c4fcb rt: add alpha test for primary ray and for shadows
shadows are particularly slow
2023-02-02 10:22:52 -08:00
Ivan Avdeev
00732cd0c1
Merge pull request #410 from LifeKILLED/test-motion-vectors
Test motion vectors
2023-02-01 14:38:52 -08:00
LifeKILLED
889846f774 vk rt denoiser: fix variable initialize for linux build 2023-02-02 00:35:15 +04:00
LifeKILLED
1d0ebbcc33 vk rt denoiser: merge 2023-02-02 00:02:36 +04:00
LifeKILLED
b1b644564f vk rt denoiser: merge 2023-02-02 00:01:34 +04:00
Ivan 'provod' Avdeev
c1cfe1008d rt: minor rt pipelines and pre-meatpipe cleanup 2023-01-30 11:31:46 -08:00
Ivan Avdeev
be5e50d50b
Merge pull request #406 from w23/prev-feedback
Add previous frame images feedback
2023-01-30 10:33:28 -08:00
Ivan Avdeev
71f7449a8e comment and add additional checks for the previous commit 2023-01-30 10:21:18 -08:00
LifeKILLED
615a10c005 vk rt: remove unused struct from vk_studio.c 2023-01-30 16:36:44 +04:00
LifeKILLED
9ed9eb5451 vk rt: merge with reworked motion vectors 2023-01-30 09:01:46 +04:00
LifeKILLED
164259d6b1 rt denoiser: rework motion vectors, add simple temporal reprojection 2023-01-30 08:59:49 +04:00
Ivan 'provod' Avdeev
3a87934415 rt: add test previous frame blur 2023-01-30 08:57:16 +04:00
Ivan 'provod' Avdeev
a5abde2162 rt/seba: export prev_ frame image resource index 2023-01-30 08:54:33 +04:00
LifeKILLED
571fc16c3b rt denoiser: rework motion vectors, add simple temporal reprojection 2023-01-30 08:53:18 +04:00
LifeKILLED
73c750020f merge with previous frames feedback 2023-01-30 05:23:08 +04:00
LifeKILLED
2627cb97af rt: reviewer's fixes 2023-01-30 05:15:41 +04:00
Ivan 'provod' Avdeev
3cb9ca0579 rt: add test previous frame blur 2023-01-28 14:50:43 -08:00
Ivan 'provod' Avdeev
858e3eed55 rt/seba: export prev_ frame image resource index 2023-01-28 12:55:53 -08:00
LifeKILLED
c4881f57c9 rt denoiser: motion vectors for raytracing pipeline and for ray query 2023-01-23 04:00:36 +04:00
Ivan Avdeev
308e0962a3 update todo 2023-01-22 15:11:27 -08:00
Ivan Avdeev
ab59393909
Merge pull request #403 from w23/primary-ray-compute
Convert primary ray pass to compute shader

Makes it work under open source mesa amdgpu driver (although it's ~30% slower than the old binary driver)
2023-01-22 15:09:48 -08:00
Ivan 'provod' Avdeev
28f40d5ca0 rt: compute the primary ray 2023-01-22 15:00:01 -08:00
Ivan Avdeev
9f3735240c
Merge pull request #400 from w23/rtables
Meatpipe-centric resource management
2023-01-22 13:48:51 -08:00
Ivan 'provod' Avdeev
9df38a6487 update todo 2023-01-22 13:43:33 -08:00
Ivan 'provod' Avdeev
8709f668c4 rt: track meatpipe-created resources by refcounts 2023-01-22 13:22:56 -08:00
LifeKILLED
4d370b072c vk rt denoiser: add motion vectors 2023-01-22 03:45:29 +04:00