This repository has been archived on 2023-10-09. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
blender-archive/source/blender/gpu/shaders/gpu_shader_selection_id_frag.glsl
Germano Cavalcante c94b3b19a2 Fix T61373: Crash when selecting the edit mode
Some GPUs complain about `error C7011: implicit cast from "int" to "uint"` even if the cast is explicit.
2019-02-18 11:35:17 -03:00

22 lines
344 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 ) & 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
}