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:
authorClément Foucault <foucault.clem@gmail.com>2022-05-02 00:47:26 +0300
committerClément Foucault <foucault.clem@gmail.com>2022-05-02 00:54:41 +0300
commit2a7a01b339ad60aec5ffe265411fa2f0b1589137 (patch)
tree6b472e21edc425d2ceb21c378d248c19bbd558e5 /source/blender/gpu/shaders/gpu_shader_3D_polyline_frag.glsl
parentaa34706aacdab45847d7c0e3987b1de4ff0b8760 (diff)
GPUShader: Port polyline shaders to use shaderCreateInfo
This should have no functional changes.
Diffstat (limited to 'source/blender/gpu/shaders/gpu_shader_3D_polyline_frag.glsl')
-rw-r--r--source/blender/gpu/shaders/gpu_shader_3D_polyline_frag.glsl21
1 files changed, 4 insertions, 17 deletions
diff --git a/source/blender/gpu/shaders/gpu_shader_3D_polyline_frag.glsl b/source/blender/gpu/shaders/gpu_shader_3D_polyline_frag.glsl
index 8687763f4c1..27740c8d71b 100644
--- a/source/blender/gpu/shaders/gpu_shader_3D_polyline_frag.glsl
+++ b/source/blender/gpu/shaders/gpu_shader_3D_polyline_frag.glsl
@@ -1,28 +1,15 @@
-#ifndef USE_GPU_SHADER_CREATE_INFO
-uniform float lineWidth;
-uniform bool lineSmooth = true;
-
-in vec4 finalColor;
-noperspective in float smoothline;
-# ifdef CLIP
-in float clip;
-# endif
-
-out vec4 fragColor;
-#endif
-
-#define SMOOTH_WIDTH 1.0
+#pragma BLENDER_REQUIRE(gpu_shader_colorspace_lib.glsl)
void main()
{
#ifdef CLIP
- if (clip < 0.0) {
+ if (interp.clip < 0.0) {
discard;
}
#endif
- fragColor = finalColor;
+ fragColor = interp.color;
if (lineSmooth) {
- fragColor.a *= clamp((lineWidth + SMOOTH_WIDTH) * 0.5 - abs(smoothline), 0.0, 1.0);
+ fragColor.a *= clamp((lineWidth + SMOOTH_WIDTH) * 0.5 - abs(interp.smoothline), 0.0, 1.0);
}
fragColor = blender_srgb_to_framebuffer_space(fragColor);
}