diff options
author | tcmal <me@aria.rip> | 2024-08-25 17:44:24 +0100 |
---|---|---|
committer | tcmal <me@aria.rip> | 2024-08-25 17:44:24 +0100 |
commit | 09a777d42d6301028cd3a8967ff6a82e703c8800 (patch) | |
tree | 79ac93287a15e8b0f90e1ac5d6981fa6eaeb6229 /stockton-render/src/data | |
parent | 6367a9ba5a549b62f01da61fb50323877b9f52ff (diff) |
refactor(all): remove levels and render
Diffstat (limited to 'stockton-render/src/data')
-rw-r--r-- | stockton-render/src/data/3d.frag | 15 | ||||
-rw-r--r-- | stockton-render/src/data/3d.vert | 23 | ||||
-rw-r--r-- | stockton-render/src/data/ui.frag | 15 | ||||
-rw-r--r-- | stockton-render/src/data/ui.vert | 37 |
4 files changed, 0 insertions, 90 deletions
diff --git a/stockton-render/src/data/3d.frag b/stockton-render/src/data/3d.frag deleted file mode 100644 index 336d9fe..0000000 --- a/stockton-render/src/data/3d.frag +++ /dev/null @@ -1,15 +0,0 @@ -#version 450 - -// DescriptorSet 0 = Textures -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; - -layout (location = 0) out vec4 color; - -void main() -{ - color = texture(sampler2D(tex[frag_tex % 8], samp[frag_tex % 8]), frag_uv); -}
\ No newline at end of file diff --git a/stockton-render/src/data/3d.vert b/stockton-render/src/data/3d.vert deleted file mode 100644 index aaee1a5..0000000 --- a/stockton-render/src/data/3d.vert +++ /dev/null @@ -1,23 +0,0 @@ -#version 450 - -// DescriptorSet 0 = Matrices -layout (push_constant) uniform PushConsts { - mat4 vp; -} push; - -layout (location = 0) in vec3 position; -layout (location = 1) in int tex; -layout (location = 2) in vec2 uv; - -out gl_PerVertex { - vec4 gl_Position; -}; -layout (location = 1) out vec2 frag_uv; -layout (location = 2) out flat int frag_tex; - -void main() -{ - gl_Position = push.vp * vec4(position, 1.0); - frag_uv = uv; - frag_tex = tex; -}
\ No newline at end of file diff --git a/stockton-render/src/data/ui.frag b/stockton-render/src/data/ui.frag deleted file mode 100644 index c30c99e..0000000 --- a/stockton-render/src/data/ui.frag +++ /dev/null @@ -1,15 +0,0 @@ -#version 450 -#extension GL_ARB_separate_shader_objects : enable - -// DescriptorSet 0 = Textures -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 vec4 frag_col; - -layout (location = 0) out vec4 color; - -void main() { - color = texture(sampler2D(tex[0], samp[0]), frag_uv) * frag_col; -}
\ No newline at end of file diff --git a/stockton-render/src/data/ui.vert b/stockton-render/src/data/ui.vert deleted file mode 100644 index 8912e96..0000000 --- a/stockton-render/src/data/ui.vert +++ /dev/null @@ -1,37 +0,0 @@ -#version 450 - -layout (push_constant) uniform PushConsts { - vec2 screen_size; -} push; - -layout (location = 0) in vec2 pos; -layout (location = 1) in vec2 uv; -layout (location = 2) in vec4 col; - -out gl_PerVertex { - vec4 gl_Position; -}; -layout (location = 1) out vec2 frag_uv; -layout (location = 2) out vec4 frag_col; - -vec3 linear_from_srgb(vec3 srgb) { - bvec3 cutoff = lessThan(srgb, vec3(10.31475)); - vec3 lower = srgb / vec3(3294.6); - vec3 higher = pow((srgb + vec3(14.025)) / vec3(269.025), vec3(2.4)); - return mix(higher, lower, cutoff); -} - -vec4 linear_from_srgba(vec4 srgba) { - return vec4(linear_from_srgb(srgba.rgb * 255.0), srgba.a); -} - -void main() { - gl_Position = vec4( - 2.0 * pos.x / push.screen_size.x - 1.0, - 2.0 * pos.y / push.screen_size.y - 1.0, - 0.0, - 1.0 - ); - frag_uv = uv; - frag_col = linear_from_srgba(col); -} |