Use array of atlases instead of one growing indefinitely.
This commit is contained in:
parent
8562a4c986
commit
2f77a6bf5a
5 changed files with 259 additions and 280 deletions
|
|
@ -1,12 +1,12 @@
|
|||
#version 450
|
||||
|
||||
layout(location = 0) in vec2 v_Uv;
|
||||
layout(location = 0) in vec3 v_Uv;
|
||||
|
||||
layout(set = 0, binding = 1) uniform sampler u_Sampler;
|
||||
layout(set = 1, binding = 0) uniform texture2D u_Texture;
|
||||
layout(set = 1, binding = 0) uniform texture2DArray u_Texture;
|
||||
|
||||
layout(location = 0) out vec4 o_Color;
|
||||
|
||||
void main() {
|
||||
o_Color = texture(sampler2D(u_Texture, u_Sampler), v_Uv);
|
||||
o_Color = texture(sampler2DArray(u_Texture, u_Sampler), v_Uv);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,15 +5,16 @@ layout(location = 1) in vec2 i_Pos;
|
|||
layout(location = 2) in vec2 i_Scale;
|
||||
layout(location = 3) in vec2 i_Atlas_Pos;
|
||||
layout(location = 4) in vec2 i_Atlas_Scale;
|
||||
layout(location = 5) in float i_Layer;
|
||||
|
||||
layout (set = 0, binding = 0) uniform Globals {
|
||||
mat4 u_Transform;
|
||||
};
|
||||
|
||||
layout(location = 0) out vec2 o_Uv;
|
||||
layout(location = 0) out vec3 o_Uv;
|
||||
|
||||
void main() {
|
||||
o_Uv = v_Pos * i_Atlas_Scale + i_Atlas_Pos;
|
||||
o_Uv = vec3(v_Pos * i_Atlas_Scale + i_Atlas_Pos, i_Layer);
|
||||
|
||||
mat4 i_Transform = mat4(
|
||||
vec4(i_Scale.x, 0.0, 0.0, 0.0),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue