#version 410 in vec2 xy; in vec2 uv; // part attrs in float partSlot; uniform sampler2D partValues; uniform float partIndex_color; // part transform, in four columns uniform float partIndex_colorA; uniform float partIndex_colorB; uniform float partIndex_shape; // xyzw-> radiusLow, radiusHigh, alpha, currentValue out vec2 uvV; // per-part settings out vec4 colorA; out vec4 colorB; out float radiusLow; out float radiusHigh; out float alpha; out float currentValue; void main(void) { // Draw against the very back of the visible cube. float z = 0.999999; vec4 pos = vec4(xy.x, xy.y, z, 1.0); gl_Position = pos; // pass uv right through uvV = uv; // pass the part values through, too colorA = texture(partValues, vec2(partIndex_colorA, partSlot)); colorB = texture(partValues, vec2(partIndex_colorB, partSlot)); vec4 shape = texture(partValues, vec2(partIndex_shape, partSlot)); radiusLow = shape.x; radiusHigh = shape.y; alpha = shape.z; currentValue = shape.w; }