texture: First image load
Some checks failed
Build legacy Nix package on Ubuntu / build (push) Has been cancelled
Some checks failed
Build legacy Nix package on Ubuntu / build (push) Has been cancelled
This commit is contained in:
parent
5b0ab19207
commit
29a4da5666
11 changed files with 220 additions and 72 deletions
|
@ -1,9 +1,12 @@
|
|||
#version 450
|
||||
|
||||
layout (location = 0) in vec3 color;
|
||||
layout (location = 0) in vec2 tex_coords;
|
||||
|
||||
layout (location = 0) out vec4 f_color;
|
||||
|
||||
layout(set = 1, binding = 0) uniform sampler mySampler;
|
||||
layout(set = 1, binding = 1) uniform texture2D myTexture;
|
||||
|
||||
void main() {
|
||||
f_color = vec4(color, 1.0);
|
||||
}
|
||||
f_color = texture(sampler2D(myTexture, mySampler), tex_coords);
|
||||
}
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
#version 450
|
||||
|
||||
layout (location = 0) in vec2 position;
|
||||
layout (location = 1) in vec3 color;
|
||||
layout (location = 1) in vec2 uv;
|
||||
|
||||
layout (location = 0) out vec3 fragColor;
|
||||
layout (location = 0) out vec2 fragUv;
|
||||
|
||||
layout (set = 0, binding = 0) uniform MVP {
|
||||
mat4 world;
|
||||
|
@ -14,5 +14,5 @@ layout (set = 0, binding = 0) uniform MVP {
|
|||
void main() {
|
||||
mat4 worldview = uniforms.view * uniforms.world;
|
||||
gl_Position = uniforms.projection * worldview * vec4(position, 0.0, 1.0);
|
||||
fragColor = color;
|
||||
fragUv = uv;
|
||||
}
|
||||
|
|
BIN
res/textures/wooden-crate.jpg
Normal file
BIN
res/textures/wooden-crate.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 49 KiB |
Loading…
Add table
Add a link
Reference in a new issue