feat: modules moved and engine moved to submodule

This commit is contained in:
Jan van der Weide 2025-04-12 18:40:44 +02:00
parent dfb5e645cd
commit c33d2130cc
5136 changed files with 225275 additions and 64485 deletions

View file

@ -195,9 +195,9 @@ void SSAO_tap_inner(const int p_quality_level, inout float r_obscurance_sum, ino
float weight = 1.0;
if (p_quality_level >= SSAO_HALOING_REDUCTION_ENABLE_AT_QUALITY_PRESET) {
float reduct = max(0, -hit_delta.z);
reduct = clamp(reduct * params.neg_inv_radius + 2.0, 0.0, 1.0);
weight = SSAO_HALOING_REDUCTION_AMOUNT * reduct + (1.0 - SSAO_HALOING_REDUCTION_AMOUNT);
float reduce = max(0, -hit_delta.z);
reduce = clamp(reduce * params.neg_inv_radius + 2.0, 0.0, 1.0);
weight = SSAO_HALOING_REDUCTION_AMOUNT * reduce + (1.0 - SSAO_HALOING_REDUCTION_AMOUNT);
}
weight *= p_weight_mod;
r_obscurance_sum += obscurance * weight;

View file

@ -195,9 +195,9 @@ void SSIL_tap_inner(const int p_quality_level, inout vec3 r_color_sum, inout flo
float weight = 1.0;
if (p_quality_level >= SSIL_HALOING_REDUCTION_ENABLE_AT_QUALITY_PRESET) {
float reduct = max(0, -hit_delta.z);
reduct = clamp(reduct * params.neg_inv_radius + 2.0, 0.0, 1.0);
weight = SSIL_HALOING_REDUCTION_AMOUNT * reduct + (1.0 - SSIL_HALOING_REDUCTION_AMOUNT);
float reduce = max(0, -hit_delta.z);
reduce = clamp(reduce * params.neg_inv_radius + 2.0, 0.0, 1.0);
weight = SSIL_HALOING_REDUCTION_AMOUNT * reduce + (1.0 - SSIL_HALOING_REDUCTION_AMOUNT);
}
// Translate sampling_uv to last screen's coordinates

View file

@ -59,7 +59,11 @@ layout(location = 0) in vec2 uv_interp;
layout(set = 0, binding = 0) uniform sampler2D source_color;
#endif /* USE_MULTIVIEW */
#ifdef SPLIT_RG
layout(location = 0) out vec2 frag_color;
#else
layout(location = 0) out uint frag_color;
#endif
layout(push_constant, std430) uniform Params {
float max_texel_factor;
@ -79,6 +83,10 @@ void main() {
// Input is standardized. R for X, G for Y, 0.0 (0) = 1, 0.33 (85) = 2, 0.66 (170) = 3, 1.0 (255) = 8
vec4 color = textureLod(source_color, uv, 0.0);
#ifdef SPLIT_RG
// Density map for VRS according to VK_EXT_fragment_density_map, we can use as is.
frag_color = max(vec2(1.0f) - color.rg, vec2(1.0f / 255.0f));
#else
// Output image shading rate image for VRS according to VK_KHR_fragment_shading_rate.
color.r = clamp(floor(color.r * params.max_texel_factor + 0.1), 0.0, params.max_texel_factor);
color.g = clamp(floor(color.g * params.max_texel_factor + 0.1), 0.0, params.max_texel_factor);
@ -94,4 +102,5 @@ void main() {
// Encode to frag_color;
frag_color = int(color.r + 0.1) << 2;
frag_color += int(color.g + 0.1);
#endif
}