Skip to content

Commit

Permalink
Added layoutexporter
Browse files Browse the repository at this point in the history
  • Loading branch information
denis authored and denis committed Nov 10, 2024
1 parent ed7e468 commit 2d2e23c
Showing 1 changed file with 52 additions and 2 deletions.
54 changes: 52 additions & 2 deletions Engine/include/SceneData/SceneExporterLayout.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,31 @@ namespace Prisma
}
}

if (mesh->material()->specular().size() > 0)
{
std::string textureName = mesh->material()->specular()[0].name();
if (textureName == "")
{
textures.push_back({"SPECULAR", "NO_TEXTURE"});
}
else
{
textures.push_back({"SPECULAR", textureName});
}
}
if (mesh->material()->ambientOcclusion().size() > 0)
{
std::string textureName = mesh->material()->ambientOcclusion()[0].name();
if (textureName == "")
{
textures.push_back({"AMBIENT_OCCLUSION", "NO_TEXTURE"});
}
else
{
textures.push_back({"AMBIENT_OCCLUSION", textureName});
}
}

j["textures"] = textures;
// Convert Vertex properties to arrays of floats
std::vector<json> verticesJson;
Expand Down Expand Up @@ -196,6 +221,31 @@ namespace Prisma
}
}

if (mesh->material()->specular().size() > 0)
{
std::string textureName = mesh->material()->specular()[0].name();
if (textureName == "")
{
textures.push_back({"SPECULAR", "NO_TEXTURE"});
}
else
{
textures.push_back({"SPECULAR", textureName});
}
}
if (mesh->material()->ambientOcclusion().size() > 0)
{
std::string textureName = mesh->material()->ambientOcclusion()[0].name();
if (textureName == "")
{
textures.push_back({"AMBIENT_OCCLUSION", "NO_TEXTURE"});
}
else
{
textures.push_back({"AMBIENT_OCCLUSION", textureName});
}
}

j["textures"] = textures;
// Convert Vertex properties to arrays of floats
std::vector<std::vector<float>> data;
Expand Down Expand Up @@ -344,7 +394,7 @@ namespace Prisma
Texture texture;
if (t.second == "NO_TEXTURE")
{
textures.push_back(defaultBlack);
textures.push_back(defaultWhite);
}
else
{
Expand All @@ -360,7 +410,7 @@ namespace Prisma
Texture texture;
if (t.second == "NO_TEXTURE")
{
textures.push_back(defaultBlack);
textures.push_back(defaultWhite);
}
else
{
Expand Down

0 comments on commit 2d2e23c

Please sign in to comment.