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/lightprobe_geom.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/lightprobe_geom.glsl')
-rw-r--r-- | source/blender/draw/engines/eevee/shaders/lightprobe_geom.glsl | 54 |
1 files changed, 35 insertions, 19 deletions
diff --git a/source/blender/draw/engines/eevee/shaders/lightprobe_geom.glsl b/source/blender/draw/engines/eevee/shaders/lightprobe_geom.glsl index 996b507239d..e10cb5f4999 100644 --- a/source/blender/draw/engines/eevee/shaders/lightprobe_geom.glsl +++ b/source/blender/draw/engines/eevee/shaders/lightprobe_geom.glsl @@ -1,6 +1,6 @@ layout(triangles) in; -layout(triangle_strip, max_vertices=3) out; +layout(triangle_strip, max_vertices = 3) out; uniform int Layer; @@ -10,25 +10,41 @@ flat out int fFace; out vec3 worldPosition; out vec3 viewPosition; /* Required. otherwise generate linking error. */ -out vec3 worldNormal; /* Required. otherwise generate linking error. */ -out vec3 viewNormal; /* Required. otherwise generate linking error. */ - -const vec3 maj_axes[6] = vec3[6](vec3(1.0, 0.0, 0.0), vec3(-1.0, 0.0, 0.0), vec3(0.0, 1.0, 0.0), vec3(0.0, -1.0, 0.0), vec3( 0.0, 0.0, 1.0), vec3( 0.0, 0.0, -1.0)); -const vec3 x_axis[6] = vec3[6](vec3(0.0, 0.0, -1.0), vec3( 0.0, 0.0, 1.0), vec3(1.0, 0.0, 0.0), vec3(1.0, 0.0, 0.0), vec3( 1.0, 0.0, 0.0), vec3(-1.0, 0.0, 0.0)); -const vec3 y_axis[6] = vec3[6](vec3(0.0, -1.0, 0.0), vec3( 0.0, -1.0, 0.0), vec3(0.0, 0.0, 1.0), vec3(0.0, 0.0, -1.0), vec3( 0.0, -1.0, 0.0), vec3( 0.0, -1.0, 0.0)); - -void main() { - fFace = face[0]; - gl_Layer = Layer + fFace; - - for (int v = 0; v < 3; ++v) { - gl_Position = vPos[v]; - worldPosition = x_axis[fFace] * vPos[v].x + y_axis[fFace] * vPos[v].y + maj_axes[fFace]; +out vec3 worldNormal; /* Required. otherwise generate linking error. */ +out vec3 viewNormal; /* Required. otherwise generate linking error. */ + +const vec3 maj_axes[6] = vec3[6](vec3(1.0, 0.0, 0.0), + vec3(-1.0, 0.0, 0.0), + vec3(0.0, 1.0, 0.0), + vec3(0.0, -1.0, 0.0), + vec3(0.0, 0.0, 1.0), + vec3(0.0, 0.0, -1.0)); +const vec3 x_axis[6] = vec3[6](vec3(0.0, 0.0, -1.0), + vec3(0.0, 0.0, 1.0), + vec3(1.0, 0.0, 0.0), + vec3(1.0, 0.0, 0.0), + vec3(1.0, 0.0, 0.0), + vec3(-1.0, 0.0, 0.0)); +const vec3 y_axis[6] = vec3[6](vec3(0.0, -1.0, 0.0), + vec3(0.0, -1.0, 0.0), + vec3(0.0, 0.0, 1.0), + vec3(0.0, 0.0, -1.0), + vec3(0.0, -1.0, 0.0), + vec3(0.0, -1.0, 0.0)); + +void main() +{ + fFace = face[0]; + gl_Layer = Layer + fFace; + + for (int v = 0; v < 3; ++v) { + gl_Position = vPos[v]; + worldPosition = x_axis[fFace] * vPos[v].x + y_axis[fFace] * vPos[v].y + maj_axes[fFace]; #ifdef USE_ATTR - pass_attr(v); + pass_attr(v); #endif - EmitVertex(); - } + EmitVertex(); + } - EndPrimitive(); + EndPrimitive(); } |