From 88809647a69e2694ade90070c73d70b2fe74afc1 Mon Sep 17 00:00:00 2001 From: Richard Davey Date: Fri, 6 Nov 2020 17:22:17 +0000 Subject: [PATCH] Expose outFragCoord --- src/renderer/webgl/shaders/PostFX-vert.js | 2 ++ src/renderer/webgl/shaders/src/PostFX.vert | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/renderer/webgl/shaders/PostFX-vert.js b/src/renderer/webgl/shaders/PostFX-vert.js index 94145dfca..f90661c41 100644 --- a/src/renderer/webgl/shaders/PostFX-vert.js +++ b/src/renderer/webgl/shaders/PostFX-vert.js @@ -8,12 +8,14 @@ module.exports = [ 'attribute vec2 inPosition;', 'attribute vec2 inTexCoord;', '', + 'varying vec2 outFragCoord;', 'varying vec2 outTexCoord;', '', 'void main ()', '{', ' gl_Position = uProjectionMatrix * vec4(inPosition, 1.0, 1.0);', '', + ' outFragCoord = inPosition;', ' outTexCoord = inTexCoord;', '}', '' diff --git a/src/renderer/webgl/shaders/src/PostFX.vert b/src/renderer/webgl/shaders/src/PostFX.vert index 2a4c4c860..a093e17d4 100644 --- a/src/renderer/webgl/shaders/src/PostFX.vert +++ b/src/renderer/webgl/shaders/src/PostFX.vert @@ -7,11 +7,13 @@ uniform mat4 uProjectionMatrix; attribute vec2 inPosition; attribute vec2 inTexCoord; +varying vec2 outFragCoord; varying vec2 outTexCoord; void main () { gl_Position = uProjectionMatrix * vec4(inPosition, 1.0, 1.0); + outFragCoord = inPosition; outTexCoord = inTexCoord; }