loading texture from png and rendering on the screen (quad) works.
This commit is contained in:
parent
dfda49c027
commit
a56f688204
9 changed files with 76 additions and 21 deletions
BIN
data/img/planet_mars.png
Normal file
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
BIN
data/img/test.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 7 KiB |
13
data/shader/background.frag
Normal file
13
data/shader/background.frag
Normal 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);
|
||||
}
|
||||
12
data/shader/background.vert
Normal file
12
data/shader/background.vert
Normal 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);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue