Adding transparency support
This commit is contained in:
@@ -202,7 +202,7 @@ void MaterialLoader::import(MaterialImportArgs args, PMaterialAsset asset) {
|
||||
}
|
||||
}
|
||||
}
|
||||
asset->material = new Material(graphics, numTextures, numSamplers, numFloats, materialName, std::move(expressions),
|
||||
asset->material = new Material(graphics, numTextures, numSamplers, numFloats, false, 1, materialName, std::move(expressions),
|
||||
std::move(parameters), std::move(mat));
|
||||
|
||||
asset->material->compile();
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
#include <set>
|
||||
#include <stb_image_write.h>
|
||||
|
||||
|
||||
using namespace Seele;
|
||||
|
||||
MeshLoader::MeshLoader(Gfx::PGraphics graphics) : graphics(graphics) {}
|
||||
@@ -372,10 +371,13 @@ void MeshLoader::loadMaterials(const aiScene* scene, const Array<PTextureAsset>&
|
||||
}
|
||||
break;
|
||||
};
|
||||
|
||||
bool twoSided = true;
|
||||
material->Get(AI_MATKEY_TWOSIDED, twoSided);
|
||||
float opacity = 1.0f;
|
||||
material->Get(AI_MATKEY_OPACITY, opacity);
|
||||
OMaterialAsset baseMat = new MaterialAsset(importPath, materialName);
|
||||
baseMat->material = new Material(graphics, numTextures, numSamplers, numFloats, materialName, std::move(expressions),
|
||||
std::move(parameters), std::move(brdf));
|
||||
baseMat->material = new Material(graphics, numTextures, numSamplers, numFloats, twoSided, opacity, materialName,
|
||||
std::move(expressions), std::move(parameters), std::move(brdf));
|
||||
baseMat->material->compile();
|
||||
graphics->getShaderCompiler()->registerMaterial(baseMat->material);
|
||||
globalMaterials[m] = baseMat->instantiate(InstantiationParameter{
|
||||
@@ -473,8 +475,6 @@ void MeshLoader::loadGlobalMeshes(const aiScene* scene, const Array<PMaterialIns
|
||||
globalMeshes[meshIndex]->meshlets = std::move(meshlets);
|
||||
globalMeshes[meshIndex]->indices = std::move(indices);
|
||||
globalMeshes[meshIndex]->vertexCount = mesh->mNumVertices;
|
||||
globalMeshes[meshIndex]->blas =
|
||||
graphics->createBottomLevelAccelerationStructure(Gfx::BottomLevelASCreateInfo(globalMeshes[meshIndex]));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+5
-8
@@ -63,16 +63,13 @@ int main() {
|
||||
.filePath = sourcePath / "import/textures/skyboxsun5deg_tn.jpg",
|
||||
.type = TextureImportType::TEXTURE_CUBEMAP,
|
||||
});
|
||||
// AssetImporter::importMesh(MeshImportArgs{
|
||||
// .filePath = sourcePath / "import/models/greek-temple/source/greek-temple.fbx",
|
||||
// .importPath = "temple"
|
||||
// });
|
||||
AssetImporter::importMesh(MeshImportArgs{.filePath = sourcePath / "import/models/after-the-rain-vr-sound/source/Whitechapel.fbx",
|
||||
.importPath = "Whitechapel"});
|
||||
// AssetImporter::importMesh(MeshImportArgs{
|
||||
// .filePath = sourcePath / "import/models/nitra-castle-rawscan/source/Nitriansky.obj",
|
||||
// .importPath = "Nitriansky"
|
||||
// });
|
||||
//AssetImporter::importMesh(MeshImportArgs{
|
||||
// .filePath = sourcePath / "import/models/city-suburbs/city-suburbs.gltf",
|
||||
// .importPath = "suburbs",
|
||||
//});
|
||||
vd->commitMeshes();
|
||||
WindowCreateInfo mainWindowInfo;
|
||||
mainWindowInfo.title = "SeeleEngine";
|
||||
mainWindowInfo.width = 1920;
|
||||
|
||||
Reference in New Issue
Block a user