Minor fixes

This commit is contained in:
Linloir 2022-12-13 13:07:34 +08:00
parent 3ee5f66779
commit b9ce5af24b
No known key found for this signature in database
GPG Key ID: 58EEB209A0F2C366
3 changed files with 20 additions and 5 deletions

View File

@ -1,7 +1,13 @@
#version 430 core
out vec4 FragColor;
in vec2 TexCoords;
uniform sampler2D texture_diffuse1;
uniform sampler2D texture_specular1;
void main()
{
FragColor = vec4(1.0f, 0.5f, 0.2f, 1.0f);
FragColor = texture(texture_specular1, TexCoords);
FragColor = texture(texture_diffuse1, TexCoords);
}

View File

@ -140,7 +140,7 @@ Mesh Model::processMesh(aiMesh* mesh, const aiScene* scene) {
Logger::debug("Textures vector memory usage: " + std::to_string(textures.size() * sizeof(Texture) / 1024) + " KB");
Logger::debug("Mesh processed");
return Mesh(std::move(vertices), std::move(indices), std::move(textures));
return Mesh(vertices, indices, textures);
}
std::vector<Texture> Model::loadMaterialTextures(aiMaterial* mat, aiTextureType type, TextureType textureType) {

View File

@ -1,7 +1,16 @@
#version 430 core
layout (location = 0) in vec3 aPos;
layout (location = 1) in vec3 aNormal;
layout (location = 2) in vec2 aTexCoords;
out vec2 TexCoords;
uniform mat4 model;
uniform mat4 view;
uniform mat4 projection;
void main()
{
gl_Position = vec4(aPos.x, aPos.y, aPos.z, 1.0);
TexCoords = aTexCoords;
gl_Position = projection * view * model * vec4(aPos, 1.0);
}