mirror of
https://github.com/Kugelschieber/go-game.git
synced 2026-01-18 06:40:28 +00:00
Rendering now works! Added shaders for reference.
This commit is contained in:
12
shader/basic2D.fs
Normal file
12
shader/basic2D.fs
Normal file
@@ -0,0 +1,12 @@
|
||||
#version 130
|
||||
precision highp float;
|
||||
|
||||
uniform sampler2D tex;
|
||||
|
||||
in vec2 tc;
|
||||
|
||||
out vec4 color;
|
||||
|
||||
void main(){
|
||||
color = texture(tex, tc);
|
||||
}
|
||||
13
shader/basic2D.vs
Normal file
13
shader/basic2D.vs
Normal file
@@ -0,0 +1,13 @@
|
||||
#version 130
|
||||
|
||||
uniform mat3 o, m;
|
||||
|
||||
in vec2 vertex;
|
||||
in vec2 texCoord;
|
||||
|
||||
out vec2 tc;
|
||||
|
||||
void main(){
|
||||
tc = texCoord;
|
||||
gl_Position = vec4(o*m*vec3(vertex, 1.0), 1.0);
|
||||
}
|
||||
12
shader/basic3D.fs
Normal file
12
shader/basic3D.fs
Normal file
@@ -0,0 +1,12 @@
|
||||
#version 130
|
||||
precision highp float;
|
||||
|
||||
uniform sampler2D tex;
|
||||
|
||||
in vec2 tc;
|
||||
|
||||
out vec4 color;
|
||||
|
||||
void main(){
|
||||
color = texture(tex, tc);
|
||||
}
|
||||
13
shader/basic3D.vs
Normal file
13
shader/basic3D.vs
Normal file
@@ -0,0 +1,13 @@
|
||||
#version 130
|
||||
|
||||
uniform mat4 pv, m;
|
||||
|
||||
in vec3 vertex;
|
||||
in vec2 texCoord;
|
||||
|
||||
out vec2 tc;
|
||||
|
||||
void main(){
|
||||
tc = texCoord;
|
||||
gl_Position = pv*m*vec4(vertex, 1.0);
|
||||
}
|
||||
13
shader/text.fs
Normal file
13
shader/text.fs
Normal file
@@ -0,0 +1,13 @@
|
||||
#version 130
|
||||
precision highp float;
|
||||
|
||||
uniform sampler2D tex;
|
||||
uniform vec4 color;
|
||||
|
||||
in vec2 tc;
|
||||
|
||||
out vec4 c;
|
||||
|
||||
void main(){
|
||||
c = texture(tex, tc)*color;
|
||||
}
|
||||
13
shader/text.vs
Normal file
13
shader/text.vs
Normal file
@@ -0,0 +1,13 @@
|
||||
#version 130
|
||||
|
||||
uniform mat3 o, m;
|
||||
|
||||
in vec2 vertex;
|
||||
in vec2 texCoord;
|
||||
|
||||
out vec2 tc;
|
||||
|
||||
void main(){
|
||||
tc = texCoord;
|
||||
gl_Position = vec4(o*m*vec3(vertex, 1.0), 1.0);
|
||||
}
|
||||
Reference in New Issue
Block a user