diff options
| author | ladevieq <ladevie.quentin@gmail.com> | 2021-03-07 20:10:31 +0100 |
|---|---|---|
| committer | ladevieq <ladevie.quentin@gmail.com> | 2021-03-07 20:10:31 +0100 |
| commit | e6d55c22bee063057c0f7b529baff2936e882f3d (patch) | |
| tree | 1a7fe62cde7e2e23a24389f1efe2248aa686e570 /shaders | |
| parent | 7e572410bb95a46db3bd3955cc7689ea87973cea (diff) | |
Make imgui backend more flexible (display demo scene)
Diffstat (limited to 'shaders')
| -rw-r--r-- | shaders/ui.frag | 2 | ||||
| -rw-r--r-- | shaders/ui.vert | 7 |
2 files changed, 6 insertions, 3 deletions
diff --git a/shaders/ui.frag b/shaders/ui.frag index c9f0339..78833d1 100644 --- a/shaders/ui.frag +++ b/shaders/ui.frag @@ -5,7 +5,7 @@ layout(location = 0) in struct { vec4 color;
} In;
-layout(set = 0, binding = 1) uniform sampler2D atlas;
+layout(set = 0, binding = 2) uniform sampler2D atlas;
void main() {
o_Color = In.color * texture(atlas, In.uv.xy);
diff --git a/shaders/ui.vert b/shaders/ui.vert index 2e6862d..c935357 100644 --- a/shaders/ui.vert +++ b/shaders/ui.vert @@ -8,6 +8,11 @@ layout(set = 0, binding = 0) uniform Vertices { Vertex vertices[158];
};
+layout(set = 0, binding = 1) uniform UiTransforms {
+ vec2 scale;
+ vec2 translate;
+};
+
out gl_PerVertex {
vec4 gl_Position;
};
@@ -17,8 +22,6 @@ layout(location = 0) out struct { vec4 color;
} Out;
-const vec2 scale = vec2(2.0 / 384.0, 2.0 / 186.0);
-const vec2 translate = vec2(-1.0, -1.0);
void main() {
Vertex v = vertices[gl_VertexIndex];
|
