#version 410 in float partSlot; in vec2 xy; in vec2 uv; in vec2 textureUv; out vec2 uvV; out vec2 textureUvV; out float alphaV; out vec4 colorV; out vec4 highlightColorV; uniform vec2 meScreenSize; uniform sampler2D partValues; uniform float partIndex_translate; // vec4 as x, y, z, scale uniform float partIndex_color; // vec4 as x, y, z, scale uniform float partIndex_highlightColor; // vec4 as x, y, z, scale void main(void) { vec4 partTranslate = texture(partValues, vec2(partIndex_translate, partSlot)); vec4 pos = vec4(xy.x, xy.y, partTranslate.z, 1.0); pos.xy += partTranslate.xy; pos.xy /= meScreenSize; pos.xy = pos.xy * 2.0 - vec2(1.0, 1.0); // convert from [0,1] to [-1,+1] pos.y = -pos.y; gl_Position = pos; uvV = uv; textureUvV = textureUv; colorV = texture(partValues, vec2(partIndex_color, partSlot)); highlightColorV = texture(partValues, vec2(partIndex_highlightColor, partSlot)); }