SSAA 4X demo

This commit is contained in:
Vladislav Khorev Dev committed 2017-12-02 15:25:02 +05:00
1 parent 185e445ec5
commit ed4a0178da
6 files changed
+223 -102

No files matched your search

+18
View File
@@ -0,0 +1,18 @@
precision mediump float;
uniform sampler2D Texture;
uniform vec2 samplesOffset[4];
varying vec2 texCoord;
void main()
{
vec3 color = vec3(0, 0, 0);
for (int i = 0; i < 4; ++i)
{
color += texture2D(Texture, texCoord + samplesOffset[i]).rgb;
}
color /= 4;
gl_FragColor = vec4(texture2D(Texture, texCoord ), 1.0);
}
+11
View File
@@ -0,0 +1,11 @@
attribute vec3 vPosition;
attribute vec2 vTexCoord;
varying vec2 texCoord;
uniform mat4 ProjectionMatrix;
void main()
{
gl_Position = ProjectionMatrix * vec4(vPosition.xyz, 1.0);
texCoord = vTexCoord;
}
+7
View File
@@ -0,0 +1,7 @@
precision mediump float;
varying vec4 color;
void main()
{
gl_FragColor = color;
}
+11
View File
@@ -0,0 +1,11 @@
attribute vec3 vPosition;
attribute vec4 vColor;
varying vec4 color;
uniform mat4 ProjectionMatrix;
void main()
{
gl_Position = ProjectionMatrix * vec4(vPosition.xyz, 1.0);
color = vColor;
}