FroggyGreen
b0dd2cdf3a
Textures are stored in a global hashtable. Each mesh pipeline has access to a single texture. The texture may be used as an atlas by creating meshes with different texture coordinates. The current system should be fine for text glyphs. However, if you have an atlas where each subdivision is equal in its dimensions, the use of layers and the VK_IMAGE_VIEW_TYPE_2D_ARRAY view type would be best. Some preliminary code for this was completed, but for now inserting textures into the hashmap defaults to VK_IMAGE_VIEW_TYPE_2D.
14 lines
253 B
GLSL
14 lines
253 B
GLSL
#version 460
|
|
|
|
layout(location = 0) in vec4 fragColor;
|
|
layout(location = 1) in vec2 fragTex;
|
|
|
|
layout(location = 0) out vec4 outColor;
|
|
|
|
layout(set = 1, binding = 0) uniform sampler2D texSampler;
|
|
|
|
void main()
|
|
{
|
|
outColor = texture(texSampler, fragTex);
|
|
}
|