loading texture from png and rendering on the screen (quad) works.

This commit is contained in:
Andreas Ortmann 2016-10-03 21:14:07 +02:00
parent dfda49c027
commit a56f688204
9 changed files with 76 additions and 21 deletions

BIN
data/img/planet_mars.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 MiB

BIN
data/img/test.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7 KiB

View file

@ -0,0 +1,13 @@
#version 120
uniform sampler2D texture;
varying vec3 vertex;
varying vec2 uv;
void main()
{
vec3 color = texture2D(texture, uv).rgb;
gl_FragColor = vec4(color, 1.0);
}

View file

@ -0,0 +1,12 @@
#version 120
uniform vec2 uvScale;
varying vec3 vertex;
varying vec2 uv;
void main()
{
gl_Position = gl_Vertex;
vertex = gl_Position.xyz;
uv = uvScale * (0.5 + vertex.xy / 2.0);
}