diff options
author | tcmal <me@aria.rip> | 2024-08-25 17:44:21 +0100 |
---|---|---|
committer | tcmal <me@aria.rip> | 2024-08-25 17:44:21 +0100 |
commit | 9f6b7a10e7e00edf6ab50a9cf162b377d84a43f6 (patch) | |
tree | fe4ebd024c59376c425073b4fa747fa70824d171 /stockton-render/src/draw/data | |
parent | 26c325640df7ab8b9ea4a6c3fd5166f7df7f80ff (diff) |
feat(render) WIP: textures, using a fixed size texture array
currently using an 8 long texture array with seperate samplers.
also move to a trait for resolving textures from the bsp file rather than adding them manually. currently stuck with one static implementation though. this means all textures in the file are loaded when the map is.
not currently drawing with anything other than the first texture array, so files with >8 textures will fail.
Diffstat (limited to 'stockton-render/src/draw/data')
-rw-r--r-- | stockton-render/src/draw/data/stockton.frag | 4 | ||||
-rw-r--r-- | stockton-render/src/draw/data/stockton.vert | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/stockton-render/src/draw/data/stockton.frag b/stockton-render/src/draw/data/stockton.frag index c50e1b9..5c6e1d7 100644 --- a/stockton-render/src/draw/data/stockton.frag +++ b/stockton-render/src/draw/data/stockton.frag @@ -1,8 +1,8 @@ #version 450 // DescriptorSet 0 = Textures -layout(set = 0, binding = 0) uniform texture2D tex[2]; -layout(set = 0, binding = 1) uniform sampler samp[2]; +layout(set = 0, binding = 0) uniform texture2D tex[8]; +layout(set = 0, binding = 1) uniform sampler samp[8]; layout (location = 1) in vec2 frag_uv; layout (location = 2) in flat int frag_tex; diff --git a/stockton-render/src/draw/data/stockton.vert b/stockton-render/src/draw/data/stockton.vert index 3146a25..aaee1a5 100644 --- a/stockton-render/src/draw/data/stockton.vert +++ b/stockton-render/src/draw/data/stockton.vert @@ -6,8 +6,8 @@ layout (push_constant) uniform PushConsts { } push; layout (location = 0) in vec3 position; -layout (location = 1) in vec2 uv; -layout (location = 2) in int tex; +layout (location = 1) in int tex; +layout (location = 2) in vec2 uv; out gl_PerVertex { vec4 gl_Position; |