#version 410 in float partSlot; in vec2 xy; in vec2 uv; out vec2 uvV; out float alphaV; out vec4 colorV; out float waveformYV; uniform sampler2D partValues; uniform float partIndex_translate; // vec4 as x, y, z uniform float partIndex_color; // vec4 as r, g, b uniform float partIndex_waveformCoordinate; // vec4 as waveform.y uniform vec2 meScreenSize; void main(void) { vec4 partTranslate = texture(partValues, vec2(partIndex_translate, partSlot)); colorV = texture(partValues, vec2(partIndex_color, partSlot)); vec4 waveformCoordinate4 = texture(partValues, vec2(partIndex_waveformCoordinate, 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; colorV.a = 1.0; waveformYV = waveformCoordinate4[0]; }