realityplayground-of/zoneb/bin/data/shaders/particles/draw.vert
2020-11-01 19:19:56 +01:00

33 lines
843 B
GLSL
Executable file

uniform mat4 modelViewProjectionMatrix;
uniform mat4 modelViewMatrix;
uniform sampler2DRect particles0;
uniform sampler2DRect particles1;
uniform sampler2DRect particles2;
uniform sampler2DRect particles3;
uniform sampler2DRect particles4; // prev
uniform sampler2DRect particles5; // org
uniform int uEnergy;
in vec4 position;
in vec2 texcoord;
out vec2 vTexCoord;
out vec3 vPos;
out vec4 vTarget;
out float vTemperature;
out float vAge;
out vec4 vPosition;
out vec4 vPrevPosition;
void main()
{
vTexCoord = texcoord;
vec4 misc = texture(particles2, vTexCoord);
vec4 vTarget = texture(particles3, vTexCoord);
vTemperature = misc.x;
vAge = misc.y;
vPos = texture(particles0, vTexCoord).xyz;
vPosition = modelViewMatrix * vec4(vPos, 1.0);
vPrevPosition = modelViewMatrix * vec4(texture(particles4, vTexCoord).xyz, 1.0);
}