diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2019-05-08 21:13:24 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2019-05-08 21:13:32 +0300 |
commit | f2f62b184c67f6b548da1cd9c022c9383e541bb0 (patch) | |
tree | 12896f71f49dda76cc6c430c2cdb5ae454d58762 /source/blender/draw/engines/eevee/shaders/lit_surface_vert.glsl | |
parent | bb41626ab3de31f670fcbe3365b61064e899c87f (diff) |
DRW: Remove WorldNormalMatrix
Diffstat (limited to 'source/blender/draw/engines/eevee/shaders/lit_surface_vert.glsl')
-rw-r--r-- | source/blender/draw/engines/eevee/shaders/lit_surface_vert.glsl | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/draw/engines/eevee/shaders/lit_surface_vert.glsl b/source/blender/draw/engines/eevee/shaders/lit_surface_vert.glsl index 40075ed64be..cddc8e87a1e 100644 --- a/source/blender/draw/engines/eevee/shaders/lit_surface_vert.glsl +++ b/source/blender/draw/engines/eevee/shaders/lit_surface_vert.glsl @@ -1,10 +1,8 @@ uniform mat4 ModelViewProjectionMatrix; uniform mat4 ModelViewMatrix; -uniform mat3 WorldNormalMatrix; #ifndef USE_ATTR uniform mat4 ModelMatrix; -uniform mat3 NormalMatrix; uniform mat4 ModelMatrixInverse; #endif @@ -67,8 +65,10 @@ void main() gl_Position = ModelViewProjectionMatrix * vec4(pos, 1.0); viewPosition = (ModelViewMatrix * vec4(pos, 1.0)).xyz; worldPosition = (ModelMatrix * vec4(pos, 1.0)).xyz; - worldNormal = normalize(WorldNormalMatrix * nor); - viewNormal = normalize(NormalMatrix * nor); + + worldNormal = normalize(transform_normal_object_to_world(nor)); + /* No need to normalize since this is just a rotation. */ + viewNormal = transform_normal_world_to_view(worldNormal); #endif /* Used for planar reflections */ |