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_selection_id_frag.glsl
Clément Foucault 9d19ff9076 GPUShader: Add selection id shader
This is to separate id drawing from standard color drawing.
2019-01-11 16:00:23 +01:00

22 lines
360 B
GLSL

#ifdef UNIFORM_ID
uniform uint id;
#else
flat in vec4 id;
#endif
out vec4 fragColor;
void main()
{
#ifdef UNIFORM_ID
fragColor = vec4(
((id ) & uint(0xFF)) * (1.0f / 255.0f),
((id >> 8) & uint(0xFF)) * (1.0f / 255.0f),
((id >> 16) & uint(0xFF)) * (1.0f / 255.0f),
((id >> 24) ) * (1.0f / 255.0f));
#else
fragColor = id;
#endif
}