Test shaders

This commit is contained in:
Insality
2024-12-03 20:42:33 +02:00
parent 917a84fc94
commit 9a1cd795b8
11 changed files with 668 additions and 1 deletions

View File

@@ -0,0 +1,18 @@
#version 140
uniform sampler2D texture_sampler;
in vec2 var_texcoord0;
in vec4 var_color;
out vec4 color_out;
void main() {
lowp vec4 tex = texture(texture_sampler, var_texcoord0.xy);
if (tex.a < 0.5) {
discard;
}
// Final color of stencil texture
color_out = tex * var_color;
}

View File

@@ -0,0 +1,8 @@
name: "repeat"
tags: "gui"
vertex_program: "/druid/materials/stencil/gui_stencil.vp"
fragment_program: "/druid/materials/stencil/gui_stencil.fp"
vertex_constants {
name: "view_proj"
type: CONSTANT_TYPE_VIEWPROJ
}

View File

@@ -0,0 +1,20 @@
#version 140
uniform vertex_inputs {
highp mat4 view_proj;
};
// positions are in world space
in mediump vec3 position;
in mediump vec2 texcoord0;
in lowp vec4 color;
out mediump vec2 var_texcoord0;
out lowp vec4 var_color;
void main()
{
var_texcoord0 = texcoord0;
var_color = vec4(color.rgb * color.a, color.a);
gl_Position = view_proj * vec4(position.xyz, 1.0);
}