Added position as out variable from vertex shader.

Adding the position out form vertex shader makes us skip computation of position in the fragment shader based on gl_FragCoord.
This commit is contained in:
Magnus 2018-12-11 09:24:17 +01:00 committed by GitHub
parent 7b509e1d7d
commit c18b8f1c29
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

View File

@ -226,6 +226,7 @@ in float aIntensity;
out vec4 vColor;
out vec2 vTexCoords;
out float vIntensity;
out vec2 vPosition;
uniform mat3 uTransform;
uniform vec4 uBounds;
@ -235,6 +236,7 @@ void main() {
vec2 normPos = (transPos - uBounds.xy) / uBounds.zw * 2 - vec2(1, 1);
gl_Position = vec4(normPos, 0.0, 1.0);
vColor = aColor;
vPosition = aPosition;
vTexCoords = aTexCoords;
vIntensity = aIntensity;
}