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:
Diffstat (limited to 'source/blender/gpu/shaders/gpu_shader_2D_line_dashed_frag.glsl')
-rw-r--r--source/blender/gpu/shaders/gpu_shader_2D_line_dashed_frag.glsl62
1 files changed, 31 insertions, 31 deletions
diff --git a/source/blender/gpu/shaders/gpu_shader_2D_line_dashed_frag.glsl b/source/blender/gpu/shaders/gpu_shader_2D_line_dashed_frag.glsl
index 3c5b0d1ca0a..185a4c8c59f 100644
--- a/source/blender/gpu/shaders/gpu_shader_2D_line_dashed_frag.glsl
+++ b/source/blender/gpu/shaders/gpu_shader_2D_line_dashed_frag.glsl
@@ -8,11 +8,11 @@
uniform float dash_width;
/* Simple mode, discarding non-dash parts (so no need for blending at all). */
-uniform float dash_factor; /* if > 1.0, solid line. */
+uniform float dash_factor; /* if > 1.0, solid line. */
/* More advanced mode, allowing for complex, multi-colored patterns. Enabled when colors_len > 0. */
/* Note: max number of steps/colors in pattern is 32! */
-uniform int colors_len; /* Enabled if > 0, 1 for solid line. */
+uniform int colors_len; /* Enabled if > 0, 1 for solid line. */
uniform vec4 colors[32];
noperspective in float distance_along_line;
@@ -22,33 +22,33 @@ out vec4 fragColor;
void main()
{
- /* Multi-color option. */
- if (colors_len > 0) {
- /* Solid line case, simple. */
- if (colors_len == 1) {
- fragColor = colors[0];
- }
- /* Actually dashed line... */
- else {
- float normalized_distance = fract(distance_along_line / dash_width);
- fragColor = colors[int(normalized_distance * colors_len)];
- }
- }
- /* Single color option. */
- else {
- /* Solid line case, simple. */
- if (dash_factor >= 1.0f) {
- fragColor = color_geom;
- }
- /* Actually dashed line... */
- else {
- float normalized_distance = fract(distance_along_line / dash_width);
- if (normalized_distance <= dash_factor) {
- fragColor = color_geom;
- }
- else {
- discard;
- }
- }
- }
+ /* Multi-color option. */
+ if (colors_len > 0) {
+ /* Solid line case, simple. */
+ if (colors_len == 1) {
+ fragColor = colors[0];
+ }
+ /* Actually dashed line... */
+ else {
+ float normalized_distance = fract(distance_along_line / dash_width);
+ fragColor = colors[int(normalized_distance * colors_len)];
+ }
+ }
+ /* Single color option. */
+ else {
+ /* Solid line case, simple. */
+ if (dash_factor >= 1.0f) {
+ fragColor = color_geom;
+ }
+ /* Actually dashed line... */
+ else {
+ float normalized_distance = fract(distance_along_line / dash_width);
+ if (normalized_distance <= dash_factor) {
+ fragColor = color_geom;
+ }
+ else {
+ discard;
+ }
+ }
+ }
}