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

22 lines
344 B
GLSL
Raw Normal View History

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