diff options
Diffstat (limited to 'shaders')
-rw-r--r-- | shaders/new.frag | 9 | ||||
-rw-r--r-- | shaders/new.vert | 11 | ||||
-rw-r--r-- | shaders/world.frag | 10 | ||||
-rw-r--r-- | shaders/world.vert | 11 |
4 files changed, 41 insertions, 0 deletions
diff --git a/shaders/new.frag b/shaders/new.frag new file mode 100644 index 0000000..8812d72 --- /dev/null +++ b/shaders/new.frag @@ -0,0 +1,9 @@ +uniform sampler2D sampler; + +varying vec2 texCoord; +varying float join; + +void main(){ + vec4 color = texture2D(sampler, vec2(texCoord.x, texCoord.y)); + gl_FragColor = color; +} diff --git a/shaders/new.vert b/shaders/new.vert new file mode 100644 index 0000000..1bedfd3 --- /dev/null +++ b/shaders/new.vert @@ -0,0 +1,11 @@ +attribute vec3 coord2d; +attribute vec2 tex_coord; + +uniform mat4 ortho; + +varying vec2 texCoord; + +void main(){ + texCoord = tex_coord; + gl_Position = ortho * vec4(coord2d.xyz, 1.0); +} diff --git a/shaders/world.frag b/shaders/world.frag new file mode 100644 index 0000000..c45b4a0 --- /dev/null +++ b/shaders/world.frag @@ -0,0 +1,10 @@ +uniform sampler2D sampler; + +varying vec2 texCoord; + +void main(){ + vec4 color = texture2D(sampler, vec2(texCoord.x, 1-texCoord.y)); + if(color.a <= .1) + discard; + gl_FragColor = color; +} diff --git a/shaders/world.vert b/shaders/world.vert new file mode 100644 index 0000000..1bedfd3 --- /dev/null +++ b/shaders/world.vert @@ -0,0 +1,11 @@ +attribute vec3 coord2d; +attribute vec2 tex_coord; + +uniform mat4 ortho; + +varying vec2 texCoord; + +void main(){ + texCoord = tex_coord; + gl_Position = ortho * vec4(coord2d.xyz, 1.0); +} |