compiles again
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
#include "Graphics/Graphics.h"
|
||||
#include "Asset/FontAsset.h"
|
||||
#include "Asset/AssetRegistry.h"
|
||||
#include "Graphics/GraphicsResources.h"
|
||||
#include "Graphics/Resources.h"
|
||||
#include <ft2build.h>
|
||||
#include FT_FREETYPE_H
|
||||
|
||||
@@ -22,10 +22,12 @@ void FontLoader::importAsset(FontImportArgs args)
|
||||
{
|
||||
std::filesystem::path assetPath = args.filePath.filename();
|
||||
assetPath.replace_extension("asset");
|
||||
PFontAsset asset = new FontAsset(args.importPath, assetPath.stem().string());
|
||||
OFontAsset asset = new FontAsset(args.importPath, assetPath.stem().string());
|
||||
asset->setStatus(Asset::Status::Loading);
|
||||
AssetRegistry::get().registerFont(asset);
|
||||
import(args, asset);
|
||||
// the registry takes ownership, but we need to edit the reference
|
||||
PFontAsset ref = asset;
|
||||
AssetRegistry::get().registerFont(std::move(asset));
|
||||
import(args, ref);
|
||||
}
|
||||
|
||||
// in case of the space character there is no bitmap
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
#include "Material/ShaderExpression.h"
|
||||
#include "Asset/TextureAsset.h"
|
||||
#include <nlohmann/json.hpp>
|
||||
#include <format>
|
||||
|
||||
using namespace Seele;
|
||||
using json = nlohmann::json;
|
||||
@@ -14,12 +15,12 @@ using json = nlohmann::json;
|
||||
MaterialLoader::MaterialLoader(Gfx::PGraphics graphics)
|
||||
: graphics(graphics)
|
||||
{
|
||||
PMaterialAsset placeholderAsset = new MaterialAsset();
|
||||
OMaterialAsset placeholderAsset = new MaterialAsset();
|
||||
import(MaterialImportArgs{
|
||||
.filePath = std::filesystem::absolute("./shaders/Placeholder.asset"),
|
||||
.importPath = "",
|
||||
}, placeholderAsset);
|
||||
AssetRegistry::get().assetRoot->materials[""] = placeholderAsset;
|
||||
AssetRegistry::get().assetRoot->materials[""] = std::move(placeholderAsset);
|
||||
}
|
||||
|
||||
MaterialLoader::~MaterialLoader()
|
||||
@@ -30,10 +31,11 @@ void MaterialLoader::importAsset(MaterialImportArgs args)
|
||||
{
|
||||
std::filesystem::path assetPath = args.filePath.filename();
|
||||
assetPath.replace_extension("asset");
|
||||
PMaterialAsset asset = new MaterialAsset(args.importPath, assetPath.stem().string());
|
||||
OMaterialAsset asset = new MaterialAsset(args.importPath, assetPath.stem().string());
|
||||
asset->setStatus(Asset::Status::Loading);
|
||||
AssetRegistry::get().registerMaterial(asset);
|
||||
import(args, asset);
|
||||
PMaterialAsset ref = asset;
|
||||
AssetRegistry::get().registerMaterial(std::move(asset));
|
||||
import(args, ref);
|
||||
}
|
||||
|
||||
void MaterialLoader::import(MaterialImportArgs args, PMaterialAsset asset)
|
||||
@@ -42,7 +44,7 @@ void MaterialLoader::import(MaterialImportArgs args, PMaterialAsset asset)
|
||||
json j;
|
||||
jsonstream >> j;
|
||||
std::string materialName = j["name"].get<std::string>() + "Material";
|
||||
Gfx::PDescriptorLayout layout = graphics->createDescriptorLayout(materialName + "Layout");
|
||||
Gfx::ODescriptorLayout layout = graphics->createDescriptorLayout(materialName + "Layout");
|
||||
//Shader file needs to conform to the slang standard, which prohibits _
|
||||
materialName.erase(std::remove(materialName.begin(), materialName.end(), '_'), materialName.end());
|
||||
materialName.erase(std::remove(materialName.begin(), materialName.end(), '.'), materialName.end());
|
||||
@@ -50,19 +52,18 @@ void MaterialLoader::import(MaterialImportArgs args, PMaterialAsset asset)
|
||||
uint32 uniformBufferOffset = 0;
|
||||
uint32 bindingCounter = 0; // Uniform buffers are always binding 0
|
||||
uint32 uniformBinding = -1;
|
||||
Map<int32, PShaderExpression> expressions;
|
||||
int32 key = 0;
|
||||
int32 auxKey = -1;
|
||||
Map<std::string, PShaderParameter> parameters;
|
||||
for(auto param : j["params"].items())
|
||||
Map<std::string, OShaderExpression> expressions;
|
||||
uint32 key = 0;
|
||||
uint32 auxKey = 0;
|
||||
Array<std::string> parameters;
|
||||
for(auto& param : j["params"].items())
|
||||
{
|
||||
std::string type = param.value()["type"].get<std::string>();
|
||||
auto defaultValue = param.value().find("default");
|
||||
// TODO: ALIGNMENT RULES
|
||||
if(type.compare("float") == 0)
|
||||
{
|
||||
PFloatParameter p = new FloatParameter(param.key(), uniformBufferOffset, 0);
|
||||
p->key = auxKey;
|
||||
OFloatParameter p = new FloatParameter(param.key(), uniformBufferOffset, 0);
|
||||
if(uniformBinding == -1)
|
||||
{
|
||||
layout->addDescriptorBinding(bindingCounter, Gfx::SE_DESCRIPTOR_TYPE_UNIFORM_BUFFER);
|
||||
@@ -73,14 +74,13 @@ void MaterialLoader::import(MaterialImportArgs args, PMaterialAsset asset)
|
||||
{
|
||||
p->data = std::stof(defaultValue.value().get<std::string>());
|
||||
}
|
||||
expressions[auxKey--] = p;
|
||||
parameters[param.key()] = p;
|
||||
parameters.add(p->key);
|
||||
expressions[p->key] = std::move(p);
|
||||
}
|
||||
// TODO: ALIGNMENT RULES
|
||||
else if(type.compare("float3") == 0)
|
||||
{
|
||||
PVectorParameter p = new VectorParameter(param.key(), uniformBufferOffset, 0);
|
||||
p->key = auxKey;
|
||||
OVectorParameter p = new VectorParameter(param.key(), uniformBufferOffset, 0);
|
||||
if(uniformBinding == -1)
|
||||
{
|
||||
layout->addDescriptorBinding(bindingCounter, Gfx::SE_DESCRIPTOR_TYPE_UNIFORM_BUFFER);
|
||||
@@ -91,13 +91,12 @@ void MaterialLoader::import(MaterialImportArgs args, PMaterialAsset asset)
|
||||
{
|
||||
p->data = parseVector(defaultValue.value().get<std::string>().c_str());
|
||||
}
|
||||
expressions[auxKey--] = p;
|
||||
parameters[param.key()] = p;
|
||||
parameters.add(p->key);
|
||||
expressions[p->key] = std::move(p);
|
||||
}
|
||||
else if(type.compare("Texture2D") == 0)
|
||||
{
|
||||
PTextureParameter p = new TextureParameter(param.key(), 0, bindingCounter);
|
||||
p->key = auxKey;
|
||||
OTextureParameter p = new TextureParameter(param.key(), 0, bindingCounter);
|
||||
layout->addDescriptorBinding(bindingCounter++, Gfx::SE_DESCRIPTOR_TYPE_SAMPLED_IMAGE);
|
||||
if(defaultValue != param.value().end())
|
||||
{
|
||||
@@ -108,17 +107,16 @@ void MaterialLoader::import(MaterialImportArgs args, PMaterialAsset asset)
|
||||
{
|
||||
p->data = AssetRegistry::findTexture(""); // this will return placeholder texture
|
||||
}
|
||||
expressions[auxKey--] = p;
|
||||
parameters[param.key()] = p;
|
||||
parameters.add(p->key);
|
||||
expressions[p->key] = std::move(p);
|
||||
}
|
||||
else if(type.compare("SamplerState") == 0)
|
||||
{
|
||||
PSamplerParameter p = new SamplerParameter(param.key(), 0, bindingCounter);
|
||||
p->key = auxKey;
|
||||
OSamplerParameter p = new SamplerParameter(param.key(), 0, bindingCounter);
|
||||
layout->addDescriptorBinding(bindingCounter++, Gfx::SE_DESCRIPTOR_TYPE_SAMPLER);
|
||||
p->data = graphics->createSamplerState({});
|
||||
expressions[auxKey--] = p;
|
||||
parameters[param.key()] = p;
|
||||
parameters.add(p->key);
|
||||
expressions[p->key] = std::move(p);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -126,99 +124,100 @@ void MaterialLoader::import(MaterialImportArgs args, PMaterialAsset asset)
|
||||
}
|
||||
}
|
||||
uint32 uniformDataSize = uniformBufferOffset;
|
||||
auto referenceExpression = [&auxKey, &expressions](json obj) -> PShaderExpression
|
||||
auto referenceExpression = [&auxKey, &expressions](json obj) -> std::string
|
||||
{
|
||||
if(obj.is_string())
|
||||
{
|
||||
PConstantExpression c = new ConstantExpression(obj.get<std::string>(), ExpressionType::UNKNOWN);
|
||||
c->key = auxKey;
|
||||
expressions[auxKey--] = c;
|
||||
return c;
|
||||
std::string str = obj.get<std::string>();
|
||||
if (expressions.contains(str))
|
||||
{
|
||||
return str;
|
||||
}
|
||||
OConstantExpression c = new ConstantExpression(str, ExpressionType::UNKNOWN);
|
||||
std::string name = std::format("Const{0}", auxKey++);
|
||||
c->key = name;
|
||||
expressions[c->key] = std::move(c);
|
||||
return name;
|
||||
}
|
||||
else
|
||||
{
|
||||
return expressions[obj.get<uint32>()];
|
||||
return std::format("{0}", obj.get<uint32>());
|
||||
}
|
||||
};
|
||||
MaterialNode mat;
|
||||
|
||||
for(auto param : j["code"].items())
|
||||
for(auto& param : j["code"].items())
|
||||
{
|
||||
auto obj = param.value();
|
||||
auto& obj = param.value();
|
||||
std::string exp = obj["exp"].get<std::string>();
|
||||
if(exp.compare("Add") == 0)
|
||||
{
|
||||
PAddExpression p = new AddExpression();
|
||||
p->key = key;
|
||||
p->inputs["lhs"].source = referenceExpression(obj["lhs"])->key;
|
||||
p->inputs["rhs"].source = referenceExpression(obj["rhs"])->key;
|
||||
expressions[key++] = p;
|
||||
OAddExpression p = new AddExpression();
|
||||
std::string name = std::format("{0}", key++);
|
||||
p->key = name;
|
||||
p->inputs["lhs"].source = referenceExpression(obj["lhs"]);
|
||||
p->inputs["rhs"].source = referenceExpression(obj["rhs"]);
|
||||
expressions[name] = std::move(p);
|
||||
}
|
||||
if(exp.compare("Sub") == 0)
|
||||
{
|
||||
PSubExpression p = new SubExpression();
|
||||
p->key = key;
|
||||
p->inputs["lhs"].source = referenceExpression(obj["lhs"])->key;
|
||||
p->inputs["rhs"].source = referenceExpression(obj["rhs"])->key;
|
||||
expressions[key++] = p;
|
||||
OSubExpression p = new SubExpression();
|
||||
std::string name = std::format("{0}", key++);
|
||||
p->key = name;
|
||||
p->inputs["lhs"].source = referenceExpression(obj["lhs"]);
|
||||
p->inputs["rhs"].source = referenceExpression(obj["rhs"]);
|
||||
expressions[name] = std::move(p);
|
||||
}
|
||||
if(exp.compare("Mul") == 0)
|
||||
{
|
||||
PMulExpression p = new MulExpression();
|
||||
p->key = key;
|
||||
p->inputs["lhs"].source = referenceExpression(obj["lhs"])->key;
|
||||
p->inputs["rhs"].source = referenceExpression(obj["rhs"])->key;
|
||||
expressions[key++] = p;
|
||||
OMulExpression p = new MulExpression();
|
||||
std::string name = std::format("{0}", key++);
|
||||
p->key = name;
|
||||
p->inputs["lhs"].source = referenceExpression(obj["lhs"]);
|
||||
p->inputs["rhs"].source = referenceExpression(obj["rhs"]);
|
||||
expressions[name] = std::move(p);
|
||||
}
|
||||
if(exp.compare("Swizzle") == 0)
|
||||
{
|
||||
PSwizzleExpression p = new SwizzleExpression();
|
||||
p->key = key;
|
||||
p->inputs["target"].source = referenceExpression(obj["target"])->key;
|
||||
OSwizzleExpression p = new SwizzleExpression();
|
||||
std::string name = std::format("{0}", key);
|
||||
p->key = name;
|
||||
p->inputs["target"].source = referenceExpression(obj["target"]);
|
||||
int32 i = 0;
|
||||
for(auto c : obj["comp"].items())
|
||||
for(auto& c : obj["comp"].items())
|
||||
{
|
||||
p->comp[i++] = c.value().get<uint32>();
|
||||
}
|
||||
expressions[key++] = p;
|
||||
expressions[name] = std::move(p);
|
||||
}
|
||||
if(exp.compare("Sample") == 0)
|
||||
{
|
||||
PSampleExpression p = new SampleExpression();
|
||||
p->key = key;
|
||||
p->inputs["texture"].source = parameters[obj["texture"].get<std::string>()]->key;
|
||||
p->inputs["sampler"].source = parameters[obj["sampler"].get<std::string>()]->key;
|
||||
p->inputs["coords"].source = referenceExpression(obj["coords"])->key;
|
||||
expressions[key++] = p;
|
||||
OSampleExpression p = new SampleExpression();
|
||||
std::string name = std::format("{0}", key);
|
||||
p->key = name;
|
||||
p->inputs["texture"].source = referenceExpression(obj["texture"]);
|
||||
p->inputs["sampler"].source = referenceExpression(obj["sampler"]);
|
||||
p->inputs["coords"].source = referenceExpression(obj["coords"]);
|
||||
expressions[name] = std::move(p);
|
||||
}
|
||||
if(exp.compare("BRDF") == 0)
|
||||
{
|
||||
mat.profile = obj["profile"].get<std::string>();
|
||||
for(auto val : obj["values"].items())
|
||||
for(auto& val : obj["values"].items())
|
||||
{
|
||||
mat.variables[val.key()] = referenceExpression(val.value());
|
||||
mat.variables[val.key()] = val.value();
|
||||
}
|
||||
}
|
||||
}
|
||||
layout->create();
|
||||
Array<PShaderExpression> codeExp;
|
||||
for(const auto& [_, e] : expressions)
|
||||
{
|
||||
codeExp.add(e);
|
||||
}
|
||||
Array<PShaderParameter> params;
|
||||
for(const auto& [_, p] : parameters)
|
||||
{
|
||||
params.add(p);
|
||||
}
|
||||
asset->material = new Material(
|
||||
graphics,
|
||||
std::move(params),
|
||||
std::move(layout),
|
||||
uniformDataSize,
|
||||
uniformBinding,
|
||||
materialName,
|
||||
std::move(codeExp),
|
||||
std::move(expressions),
|
||||
std::move(parameters),
|
||||
std::move(mat)
|
||||
);
|
||||
|
||||
|
||||
@@ -33,10 +33,11 @@ void MeshLoader::importAsset(MeshImportArgs args)
|
||||
{
|
||||
std::filesystem::path assetPath = args.filePath.filename();
|
||||
assetPath.replace_extension("asset");
|
||||
PMeshAsset asset = new MeshAsset(args.importPath, assetPath.stem().string());
|
||||
OMeshAsset asset = new MeshAsset(args.importPath, assetPath.stem().string());
|
||||
PMeshAsset ref = asset;
|
||||
asset->setStatus(Asset::Status::Loading);
|
||||
AssetRegistry::get().registerMesh(asset);
|
||||
import(args, asset);
|
||||
AssetRegistry::get().registerMesh(std::move(asset));
|
||||
import(args, ref);
|
||||
}
|
||||
|
||||
void MeshLoader::loadMaterials(const aiScene* scene, const std::string& baseName, const std::filesystem::path& meshDirectory, const std::string& importPath, Array<PMaterialAsset>& globalMaterials)
|
||||
@@ -133,7 +134,7 @@ void findMeshRoots(aiNode *node, List<aiNode *> &meshNodes)
|
||||
}
|
||||
}
|
||||
|
||||
void MeshLoader::loadGlobalMeshes(const aiScene* scene, const Array<PMaterialAsset>& materials, Array<PMesh>& globalMeshes, Component::Collider& collider)
|
||||
void MeshLoader::loadGlobalMeshes(const aiScene* scene, const Array<PMaterialAsset>& materials, Array<OMesh>& globalMeshes, Component::Collider& collider)
|
||||
{
|
||||
for (uint32 meshIndex = 0; meshIndex < scene->mNumMeshes; ++meshIndex)
|
||||
{
|
||||
@@ -318,20 +319,22 @@ void MeshLoader::import(MeshImportArgs args, PMeshAsset meshAsset)
|
||||
loadTextures(scene, args.filePath.parent_path(), args.importPath);
|
||||
loadMaterials(scene, args.filePath.stem().string(), args.filePath.parent_path(), args.importPath, globalMaterials);
|
||||
|
||||
Array<PMesh> globalMeshes(scene->mNumMeshes);
|
||||
Array<OMesh> globalMeshes(scene->mNumMeshes);
|
||||
Component::Collider collider;
|
||||
loadGlobalMeshes(scene, globalMaterials, globalMeshes, collider);
|
||||
|
||||
List<aiNode *> meshNodes;
|
||||
findMeshRoots(scene->mRootNode, meshNodes);
|
||||
|
||||
Array<OMesh> meshes;
|
||||
for (auto meshNode : meshNodes)
|
||||
{
|
||||
for(uint32 i = 0; i < meshNode->mNumMeshes; ++i)
|
||||
{
|
||||
meshAsset->addMesh(globalMeshes[meshNode->mMeshes[i]]);
|
||||
meshes.add(std::move(globalMeshes[meshNode->mMeshes[i]]));
|
||||
}
|
||||
}
|
||||
meshAsset->meshes = std::move(meshes);
|
||||
meshAsset->physicsMesh = std::move(collider);
|
||||
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ public:
|
||||
private:
|
||||
void loadMaterials(const aiScene* scene, const std::string& baseName, const std::filesystem::path& meshDirectory, const std::string& importPath, Array<PMaterialAsset>& globalMaterials);
|
||||
void loadTextures(const aiScene* scene, const std::filesystem::path& meshDirectory, const std::string& importPath);
|
||||
void loadGlobalMeshes(const aiScene* scene, const Array<PMaterialAsset>& materials, Array<PMesh>& globalMeshes, Component::Collider& collider);
|
||||
void loadGlobalMeshes(const aiScene* scene, const Array<PMaterialAsset>& materials, Array<OMesh>& globalMeshes, Component::Collider& collider);
|
||||
void convertAssimpARGB(unsigned char* dst, aiTexel* src, uint32 numPixels);
|
||||
|
||||
void import(MeshImportArgs args, PMeshAsset meshAsset);
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#include "Asset/TextureAsset.h"
|
||||
#include "Graphics/Graphics.h"
|
||||
#include "Asset/AssetRegistry.h"
|
||||
#include "Graphics/Vulkan/VulkanGraphicsEnums.h"
|
||||
#include "Graphics/Vulkan/Enums.h"
|
||||
#define STB_IMAGE_IMPLEMENTATION
|
||||
#include <stb_image.h>
|
||||
#define STB_IMAGE_WRITE_IMPLEMENTATION
|
||||
@@ -14,15 +14,13 @@ using namespace Seele;
|
||||
TextureLoader::TextureLoader(Gfx::PGraphics graphics)
|
||||
: graphics(graphics)
|
||||
{
|
||||
//(std::filesystem::absolute("./textures/placeholder.ktx"));
|
||||
//placeholderAsset->load(graphics);
|
||||
//AssetRegistry::get().assetRoot.textures[""] = placeholderAsset;
|
||||
placeholderAsset = new TextureAsset();
|
||||
OTextureAsset placeholder = new TextureAsset();
|
||||
placeholderAsset = placeholder;
|
||||
import(TextureImportArgs{
|
||||
.filePath = std::filesystem::absolute("./textures/placeholder.png"),
|
||||
.importPath = "",
|
||||
}, placeholderAsset);
|
||||
AssetRegistry::get().assetRoot->textures[""] = placeholderAsset;
|
||||
AssetRegistry::get().assetRoot->textures[""] = std::move(placeholder);
|
||||
}
|
||||
|
||||
TextureLoader::~TextureLoader()
|
||||
@@ -33,11 +31,12 @@ void TextureLoader::importAsset(TextureImportArgs args)
|
||||
{
|
||||
std::filesystem::path assetPath = args.filePath.filename();
|
||||
assetPath.replace_extension("asset");
|
||||
PTextureAsset asset = new TextureAsset(args.importPath, assetPath.stem().string());
|
||||
|
||||
OTextureAsset asset = new TextureAsset(args.importPath, assetPath.stem().string());
|
||||
PTextureAsset ref = asset;
|
||||
asset->setStatus(Asset::Status::Loading);
|
||||
asset->setTexture(placeholderAsset->getTexture());
|
||||
AssetRegistry::get().registerTexture(asset);
|
||||
import(args, asset);
|
||||
AssetRegistry::get().registerTexture(std::move(asset));
|
||||
import(args, ref);
|
||||
}
|
||||
|
||||
PTextureAsset TextureLoader::getPlaceholderTexture()
|
||||
|
||||
@@ -11,13 +11,13 @@ using namespace Seele::Editor;
|
||||
|
||||
InspectorView::InspectorView(Gfx::PGraphics graphics, PWindow window, const ViewportCreateInfo &createInfo)
|
||||
: View(graphics, std::move(window), std::move(createInfo), "InspectorView")
|
||||
, renderGraph(RenderGraphBuilder::build(
|
||||
UIPass(graphics),
|
||||
TextPass(graphics)
|
||||
))
|
||||
//, renderGraph(RenderGraphBuilder::build(
|
||||
// UIPass(graphics),
|
||||
// TextPass(graphics)
|
||||
//))
|
||||
, uiSystem(new UI::System())
|
||||
{
|
||||
renderGraph.updateViewport(viewport);
|
||||
//renderGraph.updateViewport(viewport);
|
||||
uiSystem->updateViewport(viewport);
|
||||
}
|
||||
|
||||
@@ -41,15 +41,11 @@ void InspectorView::commitUpdate()
|
||||
|
||||
void InspectorView::prepareRender()
|
||||
{
|
||||
renderGraph.updatePassData(
|
||||
uiSystem->getUIPassData(),
|
||||
uiSystem->getTextPassData()
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
void InspectorView::render()
|
||||
{
|
||||
renderGraph.render(uiSystem->getVirtualCamera());
|
||||
}
|
||||
|
||||
void InspectorView::keyCallback(KeyCode, InputAction, KeyModifier)
|
||||
|
||||
@@ -24,12 +24,6 @@ public:
|
||||
virtual void render() override;
|
||||
void selectActor();
|
||||
protected:
|
||||
RenderGraph<
|
||||
UIPass,
|
||||
TextPass> renderGraph;
|
||||
|
||||
UIPassData uiPassData;
|
||||
TextPassData textPassData;
|
||||
|
||||
UI::PSystem uiSystem;
|
||||
PActor selectedActor;
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
#include "Asset/AssetRegistry.h"
|
||||
#include "Actor/CameraActor.h"
|
||||
#include "Component/Camera.h"
|
||||
#include "Component/StaticMesh.h"
|
||||
#include "Component/Mesh.h"
|
||||
|
||||
using namespace Seele;
|
||||
using namespace Seele::Editor;
|
||||
@@ -16,9 +16,9 @@ SceneView::SceneView(Gfx::PGraphics graphics, PWindow owner, const ViewportCreat
|
||||
: View(graphics, owner, createInfo, "SceneView")
|
||||
, scene(new Scene(graphics))
|
||||
, renderGraph(RenderGraphBuilder::build(
|
||||
DepthPrepass(graphics),
|
||||
LightCullingPass(graphics),
|
||||
BasePass(graphics)
|
||||
DepthPrepass(graphics, scene),
|
||||
LightCullingPass(graphics, scene),
|
||||
BasePass(graphics, scene)
|
||||
))
|
||||
, cameraSystem(createInfo.dimensions, Vector(0, 0, 10))
|
||||
{
|
||||
@@ -49,14 +49,10 @@ void SceneView::update()
|
||||
|
||||
void SceneView::commitUpdate()
|
||||
{
|
||||
depthPrepassData.staticDrawList = scene->getStaticMeshes();
|
||||
lightCullingPassData.lightEnv = scene->getLightBuffer();
|
||||
basePassData.staticDrawList = scene->getStaticMeshes();
|
||||
}
|
||||
|
||||
void SceneView::prepareRender()
|
||||
{
|
||||
renderGraph.updatePassData(depthPrepassData, lightCullingPassData, basePassData);
|
||||
}
|
||||
|
||||
void SceneView::render()
|
||||
|
||||
@@ -26,7 +26,7 @@ public:
|
||||
|
||||
PScene getScene() const { return scene; }
|
||||
private:
|
||||
PScene scene;
|
||||
OScene scene;
|
||||
Component::Camera viewportCamera;
|
||||
|
||||
RenderGraph<
|
||||
@@ -34,10 +34,6 @@ private:
|
||||
LightCullingPass,
|
||||
BasePass> renderGraph;
|
||||
|
||||
DepthPrepassData depthPrepassData;
|
||||
LightCullingPassData lightCullingPassData;
|
||||
BasePassData basePassData;
|
||||
|
||||
dp::thread_pool<> pool;
|
||||
ViewportControl cameraSystem;
|
||||
|
||||
|
||||
@@ -2,6 +2,9 @@
|
||||
#include "MinimalEngine.h"
|
||||
#include "Math/Vector.h"
|
||||
#include "Component/Camera.h"
|
||||
#include "Math/Math.h"
|
||||
#include "Graphics/Enums.h"
|
||||
#include "Containers/Array.h"
|
||||
|
||||
namespace Seele
|
||||
{
|
||||
|
||||
+2
-2
@@ -5,7 +5,7 @@
|
||||
#include "Asset/AssetRegistry.h"
|
||||
#include "Asset/AssetImporter.h"
|
||||
#include "Asset/TextureLoader.h"
|
||||
#include "Graphics/Vulkan/VulkanGraphics.h"
|
||||
#include "Graphics/Vulkan/Graphics.h"
|
||||
#include "Asset/MeshLoader.h"
|
||||
#include "Asset/TextureLoader.h"
|
||||
#include "Asset/MaterialLoader.h"
|
||||
@@ -25,7 +25,7 @@ int main()
|
||||
std::string sourcePath = "C:/Users/Dynamitos/TrackClear/";
|
||||
std::string binaryPath = "C:/Users/Dynamitos/TrackClear/bin/TrackClear.dll";
|
||||
|
||||
Gfx::PGraphics graphics = new Vulkan::Graphics();
|
||||
Gfx::OGraphics graphics = new Vulkan::Graphics();
|
||||
|
||||
GraphicsInitializer initializer;
|
||||
graphics->init(initializer);
|
||||
|
||||
Reference in New Issue
Block a user