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_simple_lighting_frag.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_simple_lighting_frag.glsl')
-rw-r--r--source/blender/gpu/shaders/gpu_shader_simple_lighting_frag.glsl17
1 files changed, 9 insertions, 8 deletions
diff --git a/source/blender/gpu/shaders/gpu_shader_simple_lighting_frag.glsl b/source/blender/gpu/shaders/gpu_shader_simple_lighting_frag.glsl
index 6bce517fee3..6725bc82841 100644
--- a/source/blender/gpu/shaders/gpu_shader_simple_lighting_frag.glsl
+++ b/source/blender/gpu/shaders/gpu_shader_simple_lighting_frag.glsl
@@ -1,18 +1,19 @@
-
-#ifndef USE_INSTANCE_COLOR
+#ifndef USE_GPU_SHADER_CREATE_INFO
+# ifndef USE_INSTANCE_COLOR
uniform vec4 color;
-#endif
+# endif
uniform vec3 light;
in vec3 normal;
-#ifdef USE_INSTANCE_COLOR
+# ifdef USE_INSTANCE_COLOR
flat in vec4 finalColor;
-# define color finalColor
-#endif
+# define color finalColor
+# endif
out vec4 fragColor;
+#endif
void main()
{
- fragColor = color;
- fragColor.xyz *= clamp(dot(normalize(normal), light), 0.0, 1.0);
+ fragColor = simple_lighting_data.color;
+ fragColor.xyz *= clamp(dot(normalize(normal), simple_lighting_data.light), 0.0, 1.0);
}