custom shader
This commit is contained in:
1 parent
a797b13b8e
commit
d639db711f
4 files changed
+94
-11
No files matched your search
@@ -0,0 +1,27 @@
|
||||
#version 330
|
||||
|
||||
// Input vertex attributes (from vertex shader)
|
||||
in vec3 vertexPos;
|
||||
in vec2 fragTexCoord;
|
||||
in vec4 fragColor;
|
||||
|
||||
// Input uniform values
|
||||
uniform sampler2D texture0;
|
||||
uniform sampler2D texture1;
|
||||
uniform vec4 colDiffuse;
|
||||
|
||||
uniform float divider = 0.5;
|
||||
|
||||
out vec4 finalColor;
|
||||
|
||||
void main()
|
||||
{
|
||||
// // Texel color fetching from texture sampler
|
||||
// vec4 texelColor0 = texture(texture0, fragTexCoord);
|
||||
// vec4 texelColor1 = texture(texture1, fragTexCoord);
|
||||
|
||||
// float x = fract(fragTexCoord.s);
|
||||
// float final = smoothstep(divider - 0.1, divider + 0.1, x);
|
||||
|
||||
finalColor = vec4(fragTexCoord, 0.0, 1.0);
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
#version 330
|
||||
|
||||
// Input vertex attributes
|
||||
in vec3 vertexPosition;
|
||||
in vec2 vertexTexCoord;
|
||||
in vec3 vertexNormal;
|
||||
in vec4 vertexColor;
|
||||
|
||||
// Input uniform values
|
||||
uniform mat4 mvp;
|
||||
|
||||
// Output vertex attributes (to fragment shader)
|
||||
out vec2 fragTexCoord;
|
||||
out vec4 fragColor;
|
||||
|
||||
// NOTE: Add your custom variables here
|
||||
|
||||
void main()
|
||||
{
|
||||
// Send vertex attributes to fragment shader
|
||||
fragTexCoord = vertexTexCoord;
|
||||
fragColor = vertexColor;
|
||||
|
||||
// Calculate final vertex position
|
||||
gl_Position = mvp * vec4(vertexPosition, 1.0);
|
||||
}
|
||||
Reference in new issue
Block a user