forked from nonsensical-dev/zenyx-engine
feat(rendering): rendering textures with camera
Co-authored-by: BitSyndicate <contact@bitsyndicate.de>
This commit is contained in:
parent
f6d1bfda7d
commit
d67acaadfa
9 changed files with 1037 additions and 329 deletions
|
@ -1,8 +1,10 @@
|
|||
#version 450
|
||||
|
||||
layout(location = 0) in vec3 color;
|
||||
layout(location = 0) in vec2 tex_coords;
|
||||
layout(set = 0, binding = 0) uniform texture2D t_diffuse;
|
||||
layout(set = 0, binding = 1) uniform sampler s_diffuse;
|
||||
layout(location = 0) out vec4 out_color;
|
||||
|
||||
// layout(group = 0, binding = 0) out texture2D;
|
||||
void main() {
|
||||
out_color = vec4(color, 1.0);
|
||||
out_color = texture(sampler2D(t_diffuse, s_diffuse), tex_coords);
|
||||
}
|
||||
|
|
|
@ -2,9 +2,14 @@
|
|||
|
||||
layout(location = 0) in vec3 position;
|
||||
layout(location = 1) in vec3 color;
|
||||
layout(location = 0) out vec3 out_color;
|
||||
|
||||
layout(location = 3) in vec2 tex_coords;
|
||||
layout(location = 0) out vec2 tex_coord;
|
||||
layout(set = 1, binding = 0) uniform UniformBufferObject {
|
||||
mat4x4 projection;
|
||||
} view;
|
||||
void main() {
|
||||
gl_Position = vec4(position, 1.0);
|
||||
out_color = color;
|
||||
gl_Position = view.projection * vec4(position, 1.0);
|
||||
tex_coord = tex_coords;
|
||||
// gl_Position
|
||||
// out_color = color;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue