mirror of
https://github.com/Linloir/SceneEditor.git
synced 2025-12-17 15:38:11 +08:00
Minor fixes
This commit is contained in:
parent
3ee5f66779
commit
b9ce5af24b
@ -1,7 +1,13 @@
|
|||||||
#version 430 core
|
#version 430 core
|
||||||
out vec4 FragColor;
|
out vec4 FragColor;
|
||||||
|
|
||||||
|
in vec2 TexCoords;
|
||||||
|
|
||||||
|
uniform sampler2D texture_diffuse1;
|
||||||
|
uniform sampler2D texture_specular1;
|
||||||
|
|
||||||
void main()
|
void main()
|
||||||
{
|
{
|
||||||
FragColor = vec4(1.0f, 0.5f, 0.2f, 1.0f);
|
FragColor = texture(texture_specular1, TexCoords);
|
||||||
|
FragColor = texture(texture_diffuse1, TexCoords);
|
||||||
}
|
}
|
||||||
@ -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("Textures vector memory usage: " + std::to_string(textures.size() * sizeof(Texture) / 1024) + " KB");
|
||||||
|
|
||||||
Logger::debug("Mesh processed");
|
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) {
|
std::vector<Texture> Model::loadMaterialTextures(aiMaterial* mat, aiTextureType type, TextureType textureType) {
|
||||||
|
|||||||
@ -1,7 +1,16 @@
|
|||||||
#version 430 core
|
#version 430 core
|
||||||
layout (location = 0) in vec3 aPos;
|
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()
|
void main()
|
||||||
{
|
{
|
||||||
gl_Position = vec4(aPos.x, aPos.y, aPos.z, 1.0);
|
TexCoords = aTexCoords;
|
||||||
|
gl_Position = projection * view * model * vec4(aPos, 1.0);
|
||||||
}
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user