testing game export
This commit is contained in:
@@ -6,6 +6,8 @@ target_sources(Engine
|
||||
AssetRegistry.cpp
|
||||
FontAsset.h
|
||||
FontAsset.cpp
|
||||
LevelAsset.h
|
||||
LevelAsset.cpp
|
||||
MaterialAsset.h
|
||||
MaterialAsset.cpp
|
||||
MaterialInstanceAsset.h
|
||||
@@ -21,6 +23,7 @@ target_sources(Engine
|
||||
Asset.h
|
||||
AssetRegistry.h
|
||||
FontAsset.h
|
||||
LevelAsset.h
|
||||
MaterialAsset.h
|
||||
MaterialInstanceAsset.h
|
||||
MeshAsset.h
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
#include "LevelAsset.h"
|
||||
|
||||
using namespace Seele;
|
||||
|
||||
LevelAsset::LevelAsset()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
LevelAsset::LevelAsset(std::string_view folderPath, std::string_view name)
|
||||
: Asset(folderPath, name)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
LevelAsset::~LevelAsset()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void LevelAsset::save(ArchiveBuffer& buffer) const
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void LevelAsset::load(ArchiveBuffer& buffer)
|
||||
{
|
||||
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
#pragma once
|
||||
#include "Asset.h"
|
||||
|
||||
namespace Seele
|
||||
{
|
||||
class LevelAsset : public Asset
|
||||
{
|
||||
public:
|
||||
static constexpr uint64 IDENTIFIER = 0x20;
|
||||
LevelAsset();
|
||||
LevelAsset(std::string_view folderPath, std::string_view name);
|
||||
virtual ~LevelAsset();
|
||||
virtual void save(ArchiveBuffer& buffer) const override;
|
||||
virtual void load(ArchiveBuffer& buffer) override;
|
||||
private:
|
||||
|
||||
};
|
||||
} // namespace Seele
|
||||
@@ -188,10 +188,10 @@ void LightCullingPass::publishOutputs()
|
||||
resources->registerBufferOutput("LIGHTCULLING_OLIGHTLIST", oLightIndexList);
|
||||
resources->registerBufferOutput("LIGHTCULLING_TLIGHTLIST", tLightIndexList);
|
||||
|
||||
resources->registerBufferOutput("DIRECTIONAL_LIGHTS", directLightBuffer);
|
||||
resources->registerUniformOutput("NUM_DIRECTIONAL_LIGHTS", numDirLightBuffer);
|
||||
resources->registerBufferOutput("POINT_LIGHTS", pointLightBuffer);
|
||||
resources->registerUniformOutput("NUM_POINT_LIGHTS", numPointLightBuffer);
|
||||
resources->registerBufferOutput("DIRECTIONAL_LIGHTS", passData.lightEnv.directionalLights);
|
||||
resources->registerUniformOutput("NUM_DIRECTIONAL_LIGHTS", passData.lightEnv.numDirectional);
|
||||
resources->registerBufferOutput("POINT_LIGHTS", passData.lightEnv.pointLights);
|
||||
resources->registerUniformOutput("NUM_POINT_LIGHTS", passData.lightEnv.numPoints);
|
||||
|
||||
TextureCreateInfo textureInfo = {
|
||||
.width = dispatchParams.numThreadGroups.x,
|
||||
|
||||
@@ -105,15 +105,37 @@ Array<MeshBatch> Scene::getStaticMeshes()
|
||||
return result;
|
||||
}
|
||||
|
||||
LightEnv Scene::getLightBuffer() const
|
||||
LightEnv Scene::getLightBuffer()
|
||||
{
|
||||
result.directionalLights[0].color = Vector4(0.4, 0.3, 0.5, 1.0);
|
||||
result.directionalLights[0].direction = Vector4(0.5, -0.5, 0, 0);
|
||||
result.numDirectionalLights = 0;
|
||||
result.pointLights[0].positionWS = Vector4(0, 50, 0, 0);
|
||||
result.pointLights[0].colorRange = Vector4(0.2, 0.4, 0.7, 100);
|
||||
result.numPointLights = 1;
|
||||
return result;
|
||||
StaticArray<DirectionalLight, MAX_DIRECTIONAL_LIGHTS> dirLights;
|
||||
uint32 numDirLights;
|
||||
for(auto&& [entity, light] : registry.view<DirectionalLight>().each())
|
||||
{
|
||||
dirLights[numDirLights++] = light;
|
||||
}
|
||||
lightEnv.directionalLights->updateContents({
|
||||
.size = sizeof(DirectionalLight) * numDirLights,
|
||||
.data = (uint8*)dirLights.data(),
|
||||
});
|
||||
lightEnv.numDirectional->updateContents({
|
||||
.size = sizeof(uint32),
|
||||
.data = (uint8*)&numDirLights,
|
||||
});
|
||||
StaticArray<PointLight, MAX_POINT_LIGHTS> pointLights;
|
||||
uint32 numPointLights;
|
||||
for(auto&& [entity, light] : registry.view<PointLight>().each())
|
||||
{
|
||||
pointLights[numPointLights++] = light;
|
||||
}
|
||||
lightEnv.pointLights->updateContents({
|
||||
.size = sizeof(PointLight) * numPointLights,
|
||||
.data = (uint8*)pointLights.data(),
|
||||
});
|
||||
lightEnv.numPoints->updateContents({
|
||||
.size = sizeof(uint32),
|
||||
.data = (uint8*)&numPointLights,
|
||||
});
|
||||
return lightEnv;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -69,7 +69,7 @@ public:
|
||||
registry.view<Component>().each(func);
|
||||
}
|
||||
Array<MeshBatch> getStaticMeshes();
|
||||
LightEnv getLightBuffer() const;
|
||||
LightEnv getLightBuffer();
|
||||
Component::Skybox getSkybox();
|
||||
Gfx::PStructuredBuffer getSceneDataBuffer() const { return sceneDataBuffer; }
|
||||
Gfx::PGraphics getGraphics() const { return graphics; }
|
||||
|
||||
Reference in New Issue
Block a user