Set up a multipass shader

This commit is contained in:
YourWishes committed 2021-11-12 08:40:49 -08:00
1 parent 3f5621266e
commit 636040289c
7 files changed
+106 -30

No files matched your search

+12
View File
@@ -0,0 +1,12 @@
#version 330 core
in vec2 TexCoord;
uniform sampler2D u_Text0;
uniform sampler2D u_Text1;
out vec4 FragColor;
void main() {
vec4 color1 = texture(u_Text0, TexCoord);
vec4 color2 = texture(u_Text1, TexCoord);
FragColor = color1 * color2.r;
}
+20
View File
@@ -0,0 +1,20 @@
#version 300 es
#ifdef GL_ES
#else
#extension GL_ARB_separate_shader_objects : enable
#endif
layout (location = 0) in vec3 aPos;
layout (location = 1) in vec2 aTexCoord;
uniform mat4 u_Proj;
uniform mat4 u_View;
uniform mat4 u_Modl;
out vec2 TexCoord;
void main() {
gl_Position = u_Proj * u_View * u_Modl * vec4(aPos, 1.0);
TexCoord = vec2(aTexCoord.x, aTexCoord.y);
}