Commit Graph

1811 Commits

Author SHA1 Message Date
Ivan Avdeev
8f7bc69cb2 rtx: cull surface lights based on estimated light intensity 2021-10-13 12:27:24 -07:00
Ivan Avdeev
869c21e42d rtx: fix bsp visibility based light cluster generation
1. fix indexiing (+1)
2. fix rle skipping (*8)
3. fix bbox ranges (floorf .. ceilf)
2021-10-13 12:27:24 -07:00
Ivan Avdeev
3f90408108 work around stack corruption when parsing entities
we have a limited buffer for string when reading tokens and no way to
specify buffer space. just increase buffer size.

proper fix would be to change ref api to allow passing buffer size as an
argument.
2021-10-13 12:27:24 -07:00
Ivan Avdeev
4b0033985d rtx: construct light grid based on bsp visibility data
unfortunately it's broken and ends up producing incorrect light lists
per grid cells. we'll fix it eventually
2021-10-13 12:27:24 -07:00
Ivan Avdeev
87cb23eb8b rtx: collect per-leaf emissive surfaces with pvs data 2021-10-13 12:27:24 -07:00
Ivan Avdeev
9006d679ec rtx: associate msurfaces with mleafs 2021-10-13 12:27:24 -07:00
Ivan Avdeev
436ab8709e rtx: start collecting light sources per leaf 2021-10-13 12:27:24 -07:00
Ivan Avdeev
8b704ed9a6 handle externally provided swapchain resolution, fix #53 2021-09-24 20:58:01 -07:00
Ivan 'provod' Avdeev
6b1eb26c24 improve screenshot performance, fix #87
make sure that we use host_cached memory, otherwise device_local will be picked by default, which is very slow to read from.
2021-09-22 20:29:31 -07:00
Ivan Avdeev
fe52ff3d1a
Merge pull request #84 from 0x4E69676874466F78/vulkan
Update rad files
2021-09-21 08:57:26 -07:00
Ivan Avdeev
16df678fd2 fix linux build 2021-09-20 23:35:49 -07:00
Ivan 'provod' Avdeev
100ba22f0e rtx: add broken sun sampling
i cant into math. sun direction is completely incorrect
2021-09-20 23:35:49 -07:00
Ivan 'provod' Avdeev
f8b0b8c672 rtx: make light entity parsing extensible
x macros ftw
2021-09-20 23:35:49 -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 'provod' Avdeev
1953bf7b4f rtx: install known rads into valve/maps
fix #76
2021-09-20 23:35:49 -07:00
NightFox
70ae807b3d
+0~TNNL_LGT4 for c0a0d 2021-09-20 12:40:59 +03:00
NightFox
5e97b4dd28
Correction +0~TNNL_LGT4 for c0a0c
Do not tune rad files under rays while it is still unfinished, check only with qrad
2021-09-20 12:24:54 +03:00
NightFox
b5f263d56a
Correction +0~TNNL_LGT4 for c0a0c
Do not tune rad files under rays while it is still unfinished, check only with qrad
2021-09-20 12:22:01 +03:00
NightFox
907310c5bd
Update rad files
More correct light for c0a0c and c0a0d + correct RED for other rads.
2021-09-20 12:09:08 +03:00
NightFox
c68b82ca40
Added correct goldsrc era rad files ( #76 )
Base lights.rad/valve.rad from worldcraft v2.0 or HLSDK (thx Valve).
Base c1a0.rad and c1a0d.rad from HLSDK (thx Valve).
Some texture name get from hl_lights.rad by Hezus (thx Hezus and SNMetamorph for file).
Others was mined by me manually through bspguy and etc.

File structure and formatting redesigned.
Some numbers have been rounded for convenience.
Added splitting by WAD files (for the present only for lights.rad).

See README.txt for codestyle.
2021-09-18 17:08:01 +03:00
NightFox
add86b4018
Removed incorrect (source engine) rad files.
These rad files are not very useful for the goldsrc version.
2021-09-18 16:56:50 +03:00
Ivan 'provod' Avdeev
10127868ef rtx: skip RAD entries with "//" in the name, fix #42
Consider these to be commented out.
2021-09-16 11:09:21 -07:00
Ivan 'provod' Avdeev
31a5db1974 rtx: fix hit pos for translated brush modles, fixes #64
also add shadow offset to fix light flickering for moving sources
2021-09-16 11:09:21 -07:00
Ivan 'provod' Avdeev
4ff669c023 rtx: fix scratch buffer validation error, #69
New Vulkan SDK (1.2.189.2) has a new validation check that verifies that AS build scratch buffer has been created with VK_BUFFER_USAGE_STORAGE_BUFFER_BIT.
2021-09-16 11:09:21 -07:00
Ivan Avdeev
a7288eba69 fix linux build 2021-09-14 17:47:05 -07:00
Ivan 'provod' Avdeev
50200262df rtx: slightly improve black outlines on studio models (see #48)
The core of the issue is that there are backfacing interpolated normals, NdotL and/or NdotV end up being negative for them.
Things we tried:
1. Explicitly using geometry normals for some things. Doesn't really work that well.
2. Clamping NdotX to some small value instead of just ignoring light contribution. Works better, but there are still some artifacts.
2021-09-14 17:47:05 -07:00
Ivan 'provod' Avdeev
96709ac37c rtx: questionable attenuation for emissive surfaces
1. I suspect that we don't actually need to compute emissive contribution even for specular. Except when doing direct lighting.
2. Using emissive color as is looks orders of magnitude too bright. It should be scaled by something. But by what? Try to use to-metric mapping similar to direct lighting for testing.
2021-09-14 17:47:05 -07:00
Ivan 'provod' Avdeev
fbd8973a6d rtx: add command to reload rad files, fix #41
vk_rtx_reload_rad
2021-09-14 17:47:05 -07:00
Ivan 'provod' Avdeev
afa1e8557a rtx: fix c0a0d emissive toxic liquid, fix #56
It was missing msurface_t reference which is (unnecessarily) required for light clusters computation

Also add more verbose debug names for dynamic models.
2021-09-14 17:47:05 -07:00
Ivan Avdeev
3d0dafa8b4 fix rad filenames for maps 2021-09-11 15:47:16 -07:00
Ivan 'provod' Avdeev
7f1e6c8256 rtx: slightly improve (decrease) acne
how: we do not need to add emissive when doing diffuse gi bounce, as contribution from these lights will be computed in computeLighting.
They only need to be sampled for specular bounce.

The rest of the acne should be mitigated by denoiser i think.

Fix #51
2021-09-11 15:47:16 -07:00
Ivan 'provod' Avdeev
5ce91209ce rtx: load rad files from rad/<mapname>.rad, fix #43 2021-09-11 15:47:16 -07:00
Ivan Avdeev
d802ce279b
and another update ...
making sentences is hard
2021-09-11 00:09:12 -07:00
Ivan Avdeev
e5600fc0b3
Minor readme update 2021-09-11 00:07:33 -07:00
Ivan Avdeev
9df24231d5
Update README about this fork 2021-09-10 23:59:21 -07:00
Ivan Avdeev
4994ecf56d
Merge pull request #54 from w23/master-merge
Merge with latest master from upstream FWGS repo
2021-09-09 20:36:05 -07:00
Ivan Avdeev
18056700cf disable that SARIF thingie 2021-09-09 20:28:15 -07:00
Ivan Avdeev
908e54114b Merge remote-tracking branch 'upstream/master' into vulkan 2021-09-09 20:15:13 -07:00
Ivan Avdeev
cfe5612a3a attenuate area lights by projected area, fix #46
Also, tune "tonemapping"
2021-09-08 10:08:47 -07:00
Ivan Avdeev
0839f9673b update todo; move materials draft to separate file 2021-09-06 14:24:36 -07:00
Ivan Avdeev
ae12b4505d remove material flags 2021-09-06 14:24:36 -07:00
Ivan Avdeev
de611e159a assume textures are linear
this way it looks more like traditional renderer w/ lightmaps
2021-09-06 14:24:36 -07:00
Ivan Avdeev
2b2552cd72 fix rad file parsing
parsing strings in c is hard
2021-09-06 14:24:36 -07:00
Ivan Avdeev
86d669c708 enlarge scratch buffer to support more models 2021-09-06 12:03:44 -07:00
Ivan Avdeev
b9f5f87c76 bring back ray traced transparency
1. Probabilistically let ray through material or reflect it based on
   transparency probability (which is essentially just alpha for now).
2. Introduce opaque flag to be able to treat transparent objects as not
   casting shadows. This is not very realistic, but oh well.
2021-09-06 11:57:23 -07:00
2939ab8ea4 wscript: allow compiling with disabled warning-as-error 2021-09-06 00:04:27 +03:00
Ivan Avdeev
9759221e02 rtx: fix linux build 2021-09-04 13:50:05 -07:00
Ivan 'provod' Avdeev
672b2de75a rtx: cascading rad sheets
Read rad data from lights.rad and then mapname.rad
2021-09-04 13:50: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 'provod' Avdeev
22e76513a4 rtx: better lighting scaling
Remove arbitrary lightness fudge in favor of proper distance scaling.
According to TEH INTERNETS one unit is one inch. So there are 39.37 units per meter.
Scale distances to meters for lighting calculations.
2021-09-04 13:50:05 -07:00