Skip to content

Commit 53180cc

Browse files
committed
Updated shaders
1 parent 724310f commit 53180cc

3 files changed

Lines changed: 8 additions & 7 deletions

File tree

src/renderer/webgl/shaders/Copy-frag.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ module.exports = [
1010
'',
1111
'void main ()',
1212
'{',
13+
' // gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);',
14+
'',
1315
' gl_FragColor = texture2D(uMainSampler, outTexCoord) * uBrightness;',
1416
'}',
1517
''

src/renderer/webgl/shaders/Quad-vert.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,10 @@ module.exports = [
1313
'',
1414
'void main ()',
1515
'{',
16-
' gl_Position = uProjectionMatrix * vec4(inPosition, 1.0, 1.0);',
16+
' // gl_Position = uProjectionMatrix * vec4(inPosition, 1.0, 1.0);',
17+
' gl_Position = vec4(inPosition, 0, 1);',
1718
'',
18-
' outFragCoord = gl_Position.xy * 0.5 + 0.5;',
19+
' outFragCoord = inPosition.xy * 0.5 + 0.5;',
1920
' outTexCoord = inTexCoord;',
2021
'}',
2122
''

src/renderer/webgl/shaders/src/Quad.vert

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
precision mediump float;
44

5-
uniform mat4 uProjectionMatrix;
6-
75
attribute vec2 inPosition;
86
attribute vec2 inTexCoord;
97

@@ -12,8 +10,8 @@ varying vec2 outTexCoord;
1210

1311
void main ()
1412
{
15-
gl_Position = uProjectionMatrix * vec4(inPosition, 1.0, 1.0);
16-
17-
outFragCoord = gl_Position.xy * 0.5 + 0.5;
13+
outFragCoord = inPosition.xy * 0.5 + 0.5;
1814
outTexCoord = inTexCoord;
15+
16+
gl_Position = vec4(inPosition, 0, 1);
1917
}

0 commit comments

Comments
 (0)