Commit Graph

36 Commits

Author SHA1 Message Date
Ivan 'provod' Avdeev
d2bb972930 rt: assoc dyn polylights w/ render model
fix #355
2022-05-27 11:28:45 -07:00
Ivan 'provod' Avdeev
00652f0e7d rt: fix pcie bus thrashing; add profiler scopes
turns out it's not cool to read color from on-gpu kusok data, modify it, and write back
2022-02-21 23:46:50 -08:00
Ivan 'provod' Avdeev
955f36a423 Merge branch 'parallel-frames' into better-sampling-passes-parallel
includes a few initial compilation fixes for parallel ray tracing. does not work yet
2022-02-20 16:00:33 -08:00
Ivan Avdeev
22917938d9 vk: initial draft of parallel frames
adds multiple command buffers and bits of synchronization.

is not correct at all:
- no depth buffer barrier
- no ubo slots in render
- no proper render memory management
- no ray tracing support whatsoever
- ... etc
2022-02-10 22:55:33 -08:00
Ivan Avdeev
460b839a64 rt: add debug labels to command buffer 2022-01-18 22:29:42 -08:00
Ivan Avdeev
04a201c401 rt: pass new polygon lights to shader naively
also start refactoring light collection

broken:
- reloading lights after patching
- wagonchik lights (attached to non-static models)

missing:
- clustering the new poly lights
- proper sampling, only rough estimate for now
- shadows

probably a lot more
2022-01-14 23:48:57 -08:00
Ivan Avdeev
b31462fe18 rt: stub better emissive surfaces representation path
Light polygons that are:
- self-sufficient (no kusochki indirection needed).
- pre-transformed
- contain enough metadata (area, center, normal) for quick sampling
- are polygons with up to 7 vertices and not triangles (easier sampling)

Also move rad file reading to before brush model loading, as it now
requires lighting data.
2022-01-13 22:36:21 -08:00
Ivan Avdeev
f70f5bfe82 rtx: add scalar parameters for material overrides, fix #238 2021-12-01 13:19:01 -08:00
Ivan Avdeev
ee52562e46 rtx: propagate patched emissive color 2021-11-28 13:51:30 -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
714d825956 deduplicate creation of VkImages 2021-11-21 13:40:11 -08:00
Ivan Avdeev
10dab2f021 fix materials application to studio models, fix #216
1. make sure that it can find studio textures by name exactly (no wad or
   other weird prefixes necessary)
2. do not apply HACK_reflective to chrome that already has a patched
   material
2021-11-19 11:46:44 -08:00
Ivan Avdeev
97999e1f8e rtx: specular reflective hack back temporarily 2021-11-17 11:20:29 -08:00
Ivan Avdeev
a736b223c9 fix emissive surfaces being too dark, #145 2021-11-17 10:27:58 -08:00
Ivan 'provod' Avdeev
e8359b12e8 rtx: add material support stub 2021-11-16 09:34:36 -08:00
Ivan Avdeev
eceb52cee0 add support for studio chrome meshes, fix #149
no support for glow chrome yet.
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
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
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 Avdeev
9006d679ec rtx: associate msurfaces with mleafs 2021-10-13 12:27:24 -07:00
Ivan Avdeev
ae12b4505d remove material flags 2021-09-06 14:24:36 -07:00
Ivan Avdeev
b9f5f87c76 bring back ray traced transparency
1. Probabilistically let ray through material or reflect it based on
   transparency probability (which is essentially just alpha for now).
2. Introduce opaque flag to be able to treat transparent objects as not
   casting shadows. This is not very realistic, but oh well.
2021-09-06 11:57:23 -07:00
Ivan 'provod' Avdeev
c90187f57f rtx: use a common definition for Kusok; pass color
Also pass alpha (not used yet)
2021-09-04 13:50:05 -07:00
Ivan 'provod' Avdeev
36cfe22e8d rtx: add sbt hit entry w/o any hit
Majority of materials are without alphamask, so no need to have any hit shader
2021-09-04 13:50:05 -07:00
Ivan Avdeev
d8ebf5ac33 rtx: add emissive color, remove emissive flag 2021-08-31 11:19:44 -07:00
Ivan Avdeev
8d06058aa4 rtx: add first iteration of material flags support
it's clearly suboptimal, but no worries, we'll iterate
2021-08-31 11:19:44 -07:00
Ivan Avdeev
3b605a19b5 fix depth test for glow render mode; comments
also add a lot of observations to ref_vk/TODO.md related to materials
2021-08-31 11:19:44 -07:00
Ivan Avdeev
76b82ac884 rtx: calculate maxVertex correctly
after we've updated how brush index buffer references vertices to allow
for draw call coalescing ray tracing broke on amd.
this is because amd cards expect a correct value in
VkAccelerationStructureGeometryTrianglesDataKHR::maxVertex. make sure we
fill a correct value there.
2021-08-18 09:39:33 -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
fc2c7185df rtx: add basic transparency and reflections
this is very proof-of-concept quality. it should be definitely done some other way

e.g. we should control reflectivity and transparency differently (and not together)
and they should be based on texture ids, not on render_mode

it's also unfortunate that transparency required a lot of bounces. we should probably control transparency bounces separately from light bounces.
alternatively, transparency effects (beams, sprites) should be done with custom intersection shaders and not based on transparent geometry
2021-07-31 12:35:59 -07:00
Ivan Avdeev
316e77df78 rtx: add alpha mask transparency 2021-07-14 11:54:21 -07:00
Ivan Avdeev
d66ee6b3ce rtx: fix hit/miss shader order
also move geometries offsets to ranges struct instead of adding offsets to buffers addresses
2021-07-10 11:06:55 -07:00
Ivan Avdeev
2ca2e2058e fix compile warnings for CI, part 2 2021-07-06 12:54:45 -07:00
Ivan Avdeev
cdefb7a50a fix compiler warnings for CI 2021-07-06 09:41:48 -07:00
Ivan Avdeev
34359e2f75 rtx: start splitting ray tracing into functional modules
move model management into vk_ray_model
2021-07-05 10:59:14 -07:00