This repository has been archived on 2023-10-09. You can view files and clone it, but cannot push or open issues or pull requests.
Files
blender-archive/source/blender/gpu/shaders/gpu_shader_simple_lighting_frag.glsl

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

20 lines
395 B
GLSL
Raw Normal View History

#ifndef USE_GPU_SHADER_CREATE_INFO
# ifndef USE_INSTANCE_COLOR
uniform vec4 color;
# endif
uniform vec3 light;
2017-05-17 10:46:42 +10:00
in vec3 normal;
# ifdef USE_INSTANCE_COLOR
2017-05-17 10:46:42 +10:00
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);
}