Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gpu_shader_simple_lighting_frag.glsl « shaders « gpu « blender « source - git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 6725bc8284131b90c969ab203ab2047e4931a995 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#ifndef USE_GPU_SHADER_CREATE_INFO
#  ifndef USE_INSTANCE_COLOR
uniform vec4 color;
#  endif
uniform vec3 light;

in vec3 normal;
#  ifdef USE_INSTANCE_COLOR
flat in vec4 finalColor;
#    define color finalColor
#  endif
out vec4 fragColor;
#endif

void main()
{
  fragColor = simple_lighting_data.color;
  fragColor.xyz *= clamp(dot(normalize(normal), simple_lighting_data.light), 0.0, 1.0);
}