SSAA 4X demo
This commit is contained in:
1 parent
185e445ec5
commit
ed4a0178da
6 files changed
+223
-102
No files matched your search
Executable
+18
@@ -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);
|
||||
}
|
||||
Executable
+11
@@ -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;
|
||||
}
|
||||
Executable
+7
@@ -0,0 +1,7 @@
|
||||
precision mediump float;
|
||||
varying vec4 color;
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_FragColor = color;
|
||||
}
|
||||
Executable
+11
@@ -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;
|
||||
}
|
||||
Reference in new issue
Block a user