Expose outFragCoord

This commit is contained in:
Richard Davey 2020-11-06 17:22:17 +00:00
parent abe97b18fd
commit 88809647a6
2 changed files with 4 additions and 0 deletions

View file

@ -8,12 +8,14 @@ module.exports = [
'attribute vec2 inPosition;', 'attribute vec2 inPosition;',
'attribute vec2 inTexCoord;', 'attribute vec2 inTexCoord;',
'', '',
'varying vec2 outFragCoord;',
'varying vec2 outTexCoord;', 'varying vec2 outTexCoord;',
'', '',
'void main ()', 'void main ()',
'{', '{',
' gl_Position = uProjectionMatrix * vec4(inPosition, 1.0, 1.0);', ' gl_Position = uProjectionMatrix * vec4(inPosition, 1.0, 1.0);',
'', '',
' outFragCoord = inPosition;',
' outTexCoord = inTexCoord;', ' outTexCoord = inTexCoord;',
'}', '}',
'' ''

View file

@ -7,11 +7,13 @@ uniform mat4 uProjectionMatrix;
attribute vec2 inPosition; attribute vec2 inPosition;
attribute vec2 inTexCoord; attribute vec2 inTexCoord;
varying vec2 outFragCoord;
varying vec2 outTexCoord; varying vec2 outTexCoord;
void main () void main ()
{ {
gl_Position = uProjectionMatrix * vec4(inPosition, 1.0, 1.0); gl_Position = uProjectionMatrix * vec4(inPosition, 1.0, 1.0);
outFragCoord = inPosition;
outTexCoord = inTexCoord; outTexCoord = inTexCoord;
} }