Commit Graph

488 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
090fb3bfbb rt: add alpha test to primary rays
105us, 57(64)v, 60(128)s, 2048l, 16/16
2022-01-08 17:21:04 -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
f85b1b9dc1 rt: pass uvs to screen
same: 111us, 53(64)v, 48(128)s, 16/16o
2022-01-07 22:26:57 -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
9adf9e1779 rtx: decrease payload_opaque dependencies 2022-01-06 19:56:15 -08:00
Ivan Avdeev
56c0a3273e Merge branch 'vulkan' into better-sampling 2022-01-06 13:34:43 -08:00
Ivan 'provod' Avdeev
8b7ff39efb print more info about vulkan memory and allocations 2022-01-05 20:12:36 -08:00
Ivan Avdeev
51a29c012c make flashlight handling a bit cleaner 2021-12-30 13:28:56 +03:00
Ivan Avdeev
44652da57a rtx: switch sampling to projected solid angle 2021-12-29 12:56:58 -08:00
Ivan Avdeev
1352f68462 rtx: clip sampled triangles by half-dome 2021-12-29 12:40:37 -08:00
Ivan Avdeev
e98d7d0d7f rtx: cull triangles by their orientation 2021-12-29 12:37:24 -08:00
Ivan Avdeev
dcf787274c rtx: shading sample space sampling 2021-12-29 12:30:50 -08:00
Ivan Avdeev
639a09520e rtx: remove old tri angle sampling 2021-12-29 12:30:00 -08:00
NightFox
1501f7fea4 more correct flashlight position in first person by @MaxG2D 2021-12-29 12:21:33 +03:00
Ivan Avdeev
14176f147f rtx: implement more of that solid angle sampling
also tweak tonemapping and exposure a bit
2021-12-28 22:54:17 -08:00
Ivan Avdeev
74e9401e56 rtx: start experimenting with peters2021 poly sampling
Add bits of shader code from https://github.com/MomentsInGraphics/vulkan_renderer/blob/main/src/shaders/

More info and the paper itself is here: https://momentsingraphics.de/Siggraph2021.html
```
	BRDF Importance Sampling for Polygonal Lights
	Christoph Peters.
	2021–07 in ACM Transactions on Graphics (Proc. SIGGRAPH) 40, 4.
```
2021-12-28 19:41:19 -08:00
NightFox
09493cbcba fix multiplayer angles 2021-12-28 18:25:14 +03:00
NightFox
2d6de8b149 fix error: implicit declaration of function 2021-12-28 15:16:46 +03:00
NightFox
9420fc3e39 general fix flashlight for other players in multiplayer mode 2021-12-28 15:09:29 +03:00
Ivan Avdeev
a1de3c6631 Merge branch 'vulkan' into better-sampling 2021-12-27 19:07:36 -08:00
NightFox
8848502572 cleanup again 2021-12-28 00:58:26 +03:00
NightFox
0b1b181f26 remove workaround for classic render 2021-12-28 00:50:39 +03:00
NightFox
2395469d0c cleanup 2021-12-28 00:34:39 +03:00
NightFox
5f7127bd00 replace parseAngles function code by AngleVectors and tune thirdperson_offset 2021-12-27 19:27:31 +03:00
NightFox
d413b7dc77
Merge branch 'vulkan' into fonarik 2021-12-27 15:42:22 +03: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
Ivan Avdeev
f86da445b7 rtx: fix moving emissive surfaces light clusters
Do not skip 0th leaf when iterating through R_FatPVS results.

Also:
- move infotool from camera.c to infotool.c
- add hit coords to infotool
- add limited light clusters info into infotool
- add a bit more debug info to light clusters

fixes #279
2021-12-26 00:37:07 -08:00
NightFox
cf0c88bc08 flashlight tuning for classic render 2021-12-26 04:19:39 +03:00
NightFox
6dbaf76b6c add flashlight for classic render (workaround) 2021-12-26 04:06:19 +03:00
NightFox
74a9809b08 formatting 2021-12-26 03:17:22 +03:00
NightFox
e68546cd8b refactoring 2021-12-26 01:54:32 +03:00
NightFox
0aba565ab8 more correct flashlight
more correct work in the first person
add third person support
add multiplayer support (need testing)
2021-12-26 01:00:06 +03:00
NightFox
8c12479447 fix error: implicit declaration of function 2021-12-25 01:16:19 +03:00
NightFox
ab4d1c12c7 new flashlight 2021-12-25 00:30:02 +03:00
Ivan 'provod' Avdeev
32fa3ab7de rtx: better surface light triangle selection
- Enumerate all triangles and pick random one based on solid angle/expected contribution
- Sample N(4) of surface lights per pixel/frame. This is needed for performance reasons. Some surface lights have way too many triangles and enumerating them takes ages.
- Write emissive color directly on primary ray hit (still looks too bright ;_;)

Known issues:
- changes above make it really apparent that light clusters are subtly broken (see test_brush3, etc)
- triangle contribution sometimes breaks at axis aligned plane intersecting one of the vertices
  (supposedly the solid angle is broken?)
- performance is bad
2021-12-24 12:50:38 -08:00
Ivan Avdeev
c39e0c6031 rtx: add include support for materials
use it like this:
```materials.mat
{
	"include" "other.mat"
	"include" "another.mat"
	// ...
}

// continue with regular material definitions
```

```other.mat
{
	// can also nest includes (up to 4)
	"include" "yetanother.mat"
}

// continue with definitions as usual

{
	// may also have includes later too
	"include" "whatever.mat"
}

// ...
```

etc

fixes #312
2021-12-23 22:25:31 -08:00
Ivan Avdeev
2ae510ee7f respect animated textures in ui_infotool
1. include correct current texture
2. print animation chain info

relevant for #301
2021-12-23 00:01:39 -08:00
Ivan Avdeev
7e90b07288 rtx: create new pbr materials using "new" key
fixes #291
2021-12-22 12:33:33 -08:00
Ivan Avdeev
86b13716bf rtx: create new materials referenceable by "for" key, #291 2021-12-22 12:33:33 -08:00
Ivan Avdeev
f02e0a8b3a rtx: enable referencing by short tex name in patch, #291 2021-12-22 12:33:33 -08:00
Ivan Avdeev
a94674b11a rtx: allow creating new pbr materials 2021-12-22 12:33:33 -08:00
Ivan Avdeev
9970d4e31a rtx: remove stale lbsp light code 2021-12-21 22:56:34 -08:00