Skip to content

Commit 1aacd16

Browse files
committed
Add bindless texture example shader
1 parent 1c859fa commit 1aacd16

File tree

4 files changed

+33
-1
lines changed

4 files changed

+33
-1
lines changed

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ archives_base_name=veil-example-mod
1616

1717
# Dependencies
1818
fabric_version=0.116.4+1.21.1
19-
veil_version=3.0.1
19+
veil_version=3.0.2
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
in vec2 texCoord0;
2+
3+
layout(std140) uniform CustomTextures {
4+
sampler2D textures[128];
5+
};
6+
7+
uniform uint TextureIndex;
8+
9+
out vec4 Color;
10+
11+
void main() {
12+
Color = texture(textures[TextureIndex], texCoord0);
13+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"vertex": "veil-example-mod:bindless_texture/example",
3+
"fragment": "veil-example-mod:bindless_texture/example",
4+
"required_features": [
5+
"BINDLESS_TEXTURE"
6+
]
7+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
layout(location = 0) in vec3 Position;
2+
layout(location = 1) in vec2 UV0;
3+
4+
uniform mat4 ModelViewMat;
5+
uniform mat4 ProjMat;
6+
7+
out vec2 texCoord0;
8+
9+
void main() {
10+
gl_Position = ProjMat * ModelViewMat * vec4(Position, 1.0);
11+
texCoord0 = UV0;
12+
}

0 commit comments

Comments
 (0)