Commit Graph

381 Commits

Author SHA1 Message Date
Ivan Avdeev
ee52562e46 rtx: propagate patched emissive color 2021-11-28 13:51:30 -08:00
Ivan Avdeev
7ca6c2128c rtx: allow patching light entities
change light position and color example:
```
{
	"_xvk_ent_id" "217"
	"_light" "255 0 255 1000"
	"origin" "-2016 300 -432"
}
```

delete light example:
```
{
	"_xvk_ent_id" "219"
}
```
2021-11-28 13:38:01 -08:00
Ivan Avdeev
cd2804b659 attempt to read skybox images from pbr/env/<name>.png first, #155 2021-11-28 12:43:35 -08:00
Ivan Avdeev
5a7cb651ca rtx: allow patching emissive color for brush surfaces, #117 2021-11-28 11:15:02 -08:00
Ivan Avdeev
c4c97b2822 Merge branch 'vulkan' into patch 2021-11-28 09:56:25 -08:00
Ivan Avdeev
a394038f22 rtx: do not treat SURF_SKY as light source, fix #232 2021-11-27 20:22:32 -08:00
Ivan Avdeev
28d047a904 rtx: enable patching surface textures
example:
```
{
	"_xvk_surface_id" "489"
	"_xvk_texture" "#maps/test_material.bsp:debug_normal1.mip"
}
```

if _xvk_texture is empty, then the surface will be deleted

surfaces can be deleted or their
2021-11-26 23:59:48 -08:00
Ivan Avdeev
c2748ff034 fix random crashes on map load
how about not freeing stuff and then trying to use it?
2021-11-25 15:08:16 -08:00
Ivan 'provod' Avdeev
f0aaa3cd10 materials: enable force-reloading textures
mark such materials as `"force_reload" "1"`
2021-11-25 14:38:03 -08:00
Ivan 'provod' Avdeev
1624f4620a mat: load materials from multiple sources; abs paths
- look for materials in:
  - pbr/materials.mat
  - pbr/models/materials.mat
  - pbr/wadname.wad/materials.mat
  - pbr/maps/mapname.bsp/materials.mat

- all paths are relative to their materials.mat, except for ones that begin with '/', which are relative to `pbr` dir

pbr dir should be placed in modname dir, e.g. 'valve'

#155
2021-11-25 13:51:39 -08:00
Ivan 'provod' Avdeev
405a9ecbb4 rtx: skybox srgb workaround for #230 2021-11-25 12:31:36 -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
12565a35a1 reorient skyboxes to vulkan spec 2021-11-23 09:07:58 -08:00
Ivan Avdeev
9920dc6674 unload cubemaps 2021-11-23 09:07:21 -08:00
Ivan Avdeev
1ad13817fe add cubemap support; add misaligned skybox 2021-11-21 14:53:51 -08:00
Ivan Avdeev
714d825956 deduplicate creation of VkImages 2021-11-21 13:40:11 -08:00
Ivan Avdeev
dc3e75bd44 add skybox from which we only render UP plane kek #140 2021-11-19 11:46:44 -08:00
Ivan Avdeev
335be32cff rtx: fix additive when hitting sky 2021-11-19 11:46:44 -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
10c48e86b3 take tangent from bsp data directly, fix #218 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
430d56af5f rtx: enable partial texture overrides in materials 2021-11-17 11:11:34 -08:00
Ivan Avdeev
a736b223c9 fix emissive surfaces being too dark, #145 2021-11-17 10:27:58 -08:00
Ivan Avdeev
f938427771 work around validation bug
see https://github.com/KhronosGroup/Vulkan-ValidationLayers/issues/3350
2021-11-17 09:43:18 -08:00
Ivan Avdeev
6df830dd0a add initial normalmaps support 2021-11-17 09:43:10 -08:00
Ivan Avdeev
311e6214c8 fix linux build 2021-11-16 09:34:36 -08:00
Ivan 'provod' Avdeev
bd4de6128c rtx: add metalness and roughness map support
overrides existing textures. loads override data from pbr/materials.map
2021-11-16 09:34:36 -08:00
Ivan 'provod' Avdeev
e8359b12e8 rtx: add material support stub 2021-11-16 09:34:36 -08:00
Ivan 'provod' Avdeev
25ed4598b4 rtx: slightly denoise specular (bad) 2021-11-12 10:43:14 -08:00
Ivan 'provod' Avdeev
499adafaed rtx: pass normals to denoiser 2021-11-12 10:42:56 -08:00
Ivan 'provod' Avdeev
fdad4fa016 rtx: make denoiser kernel gaussian 2021-11-12 09:40:08 -08:00
Ivan 'provod' Avdeev
59a15a0580 rtx: do not kill bounces too early
fixes dark roughness blots
2021-11-12 09:13:03 -08:00
Ivan 'provod' Avdeev
87095c59da Merge remote-tracking branch 'origin/vulkan' into E164 2021-11-12 08:28:46 -08:00
Anton Baskanov
c17a53c78f Pass stationary UV coordinates to computeAnisotropicEllipseAxes.
The coordinates must match the ones in the uvs array. Fixes blur of
func_conveyor textures.
2021-11-10 00:12:23 -08:00
Anton Baskanov
593be43b58 Pass world positions to computeAnisotropicEllipseAxes().
Fixes #197.
2021-11-10 00:12:23 -08:00
Ivan 'provod' Avdeev
4712b7c1eb rtx: fix gbuffer destruction 2021-11-09 11:06:35 -08:00
Ivan 'provod' Avdeev
a152fb8ac1 rtx: add specular and additive channels 2021-11-09 10:59:36 -08:00
Ivan 'provod' Avdeev
6f8bbb277b rtx: split lighting into diffuse and specular components 2021-11-09 10:35:29 -08:00
Anton Baskanov
499559308d Compute texcoord gradients with anisotropy.
Fixes #167 (this time for real :-)). The original function did not
account for anisotropy, so use code from a different paper.
2021-11-08 16:52:20 -08:00
Ivan Avdeev
c949b7f214 fix linux build 2021-11-07 13:49:44 -08:00
Ivan 'provod' Avdeev
4cfe76dc40 rtx: split color into base and diffuseGI; add dumb denoiser 2021-11-07 13:49:44 -08:00
Ivan 'provod' Avdeev
0627c612c3 rtx: s/rgba8/rgba16f/ for color textures 2021-11-07 13:49:44 -08:00
Ivan 'provod' Avdeev
f570e59961 rtx: move upscaling back from denoiser 2021-11-07 13:49:44 -08:00
Ivan 'provod' Avdeev
c89dfee7b8 rtx: fix pre-denoise barriers, remove feedback from rgen 2021-11-07 13:49:44 -08:00
Ivan 'provod' Avdeev
e6db0fde45 add debug names to various vk images 2021-11-07 13:49:44 -08:00
Ivan 'provod' Avdeev
3abd5ee259 BROKEN rtx: add denoiser compute stub 2021-11-07 13:49:44 -08:00
Ivan 'provod' Avdeev
fca6857e51 rtx: add denoiser api stub 2021-11-07 13:49:44 -08:00
Anton Baskanov
3f70032e77 Convert fov to radians when computing pixel cone.
Fixes #167. Textures are still blurry when viewed at an angle as
UVDerivsFromRayCone does not take anisotropy into account.
2021-11-04 22:40:34 -07:00
Ivan Avdeev
36cf2146da add ui_infotool to print entity info under crosshair for debugging, fix #34 2021-11-03 10:53:56 -07:00
Ivan Avdeev
9a0fc7cdac move camera related things to camera.{h,c} 2021-11-03 10:53:56 -07:00