Commit Graph

200 Commits

Author SHA1 Message Date
Ivan Avdeev 7d6c12218f vk: comment on why we need inverse model matrix 2023-05-15 09:47:03 -07:00
Ivan Avdeev e54913f8af rt: improve prev frame bone matrix tracking for studio models
Still has some artifacts, but is generally rather close. Will look at
this again when caching studio model BLASes, as we'd be able to look at
them without extra animations.
2023-05-15 09:47:03 -07:00
Ivan Avdeev 091c61a45f vk: make sure studio model vertices are local space
TODO:
- revert not applying rotationmatrix in local vk_studio code
- make sure that prev_frame stuff hasn't changed
2023-05-15 09:47:03 -07:00
Ivan Avdeev e49f517dc0 vk: don't apply studio model matrix to vertices 2023-05-15 09:47:03 -07:00
NightFox c91db96008 update patches 2023-05-05 15:12:28 -07:00
NightFox e86e16235c add rad files for cstrike 2023-05-05 15:12:28 -07:00
NightFox a2c6e3b444 Add cs_assault.rad 2023-05-05 15:12:28 -07:00
NightFox 596d35ddfa update rad files 2023-05-05 15:12:28 -07:00
NightFox b49dca536d Rename c1a3b.bsp.patch to c1a3b-dayone.bsp.patch 2023-05-05 15:12:28 -07:00
NightFox d2f45c53a0 Rename c1a3c.bsp.patch to c1a3c-dayone.bsp.patch 2023-05-05 15:12:28 -07:00
NightFox 48f9813edd update patches 2023-05-05 15:12:28 -07:00
Ivan Avdeev babfbb08ab vk: improve mvp matrix handling a bit 2023-05-04 11:10:22 -07:00
Ivan Avdeev 4f43b316a6 rt: material: print fauly lines on unknown keys 2023-05-04 11:10:22 -07:00
Ivan Avdeev 481aa651c6 vk: refactor passing m,v,p matrices around
View and projection now set only once in a logical place.
Model matrix is now closely associated with its model, and not stored as
a global state.
2023-05-04 11:10:22 -07:00
Ivan Avdeev 0b6ef9fd65 vk: remove a couple unused things from vk_render draw structs 2023-05-04 11:10:22 -07:00
Ivan 'provod' Avdeev 58433a2221 rt: only load textures for potentially usable materials
Skip loading textures for materials which are not going to be used.
2023-05-04 11:10:22 -07:00
Ivan 'provod' Avdeev 1cfb183cbd rt: extract per-model data from kusochki 2023-05-01 17:03:22 -07:00
Ivan Avdeev 0d8a7f76f5
Merge pull request #529 from w23/E260
- [x] Improves #528 a bit
- [x] Fixes #523 
  - [x] Fix ![image](https://user-images.githubusercontent.com/321361/235242886-bbae06cf-4375-4e11-bae0-8bc4e7644d59.png)
  - [ ] ~верни зеркало! ![image](https://user-images.githubusercontent.com/321361/235250971-6652e2b2-e531-4b41-b603-1c50306b7ea3.png)~
  - [x] test_brush2 лесенки пропали на растеризации
2023-05-01 10:45:31 -07:00
Ivan Avdeev 54d909b715 vk: make sure blending is the same as for gl for brush models
Essentially just copy R_SetRenderMode() logic to vk_brush
2023-05-01 10:27:30 -07:00
Alibek Omarov 12dbfb467a ref: vk: studio: port optimized R_LightLambert function 2023-04-29 22:57:02 +03:00
Ivan Avdeev b93ef2e52c vk: fix freeing NULL bmodel memory 2023-04-28 13:29:02 -07:00
Ivan 'provod' Avdeev e1d250e8da vk: split geometries into static and animated
Load geometries only once, and then update only those which have animated textures.

Fixes #523
2023-04-28 12:35:48 -07:00
Ivan 'provod' Avdeev f722f38617 vk: infotool: mark ent index as dynamic 2023-04-28 11:31:41 -07:00
Ivan 'provod' Avdeev 52f99ec329 rt: only upload kusochki when needed
- Once at load
- When color/mode/prevxform changed

Breaks animated textures.
#523
2023-04-28 11:19:57 -07:00
Ivan Avdeev b17c00654b vk: silence a couple NOT IMPLEMENTED messages
- We're not going to implement R_ShowTextures for ref_vk, at least in
  its gl form.
- It seems that Mod_GetCurrentVis() can just return NULL, at least
  ref_soft does it.

Fixes #269, fixes #254
2023-04-28 10:32:01 -07:00
Ivan Avdeev 3447dfc5d6 rt: linearize alpha value for blending
This makes transparent brushes look more correct. But also makes sprites
look a bit dull.

Fixes #528
2023-04-28 10:12:15 -07:00
Alibek Omarov 62590dd2a9 ref: vk: use safe string functions, as unsafe versions were removed from libpublic 2023-04-28 17:43:50 +03:00
Alibek Omarov e5e2a63ba2 ref: vk: fix matrix4x4_identity to m_matrix4x4_identity which conflicts in Vita port 2023-04-28 17:43:01 +03:00
Alibek Omarov a117338435 ref: vk: port to RefAPI 4 2023-04-28 17:34:05 +03:00
Alibek Omarov c4757058e1 Merge upstream master 2023-04-28 17:15:31 +03:00
Alibek Omarov cb3b16e2ec engine: client: implement v_dark in engine, instead of making it ref-specific 2023-04-28 16:52:22 +03:00
Ivan Avdeev 8ac1a76259 rt: rename traceAdditive to traceSimpleBlending
This is to more clearly distinguish between simple blended things that
don't participate in lighting, and future more involved blending with
refraction and being affected by light
2023-04-27 10:59:38 -07:00
Ivan Avdeev 847777fb6b rt: do not forget to clear scratch buffer before loading new map
Fixes rare random crashes when loading maps with many models in it.
2023-04-27 10:59:38 -07:00
Ivan Avdeev 0b8b5b571b rt: sort transparent geometry ray hits
Limit to 8 layer for now. Seems to be working just fine.
VGPR usage and performance impact will be checked later.
2023-04-27 10:59:38 -07:00
Ivan Avdeev b79a65f8a1 rt: fixup incorrect oit application
Still doesn't work for us, as we also have purely emissive/additive
polygons. wOIT doesn't seem to support that fundamentally, each surface
should still attenuate the background.

Didn't even get to the _weighted_ part of it because of that.
2023-04-27 10:59:38 -07:00
Ivan Avdeev 449bcc4db9 rt: fixup blending emissive in background 2023-04-27 10:59:38 -07:00
Ivan Avdeev ae510dd3ff rt: use kusok.model.color
Fixes blending differences in test_brush/test_sprite maps. They now look
fairly similar (modulo color correction).

OIT is still a bit off, but good enough for now
2023-04-27 10:59:38 -07:00
Ivan 'provod' Avdeev d6a41bc041 rt: try weighted oit
Known issues:
- test_brush blend modes are broken
- emissive does not participate in weighted oit properly
2023-04-27 10:59:38 -07:00
Ivan 'provod' Avdeev d576818550 rt: implement mix blending with undefined order
Known issues:
- apparently BLEND_MIX surfaces should also participate in lighting. Figure out how.
- sensitive to ray tracing order. Need proper OIT (or hacks)
2023-04-27 10:59:38 -07:00
Ivan 'provod' Avdeev 3800d6559e rt: restore glow
This required uploaded kusochki only later during frame time, just before rendering the model. Otherwise they would get incorrect rendermode.

Also add blend mode debug colors.
2023-04-27 10:59:38 -07:00
Ivan 'provod' Avdeev 1ebc1d207c rt: commoditize setting material mode
Known issues:
- Breaks sprite glow for some reason.
2023-04-27 10:59:38 -07:00
Ivan 'provod' Avdeev 5b370509fe rt: group Material and ModelMetadata in Kusok
They have mismatching frequencies. ModelMetadata should be per-Model, there should be only a few dozen of these.
There maybe hundreds (or even thousands) of materials, but one material can be still referenced by many kusochki.

This only moves fields into new structs, which still belong to Kusok. The real extraction will happen later, see #52.
2023-04-27 10:59:38 -07:00
Alibek Omarov 27aad9f4a0 ref: gl: add size argument to COM_Default/ReplaceExtension calls 2023-04-26 05:20:45 +03:00
Alibek Omarov 8b96e7ca87 ref: add size argument to COM_FileBase calls 2023-04-26 05:20:45 +03:00
Alibek Omarov 8f207362a5 public: remove Q_sprintf, and patch all code that used it to use Q_snprintf instead 2023-04-26 05:20:45 +03:00
Alibek Omarov 096ee34f67 public: remove Q_vsprintf, replace by proper Q_vsnprintf proper calls
Fixes weird off by one error caused by glibc updates? I didn't tracked
what causes it exactly but replacing it seems to work. Anyway, we should
remove all 99999 hacks in libpublic.
2023-04-23 18:19:28 +03:00
Ivan Avdeev 935c2e7f5e rt: remove a bunch of extra material flags
These are either unused, or their meaning can be recovered through other
means.
2023-04-21 23:34:27 -07:00
Ivan Avdeev 41b033efbd vk: comment various material-related things
This is in preparation for #460
2023-04-21 23:34:27 -07:00
Ivan Avdeev e9f15edbd5 vk: fix refercing func_wall ents by indexes; only model names work 2023-04-19 20:25:00 -07:00
Ivan Avdeev d7660cf358 vk: patch func_wall ents by their index, not model name
Note that referencing them by ent->index inside the engine is not
possible, as this index is not stable enough.
2023-04-19 20:25:00 -07:00