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>2019-05-09 17:16:12 +0300
committerClément Foucault <foucault.clem@gmail.com>2019-05-10 13:14:41 +0300
commita298dde5d799bd41dd571cda9c91b62a6b78562a (patch)
tree75dc46e668c58915e0a2f1a8369f2a029e42072c /source/blender/draw/engines/eevee/shaders/prepass_vert.glsl
parentfdddea676d4fa40668ca82f8ccc5106437d113f2 (diff)
Eevee: Update matrices operations to not use combined matrices
Diffstat (limited to 'source/blender/draw/engines/eevee/shaders/prepass_vert.glsl')
-rw-r--r--source/blender/draw/engines/eevee/shaders/prepass_vert.glsl12
1 files changed, 5 insertions, 7 deletions
diff --git a/source/blender/draw/engines/eevee/shaders/prepass_vert.glsl b/source/blender/draw/engines/eevee/shaders/prepass_vert.glsl
index 9196253478a..883862855f3 100644
--- a/source/blender/draw/engines/eevee/shaders/prepass_vert.glsl
+++ b/source/blender/draw/engines/eevee/shaders/prepass_vert.glsl
@@ -19,25 +19,23 @@ void main()
{
#ifdef HAIR_SHADER
float time, thick_time, thickness;
- vec3 pos, tan, binor;
+ vec3 worldPosition, tan, binor;
hair_get_pos_tan_binor_time((ProjectionMatrix[3][3] == 0.0),
ModelMatrixInverse,
ViewMatrixInverse[3].xyz,
ViewMatrixInverse[2].xyz,
- pos,
+ worldPosition,
tan,
binor,
time,
thickness,
thick_time);
-
- gl_Position = ViewProjectionMatrix * vec4(pos, 1.0);
- vec4 worldPosition = vec4(pos, 1.0);
#else
- gl_Position = ModelViewProjectionMatrix * vec4(pos, 1.0);
- vec4 worldPosition = (ModelMatrix * vec4(pos, 1.0));
+ vec3 worldPosition = point_object_to_world(pos);
#endif
+ gl_Position = point_world_to_ndc(worldPosition);
+
#ifdef CLIP_PLANES
gl_ClipDistance[0] = dot(vec4(worldPosition.xyz, 1.0), ClipPlanes[0]);
#endif