diff options
author | tcmal <me@aria.rip> | 2024-08-25 17:44:20 +0100 |
---|---|---|
committer | tcmal <me@aria.rip> | 2024-08-25 17:44:20 +0100 |
commit | c3683cb91a7142be405aa672fcbae4238a3bde72 (patch) | |
tree | 3069cd8aef8212e864181732a27534008f533d25 /stockton-render/src/draw/data/stockton.frag | |
parent | 7cdb4bb159a7df88390e63c59f0d4c5538d7411b (diff) |
feat(render): texture store
Diffstat (limited to 'stockton-render/src/draw/data/stockton.frag')
-rw-r--r-- | stockton-render/src/draw/data/stockton.frag | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/stockton-render/src/draw/data/stockton.frag b/stockton-render/src/draw/data/stockton.frag index 7cb4a47..09ff8a7 100644 --- a/stockton-render/src/draw/data/stockton.frag +++ b/stockton-render/src/draw/data/stockton.frag @@ -1,10 +1,19 @@ #version 450 -layout(location = 1) in vec3 frag_colour; +layout(set = 0, binding = 0) uniform texture2D tex[2]; +layout(set = 0, binding = 1) uniform sampler samp[2]; -layout(location = 0) out vec4 colour; +layout (location = 1) in vec3 frag_color; +layout (location = 2) in vec2 frag_uv; +layout (location = 3) in flat int frag_tex; + +layout (location = 0) out vec4 color; void main() { - colour = vec4(frag_colour, 1.0); + if(frag_tex == -1) { + color = vec4(frag_color, 1.0); + } else { + color = texture(sampler2D(tex[frag_tex], samp[frag_tex]), frag_uv); + } }
\ No newline at end of file |