diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-04-17 07:17:24 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-04-17 07:21:24 +0300 |
commit | e12c08e8d170b7ca40f204a5b0423c23a9fbc2c1 (patch) | |
tree | 8cf3453d12edb177a218ef8009357518ec6cab6a /source/blender/draw/engines/eevee/shaders/lit_surface_vert.glsl | |
parent | b3dabc200a4b0399ec6b81f2ff2730d07b44fcaa (diff) |
ClangFormat: apply to source, most of intern
Apply clang format as proposed in T53211.
For details on usage and instructions for migrating branches
without conflicts, see:
https://wiki.blender.org/wiki/Tools/ClangFormat
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 | 60 |
1 files changed, 33 insertions, 27 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 141d3363a09..29ecbd694c9 100644 --- a/source/blender/draw/engines/eevee/shaders/lit_surface_vert.glsl +++ b/source/blender/draw/engines/eevee/shaders/lit_surface_vert.glsl @@ -18,8 +18,9 @@ out vec3 viewPosition; /* Used for planar reflections */ /* keep in sync with EEVEE_ClipPlanesUniformBuffer */ -layout(std140) uniform clip_block { - vec4 ClipPlanes[1]; +layout(std140) uniform clip_block +{ + vec4 ClipPlanes[1]; }; #ifdef USE_FLAT_NORMAL @@ -41,39 +42,44 @@ flat out int hairStrandID; void main() { #ifdef GPU_INTEL - /* Due to some shader compiler bug, we somewhat - * need to access gl_VertexID to make it work. even - * if it's actually dead code. */ - gl_Position.x = float(gl_VertexID); + /* Due to some shader compiler bug, we somewhat + * need to access gl_VertexID to make it work. even + * if it's actually dead code. */ + gl_Position.x = float(gl_VertexID); #endif #ifdef HAIR_SHADER - hairStrandID = hair_get_strand_id(); - vec3 pos, binor; - hair_get_pos_tan_binor_time( - (ProjectionMatrix[3][3] == 0.0), - ModelMatrixInverse, - ViewMatrixInverse[3].xyz, ViewMatrixInverse[2].xyz, - pos, hairTangent, binor, hairTime, hairThickness, hairThickTime); + hairStrandID = hair_get_strand_id(); + vec3 pos, binor; + hair_get_pos_tan_binor_time((ProjectionMatrix[3][3] == 0.0), + ModelMatrixInverse, + ViewMatrixInverse[3].xyz, + ViewMatrixInverse[2].xyz, + pos, + hairTangent, + binor, + hairTime, + hairThickness, + hairThickTime); - gl_Position = ViewProjectionMatrix * vec4(pos, 1.0); - viewPosition = (ViewMatrix * vec4(pos, 1.0)).xyz; - worldPosition = pos; - hairTangent = normalize(hairTangent); - worldNormal = cross(binor, hairTangent); - viewNormal = mat3(ViewMatrix) * worldNormal; + gl_Position = ViewProjectionMatrix * vec4(pos, 1.0); + viewPosition = (ViewMatrix * vec4(pos, 1.0)).xyz; + worldPosition = pos; + hairTangent = normalize(hairTangent); + worldNormal = cross(binor, hairTangent); + viewNormal = mat3(ViewMatrix) * worldNormal; #else - 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); + 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); #endif - /* Used for planar reflections */ - gl_ClipDistance[0] = dot(vec4(worldPosition, 1.0), ClipPlanes[0]); + /* Used for planar reflections */ + gl_ClipDistance[0] = dot(vec4(worldPosition, 1.0), ClipPlanes[0]); #ifdef USE_ATTR - pass_attr(pos); + pass_attr(pos); #endif } |