Fixing descriptors a little

This commit is contained in:
Dynamitos
2023-11-12 14:46:22 +01:00
parent a9ac3d14a7
commit c1e4891456
8 changed files with 35 additions and 47 deletions
+5 -5
View File
@@ -54,10 +54,6 @@ void MeshLoader::loadMaterials(const aiScene* scene, const std::string& baseName
matCode["profile"] = "BlinnPhong"; //TODO: other shading models
aiString texPath;
//TODO make samplers based on used textures
matCode["params"]["textureSampler"] =
{
{"type", "SamplerState"}
};
if(material->GetTexture(aiTextureType_DIFFUSE, 0, &texPath) == AI_SUCCESS)
{
std::string texFilename = std::filesystem::path(texPath.C_Str()).stem().string();
@@ -66,11 +62,15 @@ void MeshLoader::loadMaterials(const aiScene* scene, const std::string& baseName
{"type", "Texture2D"},
{"default", texFilename}
};
matCode["params"]["diffuseSampler"] =
{
{"type", "SamplerState"}
};
matCode["code"].push_back(
{
{ "exp", "Sample" },
{ "texture", "diffuseTexture" },
{ "sampler", "textureSampler" },
{ "sampler", "diffuseSampler" },
{ "coords", "input.texCoords[0]"}
}
);