more shader things that needs multiplatform investigation

This commit is contained in:
minjaesong
2023-02-28 16:57:33 +09:00
parent f0b1d7f1bd
commit 8d7a62f796
5 changed files with 61 additions and 112 deletions

View File

@@ -0,0 +1,13 @@
#version 150
#ifdef GL_ES
precision mediump float;
#endif
in vec4 v_col;
out vec4 fragColor;
void main() {
fragColor = v_col;
}

View File

@@ -0,0 +1,14 @@
#version 150
in vec4 a_position;
in vec4 a_color;
uniform mat4 u_projModelView;
out vec4 v_col;
void main() {
gl_Position = u_projModelView * a_position;
v_col = a_color;
v_col.a *= 255.0 / 254.0;
gl_PointSize = 1.0;
}

View File

@@ -0,0 +1,17 @@
#version 150
#ifdef GL_ES
#define LOWP lowp
precision mediump float;
#else
#define LOWP
#endif
in LOWP vec4 v_color;
in vec2 v_texCoords;
uniform sampler2D u_texture;
out vec4 fragColor;
void main() {
fragColor = v_color * texture(u_texture, v_texCoords);
}

View File

@@ -0,0 +1,15 @@
#version 150
in vec4 a_position;
in vec4 a_color;
in vec2 a_texCoord0;
uniform mat4 u_projTrans;
out vec4 v_color;
out vec2 v_texCoords;
void main() {
v_color = a_color;
v_color.a = v_color.a * (255.0/254.0);
v_texCoords = a_texCoord0;
gl_Position = u_projTrans * a_position;
}