1
0
Fork 0

Merge pull request #109556 from devloglogan/mobile-motion-vec-fix

Fix mobile renderer motion vectors
This commit is contained in:
Thaddeus Crews 2025-08-13 18:42:13 -05:00
commit 583f3bfb97
No known key found for this signature in database
GPG Key ID: 8C6E5FEB5FC03CCC
1 changed files with 7 additions and 7 deletions

View File

@ -433,7 +433,7 @@ void vertex_shader(in vec3 vertex,
float roughness_highp = 1.0;
#ifdef USE_DOUBLE_PRECISION
mat4 modelview = scene_data.view_matrix * model_matrix;
mat4 modelview = view_matrix * model_matrix;
// We separate the basis from the origin because the basis is fine with single point precision.
// Then we combine the translations from the model matrix and the view matrix using emulated doubles.
@ -448,14 +448,14 @@ void vertex_shader(in vec3 vertex,
// Overwrite the translation part of modelview with improved precision.
vec3 temp_precision; // Will be ignored.
modelview[3].xyz = double_add_vec3(model_origin, model_precision, scene_data.inv_view_matrix[3].xyz, view_precision, temp_precision);
modelview[3].xyz = mat3(scene_data.view_matrix) * modelview[3].xyz;
modelview[3].xyz = double_add_vec3(model_origin, model_precision, inv_view_matrix[3].xyz, view_precision, temp_precision);
modelview[3].xyz = mat3(view_matrix) * modelview[3].xyz;
#else
mat4 modelview = scene_data.view_matrix * model_matrix;
mat4 modelview = view_matrix * model_matrix;
#endif
mat3 modelview_normal = mat3(scene_data.view_matrix) * model_normal_matrix;
mat4 read_view_matrix = scene_data.view_matrix;
vec2 read_viewport_size = scene_data.viewport_size;
mat3 modelview_normal = mat3(view_matrix) * model_normal_matrix;
mat4 read_view_matrix = view_matrix;
vec2 read_viewport_size = viewport_size;
{
#CODE : VERTEX