From 666d5f739f0f89e42cd321222aedd5441dac9615 Mon Sep 17 00:00:00 2001 From: Chris Ridenour Date: Fri, 7 Apr 2023 12:21:22 -0400 Subject: [PATCH] Remove double vertex addition when using precision=double for multimesh rendering --- .../shaders/forward_clustered/scene_forward_clustered.glsl | 2 +- .../shaders/forward_mobile/scene_forward_mobile.glsl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/servers/rendering/renderer_rd/shaders/forward_clustered/scene_forward_clustered.glsl b/servers/rendering/renderer_rd/shaders/forward_clustered/scene_forward_clustered.glsl index c8ad1f0312fb..4954b7ff3ddc 100644 --- a/servers/rendering/renderer_rd/shaders/forward_clustered/scene_forward_clustered.glsl +++ b/servers/rendering/renderer_rd/shaders/forward_clustered/scene_forward_clustered.glsl @@ -358,7 +358,7 @@ void vertex_shader(in uint instance_index, in bool is_multimesh, in uint multime vec3 model_origin = model_matrix[3].xyz; if (is_multimesh) { vertex = mat3(matrix) * vertex; - model_origin = double_add_vec3(model_origin, model_precision, matrix[3].xyz, vec3(0.0), model_precision); + model_origin = double_add_vec3(vec3(0.0), model_precision, matrix[3].xyz, vec3(0.0), model_precision); } vertex = mat3(model_matrix) * vertex; vec3 temp_precision; // Will be ignored. diff --git a/servers/rendering/renderer_rd/shaders/forward_mobile/scene_forward_mobile.glsl b/servers/rendering/renderer_rd/shaders/forward_mobile/scene_forward_mobile.glsl index a8b28bbd4fc9..5f2b620b90db 100644 --- a/servers/rendering/renderer_rd/shaders/forward_mobile/scene_forward_mobile.glsl +++ b/servers/rendering/renderer_rd/shaders/forward_mobile/scene_forward_mobile.glsl @@ -359,7 +359,7 @@ void main() { vec3 model_origin = model_matrix[3].xyz; if (is_multimesh) { vertex = mat3(matrix) * vertex; - model_origin = double_add_vec3(model_origin, model_precision, matrix[3].xyz, vec3(0.0), model_precision); + model_origin = double_add_vec3(vec3(0.0), model_precision, matrix[3].xyz, vec3(0.0), model_precision); } vertex = mat3(model_matrix) * vertex; vec3 temp_precision;