Commit Graph

24 Commits

Author SHA1 Message Date
Ivan 'provod' Avdeev 5e50bdfcf2 rtx: add conveyor scrolling texture, fix #158 2021-10-27 22:48:26 -07:00
Ivan 'provod' Avdeev fe931fcfd7 rtx: collect d/elights and static entity point lights
sample all of them unconditionally for now
2021-09-20 23:35:49 -07:00
Ivan Avdeev a7288eba69 fix linux build 2021-09-14 17:47:05 -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 Avdeev 94ac51a527 rtx: sample mip levels based on ray cone width
this is mostly copied from ray tracing gems 2 chapter 7 (Texture Coordinate Gradients Estimation for Ray Cones, by Wessam Bahnassi).
There's a weird bit about radians vs degrees. We'll figure it out later when the book becomes available.
2021-08-04 18:36:53 -07:00
Ivan Avdeev eeb83bd99f rtx: dont trace ray when there's no geometry
We used to dispatch rays anyway even if there was no models to render and tlas wasn't built (which is the case for the first few frames).
This ended up crashing AMD gpu when using some (but not all) variants of rgen shaders.

With this change we'll check for whether there are any models to render, and if there are none, then we'll just clear frame to black.

This change also refactors ray tracing a bit.
2021-07-17 11:45:28 -07:00
Ivan 'provod' Avdeev 00518d3251 rtx: implement dynamic lights
track brush models movement and update lights grid clusters with model transform and stuff

also implement animated textures for rtx

and also increase per-cluster lights limits
2021-06-05 12:48:16 -07:00
Ivan 'provod' Avdeev ad2405547b rtx: rename model creation and move tlas creation 2021-05-26 09:35:36 -07:00
Ivan 'provod' Avdeev 44909ccbe5 rtx: improve render-ray interop
make a vk_ray_model_t that stores everything ray-tracing related, and can also be cached directly
2021-05-24 11:14:03 -07:00
Ivan 'provod' Avdeev be42bd29a5 add ring temp allocator logic 2021-05-03 11:17:01 -07:00
Ivan 'provod' Avdeev 9e8ca13dcc rtx: add studio models
but they crash a lot kek
2021-04-24 12:53:42 -07:00
Ivan 'provod' Avdeev 3a8f2ebc45 rtx: build blas and tlas only once 2021-04-09 14:59:04 -07:00
Ivan 'provod' Avdeev af5e20269d add persistent model api and use it for brushes
this needed for better rtx blas management
2021-04-07 12:11:20 -07:00
Ivan Avdeev 014925b3d4 fix linux build 2021-03-20 16:21:26 -07:00
Ivan 'provod' Avdeev d6c56d4e1b rtx: add emissive surfaces/textures
This is a massive hack, because we hardcoded some valve/lights.rad file
right into vk_rtx.c, and this is most certainly is not correct data. We
expect maps to have more custom rad file entries.
TODO: consult https://github.com/MaestroFenix/Half-Life-Resized-Maps

Also, emissive surfaces are no importance sampled, so it's noise fest.
2021-03-17 09:15:33 -07:00
Ivan 'provod' Avdeev b81a36a850 rtx: make beams emissive 2021-03-15 10:49:45 -07:00
Ivan 'provod' Avdeev a04b367a32 rtx: use model matrices to open doors and move wagonchik 2021-03-13 14:31:48 -08:00
Ivan 'provod' Avdeev 6d1dac453e rtx: add dynamic lights
no shadows and such stuff yet
2021-03-10 09:38:06 -08:00
Ivan 'provod' Avdeev 77288a205b rtx: read vertex normals according to isec indexes
Had to align vec3 fields of vk_vertex_t.
2021-03-08 12:09:11 -08:00
Ivan 'provod' Avdeev 28cdeaeb1d propagate proj/view matrices to rtx shader
And get RTX picture we deserve (i.e. glitchy and incorrect).
Will fix later.
2021-03-03 11:58:40 -08:00
Ivan 'provod' Avdeev e0ee4b756b rtx: make it draw yellow screen
this basically checks that acceleration structurs are building without
any vulkan errors (we still don't know whether they are bulding with
correct geometry though).

we also have compute shader pipeline ready for ray tracing (yay)
but it doesn't do any raytracing yet
2021-03-01 11:22:58 -08:00
Ivan Avdeev 5e3010489b rtx: blindly add tlas and compute rendering
it's unknown whether it works at all
no real ray tracing yet
2021-03-01 10:52:08 -08:00
Ivan 'provod' Avdeev c77f39e353 rtx: fix blas creation validation/memory errors 2021-02-27 15:40:57 -08:00
Ivan Avdeev 9954288450 rtx: add blas building skeleton 2021-02-27 13:43:49 -08:00