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:
authorJeroen Bakker <jeroen@blender.org>2022-01-17 16:45:22 +0300
committerJeroen Bakker <jeroen@blender.org>2022-01-17 16:46:32 +0300
commit9d3f35a0bf1bf5776363bfd61d53a7c85b5827a4 (patch)
tree595fe492f09aea9f97049339385f7966ac02f0e1 /source/blender/gpu/shaders/gpu_shader_gpencil_stroke_vert.glsl
parentedee5a947b7ea3e1324aa334a22c7c9bbf47f5f7 (diff)
Revert "Revert "GPUShaderCreateInfo for interface abstraction""
This reverts commit edee5a947b7ea3e1324aa334a22c7c9bbf47f5f7. Fixes compilation error (Missing file BLI_float2.hh)
Diffstat (limited to 'source/blender/gpu/shaders/gpu_shader_gpencil_stroke_vert.glsl')
-rw-r--r--source/blender/gpu/shaders/gpu_shader_gpencil_stroke_vert.glsl14
1 files changed, 7 insertions, 7 deletions
diff --git a/source/blender/gpu/shaders/gpu_shader_gpencil_stroke_vert.glsl b/source/blender/gpu/shaders/gpu_shader_gpencil_stroke_vert.glsl
index 07b4ae52110..16e12b2989e 100644
--- a/source/blender/gpu/shaders/gpu_shader_gpencil_stroke_vert.glsl
+++ b/source/blender/gpu/shaders/gpu_shader_gpencil_stroke_vert.glsl
@@ -1,3 +1,4 @@
+#ifndef USE_GPU_SHADER_CREATE_INFO
uniform mat4 ModelViewProjectionMatrix;
uniform mat4 ProjectionMatrix;
@@ -12,22 +13,21 @@ in float thickness;
out vec4 finalColor;
out float finalThickness;
+#endif
-#define TRUE 1
-
-float defaultpixsize = pixsize * (1000.0 / pixfactor);
+float defaultpixsize = gpencil_stroke_data.pixsize * (1000.0 / gpencil_stroke_data.pixfactor);
void main(void)
{
gl_Position = ModelViewProjectionMatrix * vec4(pos, 1.0);
- finalColor = color;
+ geometry_in.finalColor = color;
- if (keep_size == TRUE) {
- finalThickness = thickness;
+ if (gpencil_stroke_data.keep_size) {
+ geometry_in.finalThickness = thickness;
}
else {
float size = (ProjectionMatrix[3][3] == 0.0) ? (thickness / (gl_Position.z * defaultpixsize)) :
(thickness / defaultpixsize);
- finalThickness = max(size * objscale, 1.0);
+ geometry_in.finalThickness = max(size * gpencil_stroke_data.objscale, 1.0);
}
}