Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClément Foucault <foucault.clem@gmail.com>2022-10-05 21:28:51 +0300
committerClément Foucault <foucault.clem@gmail.com>2022-10-05 21:29:12 +0300
commit6306d747b770685f38f95bc57f8681335ddfa506 (patch)
tree71a54752a9400149535d7a3a95652fe9e1a86c0c /source/blender/draw/engines/eevee/shaders/object_motion_vert.glsl
parent74ff0aeea0180dfd89b98f15dacf0dd0c8fa8dfd (diff)
DRW: Split ViewProjectionMatrix in order to increase precision
This also removes the need to compute the persmat and saves some memory from the `ViewInfos` struct. This is needed to allow multiview support. Initial testing found no major performance regression during vertex heavy workload. Test file: {F13610017} Results: | Platform | Master | Split Matrix| | Linux + Mesa + AMD W6600 | 48 fps | 47 fps | | Macbook Pro M1 | 50 fps | 51 fps | | Linux + NVidia 1080Ti | 51 fps | 52 fps | | Linux + Radeon Vega 64 | 25.6 fps | 26.7 fps | Increased precision when far from origin: {F13610024} {F13610025} Reviewed By: jbakker Differential Revision: https://developer.blender.org/D16125
Diffstat (limited to 'source/blender/draw/engines/eevee/shaders/object_motion_vert.glsl')
-rw-r--r--source/blender/draw/engines/eevee/shaders/object_motion_vert.glsl4
1 files changed, 2 insertions, 2 deletions
diff --git a/source/blender/draw/engines/eevee/shaders/object_motion_vert.glsl b/source/blender/draw/engines/eevee/shaders/object_motion_vert.glsl
index ef96bcbaedb..9dab04006a8 100644
--- a/source/blender/draw/engines/eevee/shaders/object_motion_vert.glsl
+++ b/source/blender/draw/engines/eevee/shaders/object_motion_vert.glsl
@@ -52,8 +52,8 @@ void main()
/* Use jittered projmatrix to be able to match exact sample depth (depth equal test).
* Note that currModelMatrix needs to also be equal to ModelMatrix for the samples to match. */
#ifndef HAIR
- gl_Position = ViewProjectionMatrix * vec4(currWorldPos, 1.0);
+ gl_Position = ProjectionMatrix * (ViewMatrix * vec4(currWorldPos, 1.0));
#else
- gl_Position = ViewProjectionMatrix * vec4(wpos, 1.0);
+ gl_Position = ProjectionMatrix * (ViewMatrix * vec4(wpos, 1.0));
#endif
}