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/modes/shaders/object_particle_dot_frag.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/modes/shaders/object_particle_dot_frag.glsl')
-rw-r--r--source/blender/draw/modes/shaders/object_particle_dot_frag.glsl83
1 files changed, 42 insertions, 41 deletions
diff --git a/source/blender/draw/modes/shaders/object_particle_dot_frag.glsl b/source/blender/draw/modes/shaders/object_particle_dot_frag.glsl
index e8bf7884701..d15580056b0 100644
--- a/source/blender/draw/modes/shaders/object_particle_dot_frag.glsl
+++ b/source/blender/draw/modes/shaders/object_particle_dot_frag.glsl
@@ -8,45 +8,46 @@ flat in float finalVal;
out vec4 fragColor;
-void main() {
- float dist = length(gl_PointCoord - vec2(0.5));
-
-// transparent outside of point
-// --- 0 ---
-// smooth transition
-// --- 1 ---
-// pure outline color
-// --- 2 ---
-// smooth transition
-// --- 3 ---
-// pure point color
-// ...
-// dist = 0 at center of point
-
- float midStroke = 0.5 * (radii[1] + radii[2]);
-
- if (dist > midStroke) {
- if (finalVal < 0.0) {
- fragColor.rgb = outlineColor;
- }
- else {
- fragColor.rgb = texture(ramp, finalVal).rgb;
- }
-
- fragColor.a = mix(1.0, 0.0, smoothstep(radii[1], radii[0], dist));
- }
- else {
- if (finalVal < 0.0) {
- fragColor.rgb = mix(color, outlineColor, smoothstep(radii[3], radii[2], dist));
- }
- else {
- fragColor.rgb = texture(ramp, finalVal).rgb;
- }
-
- fragColor.a = 1.0;
- }
-
- if (fragColor.a == 0.0) {
- discard;
- }
+void main()
+{
+ float dist = length(gl_PointCoord - vec2(0.5));
+
+ // transparent outside of point
+ // --- 0 ---
+ // smooth transition
+ // --- 1 ---
+ // pure outline color
+ // --- 2 ---
+ // smooth transition
+ // --- 3 ---
+ // pure point color
+ // ...
+ // dist = 0 at center of point
+
+ float midStroke = 0.5 * (radii[1] + radii[2]);
+
+ if (dist > midStroke) {
+ if (finalVal < 0.0) {
+ fragColor.rgb = outlineColor;
+ }
+ else {
+ fragColor.rgb = texture(ramp, finalVal).rgb;
+ }
+
+ fragColor.a = mix(1.0, 0.0, smoothstep(radii[1], radii[0], dist));
+ }
+ else {
+ if (finalVal < 0.0) {
+ fragColor.rgb = mix(color, outlineColor, smoothstep(radii[3], radii[2], dist));
+ }
+ else {
+ fragColor.rgb = texture(ramp, finalVal).rgb;
+ }
+
+ fragColor.a = 1.0;
+ }
+
+ if (fragColor.a == 0.0) {
+ discard;
+ }
}