Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow for usage of GLTF primitives that have no texcoords #1010

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ struct Light {

layout(location = 0) in vec3 v_Position;
layout(location = 1) in vec3 v_Normal;
# ifdef STANDARDMATERIAL_ALBEDO_TEXTURE
layout(location = 2) in vec2 v_Uv;
# endif

layout(location = 0) out vec4 o_Target;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,15 @@

layout(location = 0) in vec3 Vertex_Position;
layout(location = 1) in vec3 Vertex_Normal;
# ifdef STANDARDMATERIAL_ALBEDO_TEXTURE
layout(location = 2) in vec2 Vertex_Uv;
# endif

layout(location = 0) out vec3 v_Position;
layout(location = 1) out vec3 v_Normal;
# ifdef STANDARDMATERIAL_ALBEDO_TEXTURE
layout(location = 2) out vec2 v_Uv;
# endif

layout(set = 0, binding = 0) uniform Camera {
mat4 ViewProj;
Expand All @@ -19,6 +23,9 @@ layout(set = 2, binding = 0) uniform Transform {
void main() {
v_Normal = mat3(Model) * Vertex_Normal;
v_Position = (Model * vec4(Vertex_Position, 1.0)).xyz;
# ifdef STANDARDMATERIAL_ALBEDO_TEXTURE
v_Uv = Vertex_Uv;
# endif

gl_Position = ViewProj * vec4(v_Position, 1.0);
}