From c17a53c78f138c335f416e42590cb39d1c9b1e49 Mon Sep 17 00:00:00 2001 From: Anton Baskanov Date: Wed, 10 Nov 2021 12:27:31 +0700 Subject: [PATCH] Pass stationary UV coordinates to computeAnisotropicEllipseAxes. The coordinates must match the ones in the uvs array. Fixes blur of func_conveyor textures. --- ref_vk/shaders/ray.rchit | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ref_vk/shaders/ray.rchit b/ref_vk/shaders/ray.rchit index 8628d990..50c8b644 100644 --- a/ref_vk/shaders/ray.rchit +++ b/ref_vk/shaders/ray.rchit @@ -91,7 +91,8 @@ void main() { gl_ObjectToWorldEXT * vec4(vertices[vi2].pos, 1.), gl_ObjectToWorldEXT * vec4(vertices[vi3].pos, 1.), }; - const vec2 texture_uv = vertices[vi1].gl_tc * (1. - bary.x - bary.y) + vertices[vi2].gl_tc * bary.x + vertices[vi3].gl_tc * bary.y + push_constants.time * kusochki[kusok_index].uv_speed; + const vec2 texture_uv_stationary = vertices[vi1].gl_tc * (1. - bary.x - bary.y) + vertices[vi2].gl_tc * bary.x + vertices[vi3].gl_tc * bary.y; + const vec2 texture_uv = texture_uv_stationary + push_constants.time * kusochki[kusok_index].uv_speed; const uint tex_index = kusochki[kusok_index].texture; const vec3 real_geom_normal = normalize(cross(pos[2]-pos[0], pos[1]-pos[0])); @@ -104,7 +105,7 @@ void main() { const float ray_cone_width = payload.pixel_cone_spread_angle * payload.t_offset; vec4 uv_lods; - computeAnisotropicEllipseAxes(hit_pos, normal, gl_WorldRayDirectionEXT, ray_cone_width, pos, uvs, texture_uv, uv_lods.xy, uv_lods.zw); + computeAnisotropicEllipseAxes(hit_pos, normal, gl_WorldRayDirectionEXT, ray_cone_width, pos, uvs, texture_uv_stationary, uv_lods.xy, uv_lods.zw); const vec4 tex_color = textureGrad(textures[nonuniformEXT(tex_index)], texture_uv, uv_lods.xy, uv_lods.zw); //const vec3 base_color = pow(tex_color.rgb, vec3(2.)); const vec3 base_color = ((push_constants.flags & PUSH_FLAG_LIGHTMAP_ONLY) != 0) ? vec3(1.) : tex_color.rgb;// pow(tex_color.rgb, vec3(2.));