Fix T58492: Removes jitter when using adaptive smoke domains
authorSebastián Barschkis <sebbas@sebbas.org>
Tue, 21 May 2019 20:07:35 +0000 (22:07 +0200)
committerSebastián Barschkis <sebbas@sebbas.org>
Tue, 21 May 2019 20:13:12 +0000 (22:13 +0200)
This small fix in the GLSL shader seems do to the trick: now smoke won't jitter when using the adaptive domain.

The previous workaround rB3891ad8e0317 is still needed too, i.e. the bug that caused jitter this time was not related to the previous one.

source/blender/draw/engines/workbench/shaders/workbench_volume_frag.glsl

index 848cd49..fd06c85 100644 (file)
@@ -216,8 +216,8 @@ void main()
   vs_ray_dir /= abs(vs_ray_dir.z);
 
   /* TODO(fclem) Precompute the matrix/ */
-  vec3 ls_ray_dir = vs_ray_dir * OrcoTexCoFactors[1] * 2.0;
-  ls_ray_dir = mat3(ModelMatrixInverse) * (mat3(ViewMatrixInverse) * ls_ray_dir);
+  vec3 ls_ray_dir = mat3(ViewMatrixInverse) * vs_ray_dir * OrcoTexCoFactors[1] * 2.0;
+  ls_ray_dir = mat3(ModelMatrixInverse) * ls_ray_dir;
   vec3 ls_ray_ori = point_view_to_object(vs_ray_ori);
   vec3 ls_ray_end = point_view_to_object(vs_ray_end);