Commit Graph

39 Commits

Author SHA1 Message Date
Ivan 'provod' Avdeev
78a1b24e11 rt: enable entity light, fix #115 2023-03-04 12:46:37 -08:00
Ivan 'provod' Avdeev
dc698c16dc vk: make sure deleted textures are not referenced in staging
This fixes -vkvalidate and fixes #464
2023-03-04 12:46:37 -08:00
NightFox
8ed23cb40f
More correct emissive textures (#456)
Я подобрал новое компромиссное значение которое не требует clamp.
Это не идеально, но пока сойдёт. Может давать немного больше солнечных зайчиков чем с clamp.
Позже надо будет разобраться с самим kusok.emissive.
2023-03-04 09:41:05 -08:00
Ivan Avdeev
c47c314512 rt: clear geom emissive values prior to loading light data
fix #104
2023-03-03 16:41:16 -08:00
Ivan Avdeev
4f2eb7680b rt: propagate emissive color patches to kusochki
Fixes #330

Also, fix incorrect patch application introduced by previous commit, it
would not read the patch color value, and could only switch the light
off.
2023-03-02 23:23:31 -08:00
Ivan Avdeev
a284567002 rt: refactor loading surface lights, fix #417
Do not entangle brush model loading with loading surface lights.
Do a separate pass over brush model surfaces for the sole purpose of
finding light sources. Enables consistent live-reloading light data
after patching entities/surface/rad files.
2023-03-02 22:32:08 -08:00
Ivan Avdeev
58c9a9920e rt: do not allow direct access to pached surfaces 2023-03-02 20:27:18 -08:00
NightFox
ed9a06cae1 Update lighting patches 2023-03-01 22:50:02 -08:00
Ivan 'provod' Avdeev
8a457a17c2 rt: compute tangents for studio models
Enables applying normal maps to studio models.

Fixes #220, fixes #241
2023-03-01 10:47:31 -08:00
Ivan 'provod' Avdeev
6b1e84308a rt: fix checking for skybox shadow intersection
Doing tereminate-on-first-hit is incorrect, as we might accidentally hit the skybox geometry first, and consider this as no shadow.
Unfortunately we have to explicitly find a closest hit and check whether that was a skybox.

Maybe there's even a better way, e.g. querying for skybox-only geometry first, and only then checking for a terminate-on-first-hit for everything else. But it likely doesn't matter that much, and would need profiling anyway.

Fixes #424 and #413
2023-02-28 18:50:07 -08:00
Ivan 'provod' Avdeev
59e8a8c4c3 rt: only overshoot additive for glow mode
Add another flag to kusochki for glow geometry.
Move flags to a new kusok.flags field.

Fixes #231 (or at least makes it not stand out too much)
2023-02-28 17:50:50 -08:00
LifeKILLED
f4b0f5016b vk rt: fix reprojection 2023-02-28 23:06:09 +04:00
Ivan 'provod' Avdeev
c8e4ce0619 vk: fix tracers colors 2023-02-27 11:00:34 -08:00
Ivan 'provod' Avdeev
d87690876f vk: fix TRI_QUADS and primitive_mode tracking 2023-02-27 10:51:11 -08:00
Ivan Avdeev
421c0ea733 vk: add tracers (not tested) 2023-02-27 10:37:03 -08:00
Ivan 'provod' Avdeev
30334db159 vk: draw the rest of the beams 2023-02-27 09:49:56 -08:00
Ivan 'provod' Avdeev
2daa130453 vk: set beam/triapi texture and render mode explicitly 2023-02-27 09:20:13 -08:00
Ivan 'provod' Avdeev
cf5d3d9d47 vk: increase limits for triapi
c4a1 was using too many indices
2023-02-27 08:46:12 -08:00
Ivan 'provod' Avdeev
a118e12e01 vk: stub just enough triapi to render more beam types
it is still drawn incorrectly, but at least something is visible, and we can iterate from here
2023-02-26 20:45:29 -08:00
Ivan 'provod' Avdeev
ee4def1141 rt: modulate additive kusochki by vertex color attribute 2023-02-25 18:41:01 -08:00
Ivan 'provod' Avdeev
1fadbce860 vk: remove flag attribute in vertex
make color computation more uniform and not mode-specific
2023-02-25 18:38:22 -08:00
Ivan 'provod' Avdeev
e4ad18f220 vk: do not modulate beam color twice
color is already applied at model/ubo level
2023-02-25 16:58:59 -08:00
Ivan 'provod' Avdeev
f2182bb255 vk: fix beams per-vertex blending 2023-02-25 16:47:23 -08:00
Ivan 'provod' Avdeev
1d17e55101 rt: hack all blending as additive
this is not correct, but at  least we get to see something
need to figure out how should blending work in rt:
- translucent materials that absorb light
- reflective+refractive
- etc
2023-02-25 13:22:56 -08:00
Ivan 'provod' Avdeev
3e2689b7f8 rt: improve sprite blending even moar
fixes most glaring sprite blending issues for ray tracing
2023-02-25 12:46:46 -08:00
Ivan 'provod' Avdeev
9f72a804e0 vk: improve traditional blending universally
it is now almost on par with the gl renderer
2023-02-25 12:09:20 -08:00
Ivan 'provod' Avdeev
ce27bdb1b1 vk: fix studio models being modulated by ent color 2023-02-24 23:57:49 -08:00
Ivan 'provod' Avdeev
cd524c20cf vk: make transparent brushes closer to gl
some of render modes are not affected by light, disable lightmaps for them
2023-02-24 23:54:41 -08:00
Ivan 'provod' Avdeev
03efb6ce83 fixup linux compiler warnings 2023-02-24 23:52:09 -08:00
Ivan 'provod' Avdeev
487c94662a rt: HACK flickering lerping sprites
Lerping between sprite frames means drawing two coplanar quads blended the right way. This is not something ray tracing can accommodate easily for all blending modes.
Disable lerping for now
2023-02-24 22:52:38 -08:00
Ivan 'provod' Avdeev
005b7c84eb vk: pass model color explicitly
Instead of passing model color around as an implicit global state, pass it per-model.
This makes it (a) easier to track, (b) easy to fix blending issues. E.g. this fixes incorrect coloring of brush and studio models, which is also different.
2023-02-24 22:48:26 -08:00
Ivan 'provod' Avdeev
92b1e78d85 vk: make trad sprites more like gl ones
still not fully there:
- glow is slightly off
- TransAlpha has wrong blending mode

apparently pipeline settings for brushes, models, and sprites are substantially different, need different pipelines
2023-02-24 17:43:07 -08:00
Ivan 'provod' Avdeev
a5b977c8a3 rt: make emissive surfaces ignore external light
this is not fully correct, but it fixes slightly off sprite colors for now
2023-02-23 20:08:02 -08:00
Ivan 'provod' Avdeev
41809b8952 vk: do not depth-test glow sprites
makes them more like gl ones

still not fully fixed though, need to work on their transparency, it should be also scaled
2023-02-23 20:07:06 -08:00
Ivan 'provod' Avdeev
4f6d51c368 vk: fix most of random sprite flickering
it was due to leaving garbage in vertex fields.

some animated spritest still flicker though
2023-02-23 20:05:58 -08:00
Ivan Avdeev
ad5e1b2b86 vk: fixup compilation w/o aftermath sdk 2023-02-23 18:59:14 -08:00
Ivan Avdeev
8514e2c7b8 ci: update vulkan sdk and distro versions 2023-02-23 14:18:02 -08:00
Ivan 'provod' Avdeev
1a6e967ddb vk: change how device extensions are checked
make nv_checkpoint not depend on rt
split it logically from aftermath
don't crash when this extension is not available
2023-02-23 13:48:41 -08:00
Ivan Avdeev
053d26e870 move ref_vk to ref/vk 2023-02-16 10:30:31 -08:00