Initial commit
This commit is contained in:
commit
ac0d491786
21 changed files with 1094 additions and 0 deletions
41
shader.glsl
Normal file
41
shader.glsl
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
@header package main
|
||||
@header import sg "sokol/gfx"
|
||||
|
||||
@ctype mat4 Mat4
|
||||
|
||||
@vs vs
|
||||
in vec3 pos;
|
||||
in vec4 col;
|
||||
in vec2 uv;
|
||||
|
||||
layout(binding = 0) uniform VsParams {
|
||||
mat4 mvp;
|
||||
};
|
||||
|
||||
out vec4 color;
|
||||
out vec2 tex_coord;
|
||||
|
||||
void main() {
|
||||
gl_Position = mvp * vec4(pos, 1);
|
||||
color = col;
|
||||
tex_coord = uv;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@fs fs
|
||||
in vec4 color;
|
||||
in vec2 tex_coord;
|
||||
|
||||
layout(binding=0) uniform texture2D tex;
|
||||
layout(binding=0) uniform sampler smp;
|
||||
|
||||
out vec4 frag_color;
|
||||
|
||||
void main() {
|
||||
frag_color = texture(sampler2D(tex, smp), tex_coord) * color;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@program main vs fs
|
||||
Loading…
Add table
Add a link
Reference in a new issue