Fixing descriptors a little
This commit is contained in:
@@ -62,7 +62,7 @@ void MaterialLoader::import(MaterialImportArgs args, PMaterialAsset asset)
|
||||
// TODO: ALIGNMENT RULES
|
||||
if(type.compare("float") == 0)
|
||||
{
|
||||
OFloatParameter p = new FloatParameter(param.key(), uniformBufferOffset, 0);
|
||||
OFloatParameter p = new FloatParameter(param.key(), uniformBufferOffset, uniformBinding);
|
||||
if(uniformBinding == -1)
|
||||
{
|
||||
layout->addDescriptorBinding(bindingCounter, Gfx::SE_DESCRIPTOR_TYPE_UNIFORM_BUFFER);
|
||||
@@ -79,7 +79,7 @@ void MaterialLoader::import(MaterialImportArgs args, PMaterialAsset asset)
|
||||
// TODO: ALIGNMENT RULES
|
||||
else if(type.compare("float3") == 0)
|
||||
{
|
||||
OVectorParameter p = new VectorParameter(param.key(), uniformBufferOffset, 0);
|
||||
OVectorParameter p = new VectorParameter(param.key(), uniformBufferOffset, uniformBinding);
|
||||
if(uniformBinding == -1)
|
||||
{
|
||||
layout->addDescriptorBinding(bindingCounter, Gfx::SE_DESCRIPTOR_TYPE_UNIFORM_BUFFER);
|
||||
|
||||
@@ -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]"}
|
||||
}
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user