diff --git a/CHANGELOG.md b/CHANGELOG.md index af490cd0b..ce63e713a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ ### Updates * `Zones` will now use the new `customHitArea` property introduced in 3.17 to avoid their hit areas from being resized if you specified your own custom hit area (thanks @rexrainbow) +* The default `BaseShader` vertex shader will now set the `fragCoord` varying to be the viewport height minus the y inPosition. This will give the correct y axis in the fragment shader, causing 'inverted' shaders to display normally when using the default vertex code. ### Bug Fixes diff --git a/src/display/shader/BaseShader.js b/src/display/shader/BaseShader.js index 70016ba28..4458911d7 100644 --- a/src/display/shader/BaseShader.js +++ b/src/display/shader/BaseShader.js @@ -68,7 +68,7 @@ var BaseShader = new Class({ 'void main () {', 'gl_Position = uProjectionMatrix * uViewMatrix * vec4(inPosition, 1.0, 1.0);', - 'fragCoord = inPosition;', + 'fragCoord = vec2(inPosition.x, uViewMatrix[2][0] - inPosition.y);', '}' ].join('\n'); }