Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2019-04-17 07:17:24 +0300
committerCampbell Barton <ideasman42@gmail.com>2019-04-17 07:21:24 +0300
commite12c08e8d170b7ca40f204a5b0423c23a9fbc2c1 (patch)
tree8cf3453d12edb177a218ef8009357518ec6cab6a /source/blender/draw/engines/eevee/shaders/octahedron_lib.glsl
parentb3dabc200a4b0399ec6b81f2ff2730d07b44fcaa (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/octahedron_lib.glsl')
-rw-r--r--source/blender/draw/engines/eevee/shaders/octahedron_lib.glsl36
1 files changed, 18 insertions, 18 deletions
diff --git a/source/blender/draw/engines/eevee/shaders/octahedron_lib.glsl b/source/blender/draw/engines/eevee/shaders/octahedron_lib.glsl
index dfd8fa8a56c..bfb6bc890ec 100644
--- a/source/blender/draw/engines/eevee/shaders/octahedron_lib.glsl
+++ b/source/blender/draw/engines/eevee/shaders/octahedron_lib.glsl
@@ -1,38 +1,38 @@
vec2 mapping_octahedron(vec3 cubevec, vec2 texel_size)
{
- /* projection onto octahedron */
- cubevec /= dot(vec3(1.0), abs(cubevec));
+ /* projection onto octahedron */
+ cubevec /= dot(vec3(1.0), abs(cubevec));
- /* out-folding of the downward faces */
- if (cubevec.z < 0.0) {
- vec2 cubevec_sign = step(0.0, cubevec.xy) * 2.0 - 1.0;
- cubevec.xy = (1.0 - abs(cubevec.yx)) * cubevec_sign;
- }
+ /* out-folding of the downward faces */
+ if (cubevec.z < 0.0) {
+ vec2 cubevec_sign = step(0.0, cubevec.xy) * 2.0 - 1.0;
+ cubevec.xy = (1.0 - abs(cubevec.yx)) * cubevec_sign;
+ }
- /* mapping to [0;1]ˆ2 texture space */
- vec2 uvs = cubevec.xy * (0.5) + 0.5;
+ /* mapping to [0;1]ˆ2 texture space */
+ vec2 uvs = cubevec.xy * (0.5) + 0.5;
- /* edge filtering fix */
- uvs = (1.0 - 2.0 * texel_size) * uvs + texel_size;
+ /* edge filtering fix */
+ uvs = (1.0 - 2.0 * texel_size) * uvs + texel_size;
- return uvs;
+ return uvs;
}
vec4 textureLod_octahedron(sampler2DArray tex, vec4 cubevec, float lod, float lod_max)
{
- vec2 texelSize = 1.0 / vec2(textureSize(tex, int(lod_max)));
+ vec2 texelSize = 1.0 / vec2(textureSize(tex, int(lod_max)));
- vec2 uvs = mapping_octahedron(cubevec.xyz, texelSize);
+ vec2 uvs = mapping_octahedron(cubevec.xyz, texelSize);
- return textureLod(tex, vec3(uvs, cubevec.w), lod);
+ return textureLod(tex, vec3(uvs, cubevec.w), lod);
}
vec4 texture_octahedron(sampler2DArray tex, vec4 cubevec)
{
- vec2 texelSize = 1.0 / vec2(textureSize(tex, 0));
+ vec2 texelSize = 1.0 / vec2(textureSize(tex, 0));
- vec2 uvs = mapping_octahedron(cubevec.xyz, texelSize);
+ vec2 uvs = mapping_octahedron(cubevec.xyz, texelSize);
- return texture(tex, vec3(uvs, cubevec.w));
+ return texture(tex, vec3(uvs, cubevec.w));
}