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/volumetric_frag.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/volumetric_frag.glsl')
-rw-r--r-- | source/blender/draw/engines/eevee/shaders/volumetric_frag.glsl | 45 |
1 files changed, 23 insertions, 22 deletions
diff --git a/source/blender/draw/engines/eevee/shaders/volumetric_frag.glsl b/source/blender/draw/engines/eevee/shaders/volumetric_frag.glsl index 3a293647f84..0164a04c64b 100644 --- a/source/blender/draw/engines/eevee/shaders/volumetric_frag.glsl +++ b/source/blender/draw/engines/eevee/shaders/volumetric_frag.glsl @@ -29,35 +29,36 @@ layout(location = 3) out vec4 volumePhase; void main() { - ivec3 volume_cell = ivec3(gl_FragCoord.xy, slice); - vec3 ndc_cell = volume_to_ndc((vec3(volume_cell) + volJitter.xyz) * volInvTexSize.xyz); + ivec3 volume_cell = ivec3(gl_FragCoord.xy, slice); + vec3 ndc_cell = volume_to_ndc((vec3(volume_cell) + volJitter.xyz) * volInvTexSize.xyz); - viewPosition = get_view_space_from_depth(ndc_cell.xy, ndc_cell.z); - worldPosition = transform_point(ViewMatrixInverse, viewPosition); + viewPosition = get_view_space_from_depth(ndc_cell.xy, ndc_cell.z); + worldPosition = transform_point(ViewMatrixInverse, viewPosition); #ifdef MESH_SHADER - volumeObjectLocalCoord = transform_point(volumeObjectMatrix, worldPosition); - volumeObjectLocalCoord = (volumeObjectLocalCoord - volumeOrcoLoc + volumeOrcoSize) / (volumeOrcoSize * 2.0); + volumeObjectLocalCoord = transform_point(volumeObjectMatrix, worldPosition); + volumeObjectLocalCoord = (volumeObjectLocalCoord - volumeOrcoLoc + volumeOrcoSize) / + (volumeOrcoSize * 2.0); - if (any(lessThan(volumeObjectLocalCoord, vec3(0.0))) || - any(greaterThan(volumeObjectLocalCoord, vec3(1.0)))) - discard; + if (any(lessThan(volumeObjectLocalCoord, vec3(0.0))) || + any(greaterThan(volumeObjectLocalCoord, vec3(1.0)))) + discard; #endif #ifdef CLEAR - Closure cl = CLOSURE_DEFAULT; + Closure cl = CLOSURE_DEFAULT; #else - Closure cl = nodetree_exec(); + Closure cl = nodetree_exec(); #endif - volumeScattering = vec4(cl.scatter, 1.0); - volumeExtinction = vec4(max(vec3(1e-4), cl.absorption + cl.scatter), 1.0); - volumeEmissive = vec4(cl.emission, 1.0); - - /* Do not add phase weight if no scattering. */ - if (all(equal(cl.scatter, vec3(0.0)))) { - volumePhase = vec4(0.0); - } - else { - volumePhase = vec4(cl.anisotropy, vec3(1.0)); - } + volumeScattering = vec4(cl.scatter, 1.0); + volumeExtinction = vec4(max(vec3(1e-4), cl.absorption + cl.scatter), 1.0); + volumeEmissive = vec4(cl.emission, 1.0); + + /* Do not add phase weight if no scattering. */ + if (all(equal(cl.scatter, vec3(0.0)))) { + volumePhase = vec4(0.0); + } + else { + volumePhase = vec4(cl.anisotropy, vec3(1.0)); + } } |