128 Commits

Author SHA1 Message Date
Ivan Avdeev
af24afbcc3 rt: draft direct light compute shader
it's bad:
direct light: 1.8ms, 183(184)v, 59(128)s, LDS=0, 2/16o
(-56 vgpr => +1 wavefront??)

also, thread group size = 16, 8, 1, wave64
while ray tracing pipeline = 8, 4, 1, wave32
2022-01-10 19:13:08 -08:00
Ivan Avdeev
b9760aaaea rt: add normals to primary pass
primary: 114us (+15), 62(64)v, 60(128)s, 16/16o
reading: 13us (+3)
2022-01-09 20:02:27 -08:00
Ivan Avdeev
f281b40e34 rt: use the same primary out list for image creation 2022-01-09 19:50:43 -08:00
Ivan Avdeev
c6ea7dc1fc rt: list primary out bindings separately 2022-01-09 19:36:08 -08:00
Ivan Avdeev
3453a2f563 rt: add anisomips to primary ray
also move uniform buffer to rtx from render

110us, 57(64)v, 52(128)s, 16/16
2022-01-08 13:44:02 -08:00
Ivan Avdeev
93b0766142 rt: read textures and pass it to gbuffer
102us, 56(64)v, 48(128)s, 16/16o
2022-01-07 23:22:19 -08:00
Ivan Avdeev
4b540d28eb rt: pass both positions and "color" to g-buffer
vgpr is up to 57 :(
2022-01-07 22:43:27 -08:00
Ivan Avdeev
da91ff551e rt: pass geometry data to primary ray pass
also teach it to reload
2022-01-07 22:14:50 -08:00
Ivan Avdeev
246c42f043 rt: trace actual rays in primary pass
uh oh, test_brush2: 74.3us, 48/48 vgpr, 44/128 sgpr, 16/16 occupancy
2022-01-07 19:22:40 -08:00
Ivan Avdeev
cd47861d9b rt: start splitting tracer into passes; add primary pass stub
renders only uv gradient as a test

empty rgen, 6900xt: 12.3us, 6/16 vgpr, 20/128 sgpr, 16/16 occupancy
2022-01-07 18:53:23 -08:00
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
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 'provod' Avdeev
6e9b54869c rtx: fix shadows for surfaces with alpha mask 2021-12-08 12:08:26 -08:00
Ivan Avdeev
4becafc02c Merge branch 'sample-emissive-lights-textures' into E177
Also do not multiply emissive textures by emissive color. similar to how
original lighting works.
qrad lighting treats emissive surfaces as constant color w/o paying
attention to texture contents. And then the rederer just draws textures
w/o lightmaps.

We need to figure out what to do with pbr path tracer.
2021-12-08 10:43:11 -08:00
NightFox
152748b657 fix error: implicit declaration of function 2021-12-03 11:26:50 -08:00
NightFox
f501f8255d add reload 2d pipeline 2021-12-03 11:26:50 -08:00
Ivan Avdeev
1dabdc67d6 sample emissive lights textures 2021-12-03 09:57:24 -08:00
NightFox
564359ffe2 Remove requirement -vkdebug for some console cmds
vk_rtx_reload
vk_rtx_reload_rad
vk_rtx_freeze
2021-11-30 19:53:06 -08:00
Ivan 'provod' Avdeev
a9d5e4dd22 rtx: draw skybox on SURF_SKY surfaces only
- change how shadows for environment lights work: should cast light only when hitting SURF_SKY
- add SBT_RECORD_SIZE to specialization; need this for sky/shadow closest hit shader

fix #140
2021-11-25 11:53:44 -08:00
Ivan Avdeev
1ad13817fe add cubemap support; add misaligned skybox 2021-11-21 14:53:51 -08:00
Ivan Avdeev
714d825956 deduplicate creation of VkImages 2021-11-21 13:40:11 -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 'provod' Avdeev
499adafaed rtx: pass normals to denoiser 2021-11-12 10:42:56 -08:00
Ivan 'provod' Avdeev
4712b7c1eb rtx: fix gbuffer destruction 2021-11-09 11:06:35 -08:00
Ivan 'provod' Avdeev
a152fb8ac1 rtx: add specular and additive channels 2021-11-09 10:59:36 -08:00
Ivan Avdeev
c949b7f214 fix linux build 2021-11-07 13:49:44 -08:00
Ivan 'provod' Avdeev
4cfe76dc40 rtx: split color into base and diffuseGI; add dumb denoiser 2021-11-07 13:49:44 -08:00
Ivan 'provod' Avdeev
0627c612c3 rtx: s/rgba8/rgba16f/ for color textures 2021-11-07 13:49:44 -08:00
Ivan 'provod' Avdeev
f570e59961 rtx: move upscaling back from denoiser 2021-11-07 13:49:44 -08:00
Ivan 'provod' Avdeev
c89dfee7b8 rtx: fix pre-denoise barriers, remove feedback from rgen 2021-11-07 13:49:44 -08:00
Ivan 'provod' Avdeev
e6db0fde45 add debug names to various vk images 2021-11-07 13:49:44 -08:00
Ivan 'provod' Avdeev
3abd5ee259 BROKEN rtx: add denoiser compute stub 2021-11-07 13:49:44 -08:00
Ivan 'provod' Avdeev
fca6857e51 rtx: add denoiser api stub 2021-11-07 13:49:44 -08:00
Anton Baskanov
3f70032e77 Convert fov to radians when computing pixel cone.
Fixes #167. Textures are still blurry when viewed at an angle as
UVDerivsFromRayCone does not take anisotropy into account.
2021-11-04 22:40:34 -07:00
Ivan Avdeev
f14b01f195 rtx: add r_lightmap cvar, fix #75 2021-11-02 10:36:31 -07:00
Ivan 'provod' Avdeev
ef15ba5e08 rtx: fix scrolling textures for additive, fix #178 2021-10-31 17:27:22 -07:00
Ivan 'provod' Avdeev
3f12a42432 rtx: fix translucent things casting shadows (they shouldn't for now) 2021-10-31 17:27:22 -07:00
Ivan 'provod' Avdeev
b3465ceb30 rtx: implement additive translucency
fix #170
2021-10-29 12:48:36 -07:00
Ivan 'provod' Avdeev
b7e6581e29 rtx: improve shader binding indexing 2021-10-29 12:48:36 -07:00
Ivan 'provod' Avdeev
24f11bccc7 rtx: add material mode enum, precursor for proper translucency handling
#173
2021-10-29 12:48:36 -07:00
Ivan 'provod' Avdeev
5e50bdfcf2 rtx: add conveyor scrolling texture, fix #158 2021-10-27 22:48:26 -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 'provod' Avdeev
452ca9de45 rtx: collect static light sources only once on map load, #122
this also breaks static surface lights
2021-10-25 10:17:49 -07:00
Ivan 'provod' Avdeev
94ce06d674 rtx: support environment lights, fix #16 2021-10-20 11:58:53 -07:00
Ivan 'provod' Avdeev
dcd5ff959c rtx: do not perform very expensive ray model memory validation 2021-10-20 11:58:53 -07:00
Ivan 'provod' Avdeev
4dee7b48cf rtx: add initial spotlight support
not done:
- light cluster culling
- environment (directional-only lights, e.g. sun)
- proper names for things
2021-10-20 11:58:53 -07:00
Ivan 'provod' Avdeev
832b719bed rtx: remove direct sun sampling attempt
apparently there's no singular sun. there are spot_lights (+light_environment) that function like a sun (directional light).
2021-10-20 11:58:53 -07:00
Ivan 'provod' Avdeev
208d7528ad rtx: move Lights buffer definition to common header 2021-10-20 11:58:53 -07:00
Ivan Avdeev
19b8025fc6 rtx: add light clusters debug helpers
1. add a way to enable only certain lights
2. add commented out code to highligh affected light clusters, culling
   modes, etc.
3. add affected light clusters counter when collecting lights
2021-10-13 12:27:24 -07:00
Ivan Avdeev
20369dd9ab rtx: move push constant definition to a common place; specialize shader constants 2021-10-13 12:27:24 -07:00