`rt_force_disable` is perfectly fine, it just needs to be written into
either `vk.cfg` or `video.cfg` to work. Other configs are read *after*
`R_VkInit()` function get called.
It does it in a super dirty way, trad renderer needs a massive
refactoring.
It also displays patched skybox, however, we need it to display the
oridingal one.
Under `-vkvalidate` enables `debugPrintfEXT()` in shaders, allowing
extra validation and error reporting from shaders.
Severely degrades performance, so should be enabled only for debugging.
`throughput` should be scaled based on BRDF. I.e. diffuse bounces should
be scales by base_color at the very least.
This fixes lighting being too bright after 3-5 bounces.
Shoulnd't have multiplied by diffuse BRDF result. It should be encoded
in diffuse-vs-specular split, and the cosine term is already taken care
of in sampling.
Only engage soft particles/blending after a certain distance. Makes
certain see-beams-through-weapons visual glitches disappear.
Engages soft particles with a smoothstep so the don't immediately pop up
after a certain distance, rather appear gradually.
There are lots of empirical (and less-well undrestood things) scaling
color values in native code, it makes sense to consolidate them in one
place:
- less weird math in shaders. shader should be as streamlined as
possible
- one big block of weird math is untangleable in the future when we get
to work on light and clusters
1. Sample point lights as spheres. Use existing pdf value (`one_over_pdf`), as it was basically correct.
Compute max_theta angle based on light radius and distance to the
center. Sample cone direction based on this theta angle, in z=n space.
Don't do anyhting fancy wrt horizon, etc.
2. Sample environment light with max theta derived from real world sun
solid angle. Uses the same cone direction sampling.
Known issues:
- still get some NaNs sometimes, esp. on test_light map.
- Too many different light sources try to use the same code. They should
be split.
Relevant issues: #266, #151
Introduce several shader debugging/validation tiers:
1. Basic key values validation, to make sure there are no nasty NaNs or
invalid values written to G-buffers. Enabled by `DEBUG_VALIDATE` macro
in debug.glsl
2. Key value validation with whining: use `debugPrintfEXT()` function to
report any invalid values to Vulkan validation layers. Enabled using
`DEBUG_VALIDATE_PRINT` macro. Currently this is the one enabled, as
it allows us to catch any serious numerical issues during development
and testing.
3. Extra validation and printing for intermediate values. This is for
deeper investigations, and enabled only there temporarily.
- Turn off old-vs-new brdfs comparison.
- Enable picking up specular bounces.
- Use the same final color mixing for bounces too (except for legacy
blending, which will remain suboptimal)