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_grid_display_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/lightprobe_grid_display_vert.glsl')
-rw-r--r-- | source/blender/draw/engines/eevee/shaders/lightprobe_grid_display_vert.glsl | 48 |
1 files changed, 22 insertions, 26 deletions
diff --git a/source/blender/draw/engines/eevee/shaders/lightprobe_grid_display_vert.glsl b/source/blender/draw/engines/eevee/shaders/lightprobe_grid_display_vert.glsl index 7a92b55e530..4e500db827e 100644 --- a/source/blender/draw/engines/eevee/shaders/lightprobe_grid_display_vert.glsl +++ b/source/blender/draw/engines/eevee/shaders/lightprobe_grid_display_vert.glsl @@ -11,39 +11,35 @@ uniform vec3 screen_vecs[2]; flat out int cellOffset; out vec2 quadCoord; -const vec2 pos[6] = vec2[6]( - vec2(-1.0, -1.0), - vec2( 1.0, -1.0), - vec2(-1.0, 1.0), +const vec2 pos[6] = vec2[6](vec2(-1.0, -1.0), + vec2(1.0, -1.0), + vec2(-1.0, 1.0), - vec2( 1.0, -1.0), - vec2( 1.0, 1.0), - vec2(-1.0, 1.0) -); + vec2(1.0, -1.0), + vec2(1.0, 1.0), + vec2(-1.0, 1.0)); void main() { - int cell_id = gl_VertexID / 6; - int vert_id = gl_VertexID % 6; + int cell_id = gl_VertexID / 6; + int vert_id = gl_VertexID % 6; - vec3 ls_cell_location; - /* Keep in sync with update_irradiance_probe */ - ls_cell_location.z = float(cell_id % grid_resolution.z); - ls_cell_location.y = float((cell_id / grid_resolution.z) % grid_resolution.y); - ls_cell_location.x = float(cell_id / (grid_resolution.z * grid_resolution.y)); + vec3 ls_cell_location; + /* Keep in sync with update_irradiance_probe */ + ls_cell_location.z = float(cell_id % grid_resolution.z); + ls_cell_location.y = float((cell_id / grid_resolution.z) % grid_resolution.y); + ls_cell_location.x = float(cell_id / (grid_resolution.z * grid_resolution.y)); - cellOffset = offset + cell_id; + cellOffset = offset + cell_id; - vec3 ws_cell_location = corner + - (increment_x * ls_cell_location.x + - increment_y * ls_cell_location.y + - increment_z * ls_cell_location.z); + vec3 ws_cell_location = corner + + (increment_x * ls_cell_location.x + increment_y * ls_cell_location.y + + increment_z * ls_cell_location.z); + quadCoord = pos[vert_id]; + vec3 screen_pos = screen_vecs[0] * quadCoord.x + screen_vecs[1] * quadCoord.y; + ws_cell_location += screen_pos * sphere_size; - quadCoord = pos[vert_id]; - vec3 screen_pos = screen_vecs[0] * quadCoord.x + screen_vecs[1] * quadCoord.y; - ws_cell_location += screen_pos * sphere_size; - - gl_Position = ViewProjectionMatrix * vec4(ws_cell_location , 1.0); - gl_Position.z += 0.0001; /* Small bias to let the icon draw without zfighting */ + gl_Position = ViewProjectionMatrix * vec4(ws_cell_location, 1.0); + gl_Position.z += 0.0001; /* Small bias to let the icon draw without zfighting */ } |