Vulkan fixes

This commit is contained in:
luboslenco
2025-06-07 17:53:36 +02:00
parent fd3b7dcd9c
commit badbadb800
6 changed files with 34 additions and 16 deletions
Binary file not shown.
+1 -1
View File
@@ -109,7 +109,7 @@ fun ssao_blur_pass_frag(input: vert_out): float {
blur_weight_i = 0.008934;
}
var posadd: float = i;
var posadd: float = float(i);
var nor2: float3 = get_nor(sample_lod(gbuffer0, sampler_linear, input.tex + posadd * constants.dir_inv, 0.0).rg);
var influence_factor: float = step(discard_threshold, dot(nor2, nor));
+3 -3
View File
@@ -71,7 +71,7 @@ fun ray_cast(view_ray: float3, dir: float3, vpos: float3): float {
// for (var i: int = 0; i < max_steps; i = i + 1) {
var i: int = 0;
while (i < max_steps) {
while (i < int(max_steps)) {
hit_coord += dir;
var delta: float = get_delta_depth(view_ray, hit_coord);
if (delta > 0.0 && delta < 0.2) {
@@ -88,8 +88,8 @@ fun ray_cast(view_ray: float3, dir: float3, vpos: float3): float {
}
fun tangent(n: float3): float3 {
var t1: float3 = cross(n, float3(0, 0, 1));
var t2: float3 = cross(n, float3(0, 1, 0));
var t1: float3 = cross(n, float3(0.0, 0.0, 1.0));
var t2: float3 = cross(n, float3(0.0, 1.0, 0.0));
if (length(t1) > length(t2)) {
return normalize(t1);
}