Adding combined image samplers

This commit is contained in:
Dynamitos
2024-04-26 11:42:28 +02:00
parent 54cd77beb2
commit 93ab9e38f0
9 changed files with 55 additions and 23 deletions
+4 -14
View File
@@ -77,18 +77,13 @@ void MeshLoader::loadMaterials(const aiScene* scene, const std::string& baseName
});
matCode["params"]["diffuseTexture"] =
{
{"type", "Texture2D"},
{"type", "Sampler2D"},
{"default", fmt::format("{0}/{1}", importPath, texFilename.string())}
};
matCode["params"]["diffuseSampler"] =
{
{"type", "Sampler"}
};
matCode["code"].push_back(
{
{ "exp", "Sample" },
{ "texture", "diffuseTexture" },
{ "sampler", "diffuseSampler" },
{ "sampler", "diffuseTexture" },
{ "coords", "input.texCoords"}
}
);
@@ -122,18 +117,13 @@ void MeshLoader::loadMaterials(const aiScene* scene, const std::string& baseName
});
matCode["params"]["normalTexture"] =
{
{"type", "Texture2D"},
{"type", "Sampler2D"},
{"default", fmt::format("{0}/{1}", importPath, texFilename.string())}
};
matCode["params"]["normalSampler"] =
{
{"type", "Sampler"}
};
matCode["code"].push_back(
{
{ "exp", "Sample" },
{ "texture", "normalTexture" },
{ "sampler", "normalSampler" },
{ "sampler", "normalTexture" },
{ "coords", "input.texCoords" }
}
);