Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ParticleSystem #415

Merged
merged 91 commits into from
Mar 4, 2024
Merged
Show file tree
Hide file tree
Changes from 85 commits
Commits
Show all changes
91 commits
Select commit Hold shift + click to select a range
613b047
particleSystem and nodeTest
OVOAOVO Sep 14, 2023
08da43d
change init
OVOAOVO Sep 15, 2023
d710339
shader forgeted
OVOAOVO Sep 16, 2023
640c22a
conflict
OVOAOVO Sep 16, 2023
f228d98
texture
OVOAOVO Sep 20, 2023
3c4d799
texturec.exe change?
OVOAOVO Sep 20, 2023
7dfbd94
untrack
OVOAOVO Sep 20, 2023
c7c0244
conflict
OVOAOVO Sep 20, 2023
6cbb342
back AABB sor...
OVOAOVO Sep 20, 2023
3ab4b93
cancle link
OVOAOVO Sep 21, 2023
8517b7a
emit pos
OVOAOVO Sep 21, 2023
05d8e99
precision quadrilateral
OVOAOVO Sep 21, 2023
78eff11
bufferupdate judge and rotate
OVOAOVO Sep 25, 2023
6158453
Merge branch 'main' of https://github.com/CatDogEngine/CatDogEngine
OVOAOVO Sep 25, 2023
96b5fd4
Merge branch 'main' into particle_and_nodeTest
OVOAOVO Sep 25, 2023
a5ecd92
merge main
OVOAOVO Sep 25, 2023
0f9cd99
conflict
OVOAOVO Sep 25, 2023
a280fef
chunk
OVOAOVO Oct 13, 2023
c64a299
Merge branch 'main' of https://github.com/CatDogEngine/CatDogEngine
OVOAOVO Oct 13, 2023
edf2fef
remove chunk
OVOAOVO Oct 14, 2023
8a00b0c
remove! chunk
OVOAOVO Oct 14, 2023
fce058e
no actually value
OVOAOVO Oct 25, 2023
72a4c84
Merge branch 'main' of https://github.com/CatDogEngine/CatDogEngine
OVOAOVO Oct 25, 2023
2677d33
conflict
OVOAOVO Oct 25, 2023
43de71b
test new lazy shader
OVOAOVO Oct 25, 2023
b8854c4
instancing
OVOAOVO Nov 1, 2023
f7cac2d
add color
OVOAOVO Nov 3, 2023
a08d819
Merge branch 'main' into particle_and_nodeTest
OVOAOVO Nov 3, 2023
c8e5d6a
fix branch
OVOAOVO Nov 3, 2023
5df948c
num(bug) scale(bug) rotate
OVOAOVO Nov 27, 2023
bce5782
reset branch
OVOAOVO Nov 27, 2023
b0cfccf
conflict fix
OVOAOVO Nov 27, 2023
6f2b2a8
rerun sdl2.dll test
OVOAOVO Nov 27, 2023
682f53c
emitter fixed(without speed fix)
OVOAOVO Nov 29, 2023
00498f1
merge shader
OVOAOVO Nov 29, 2023
c09a157
coding style fix
OVOAOVO Dec 7, 2023
c9c74a7
ParticlePool Rebuild
OVOAOVO Dec 11, 2023
f21e667
Merge branch 'main' into particle_and_nodeTest
OVOAOVO Dec 11, 2023
869730b
assetPipline Reback
OVOAOVO Dec 11, 2023
e7696f6
Assetpipline Reback
OVOAOVO Dec 11, 2023
3f35fa8
Runtime Verison
OVOAOVO Dec 12, 2023
912e264
Creating multiple particles fixed
OVOAOVO Dec 12, 2023
5683dc0
branch test
OVOAOVO Dec 12, 2023
4b765da
add num option
OVOAOVO Dec 13, 2023
4fbcc30
conflict
OVOAOVO Dec 13, 2023
671db31
color picker reAdd
OVOAOVO Dec 13, 2023
c7867f5
assetpipline update
OVOAOVO Dec 18, 2023
a84d286
Merge branch 'main' into particle_and_nodeTest
OVOAOVO Dec 18, 2023
2390e16
follow macros
OVOAOVO Dec 18, 2023
575279e
Merge branch 'main' into particle_and_nodeTest
OVOAOVO Dec 20, 2023
015962a
add mesh
OVOAOVO Dec 26, 2023
38b9989
AssetPipeline index fixed
OVOAOVO Dec 26, 2023
1aa7063
fixed ECworld particle id
OVOAOVO Dec 26, 2023
81b0277
add scale
OVOAOVO Dec 27, 2023
f57041e
transform component fixd
OVOAOVO Dec 27, 2023
6892173
format fix
OVOAOVO Dec 27, 2023
be3e8a5
Type Fixed
OVOAOVO Jan 2, 2024
c5e8226
Ribbon first
OVOAOVO Jan 2, 2024
bc2ee8f
billboard
OVOAOVO Jan 3, 2024
88046c5
billboard fixed
OVOAOVO Jan 5, 2024
4909296
shader billboard(bug)
OVOAOVO Jan 9, 2024
49f2825
Box Emitter Shape
OVOAOVO Jan 9, 2024
1209206
base ForceField (need fix and update)
OVOAOVO Jan 11, 2024
3805e61
confict fix
OVOAOVO Jan 11, 2024
bcfdb25
assetpipline follow
OVOAOVO Jan 15, 2024
a202866
Merge branch 'main' into particle_and_nodeTest
OVOAOVO Jan 15, 2024
c36e9e1
asset pipline follow
OVOAOVO Jan 15, 2024
f4e46f4
assetpipline update
OVOAOVO Jan 15, 2024
5d7cc9a
DeleteEmitterShapeRenderer
OVOAOVO Jan 16, 2024
728a4b8
remove EmitterShapeRenderer.h
OVOAOVO Jan 16, 2024
86e75e4
dynamic vertex to vertex
OVOAOVO Jan 18, 2024
d9e790f
texture reback
OVOAOVO Jan 22, 2024
22005b8
ImGuiUtil.hpp follow main
OVOAOVO Jan 22, 2024
ca005ee
Fixes #448 (#455)
t0xxxic Jan 23, 2024
b130697
new billboard(bug)
OVOAOVO Feb 20, 2024
0c6c90e
Billboard fixed
OVOAOVO Feb 21, 2024
d02d4a4
update AssetPipeline
OVOAOVO Feb 21, 2024
c953111
merged main
OVOAOVO Feb 21, 2024
6399646
conflict fix
OVOAOVO Feb 21, 2024
6696528
force field range
OVOAOVO Feb 21, 2024
65e43e4
add uber shader(.vs not support)
OVOAOVO Feb 29, 2024
9cf0121
update Assetpipline
OVOAOVO Feb 29, 2024
5b501e6
merge main
OVOAOVO Feb 29, 2024
2f1fc90
conflict fixed
OVOAOVO Feb 29, 2024
8651b1d
add random control
OVOAOVO Mar 1, 2024
88e3e9c
EC World fixed
OVOAOVO Mar 1, 2024
bf8fffa
fixed style
OVOAOVO Mar 1, 2024
0c79af7
Merge https://github.com/CatDogEngine/CatDogEngine into particle_and_…
T-rvw Mar 3, 2024
77a546c
refine
T-rvw Mar 3, 2024
8d88402
revert texturec
T-rvw Mar 3, 2024
ef9e901
Use MeshUtils.hpp to vb ib
OVOAOVO Mar 4, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions Engine/BuiltInShaders/shaders/fs_particle.sc
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
$input v_color0, v_texcoord0
#include "../common/common.sh"

SAMPLER2D(s_texColor, 0);

void main()
{
vec4 rgba = texture2D(s_texColor, v_texcoord0.xy);

rgba.xyz = rgba.xyz * v_color0.xyz;
rgba.w = rgba.w * v_color0.w;
gl_FragColor = rgba;
}
6 changes: 6 additions & 0 deletions Engine/BuiltInShaders/shaders/fs_particleEmitterShape.sc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#include "../common/common.sh"

void main()
{
gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);
}
6 changes: 6 additions & 0 deletions Engine/BuiltInShaders/shaders/fs_particleforcefield.sc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#include "../common/common.sh"

void main()
{
gl_FragColor = vec4(0.0, 1.0, 1.0, 1.0);
}
13 changes: 13 additions & 0 deletions Engine/BuiltInShaders/shaders/fs_wo_billboardparticle.sc
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
$input v_color0, v_texcoord0
#include "../common/common.sh"

SAMPLER2D(s_texColor, 0);

void main()
{
vec4 rgba = texture2D(s_texColor, v_texcoord0.xy);

rgba.xyz = rgba.xyz * v_color0.xyz;
rgba.w = rgba.w * v_color0.w;
gl_FragColor = rgba;
}
8 changes: 7 additions & 1 deletion Engine/BuiltInShaders/shaders/varying.def.sc
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,10 @@ vec2 a_texcoord0 : TEXCOORD0;
vec4 a_color0 : COLOR0;
vec4 a_color1 : COLOR1;
ivec4 a_indices : BLENDINDICES;
vec4 a_weight : BLENDWEIGHT;
vec4 a_weight : BLENDWEIGHT;

vec4 i_data0 : TEXCOORD7;
vec4 i_data1 : TEXCOORD6;
vec4 i_data2 : TEXCOORD5;
vec4 i_data3 : TEXCOORD4;
vec4 i_data4 : TEXCOORD3;
30 changes: 30 additions & 0 deletions Engine/BuiltInShaders/shaders/vs_particle.sc
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#if defined(PARTICLEINSTANCE)
$input a_position, a_color0, a_texcoord0, i_data0, i_data1 ,i_data2 ,i_data3 ,i_data4
$output v_color0, v_texcoord0

#include "../common/common.sh"

void main()
{
mat4 model = mtxFromCols(i_data0, i_data1, i_data2, i_data3);

vec4 worldPos = mul(model,vec4(a_position,1.0));
gl_Position = mul(u_viewProj, worldPos);
v_color0 = a_color0*i_data4;
v_texcoord0 = a_texcoord0;
}
#else
$input a_position, a_color0, a_texcoord0
$output v_color0, v_texcoord0

#include "../common/common.sh"

uniform vec4 u_particleColor;

void main()
{
gl_Position = mul(u_modelViewProj, vec4(a_position,1.0));
v_color0 = a_color0 * u_particleColor;
v_texcoord0 = a_texcoord0;
}
#endif
10 changes: 10 additions & 0 deletions Engine/BuiltInShaders/shaders/vs_particleEmitterShape.sc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
$input a_position//, a_color1

#include "../common/common.sh"

uniform vec4 u_shapeRange;

void main()
{
gl_Position = mul(u_modelViewProj, vec4(a_position*u_shapeRange.xyz, 1.0));
}
8 changes: 8 additions & 0 deletions Engine/BuiltInShaders/shaders/vs_particleforcefield.sc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
$input a_position//, a_color1

#include "../common/common.sh"

void main()
{
gl_Position = mul(u_modelViewProj, vec4(a_position, 1.0));
}
62 changes: 62 additions & 0 deletions Engine/BuiltInShaders/shaders/vs_wo_billboardparticle.sc
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
#if defined(PARTICLEINSTANCE)
$input a_position, a_color0, a_texcoord0, i_data0, i_data1 ,i_data2 ,i_data3 ,i_data4
$output v_color0, v_texcoord0

#include "../common/common.sh"

uniform vec4 u_particlePos;
uniform vec4 u_particleScale;

void main()
{
mat4 model = mtxFromCols(i_data0, i_data1, i_data2, i_data3);

mat4 billboardMatrix;
OVOAOVO marked this conversation as resolved.
Show resolved Hide resolved
billboardMatrix[0] = vec4(
u_view[0][0]*u_particleScale.x,
u_view[1][0]*u_particleScale.x,
u_view[2][0]*u_particleScale.x,
0.0
);
billboardMatrix[1] = vec4(
u_view[0][1]*u_particleScale.y,
u_view[1][1]*u_particleScale.y,
u_view[2][1]*u_particleScale.y,
0.0
);
billboardMatrix[2] = vec4(
u_view[0][2]*u_particleScale.z,
u_view[1][2]*u_particleScale.z,
u_view[2][2]*u_particleScale.z,
0.0
);
billboardMatrix[3] = vec4(
u_particlePos.x,
u_particlePos.y,
u_particlePos.z,
1.0
);

model = mul(model,billboardMatrix);

vec4 worldPos = mul(model,vec4(a_position,1.0));
gl_Position = mul(u_viewProj, worldPos);
v_color0 = a_color0*i_data4;
v_texcoord0 = a_texcoord0;
}
#else
OVOAOVO marked this conversation as resolved.
Show resolved Hide resolved
$input a_position, a_color0, a_texcoord0
$output v_color0, v_texcoord0

#include "../common/common.sh"

uniform vec4 u_particleColor;

void main()
{

gl_Position = mul(u_modelViewProj, vec4(a_position,1.0));
v_color0 = a_color0 * u_particleColor;
v_texcoord0 = a_texcoord0;
}
#endif
Binary file modified Engine/EditorTools/Win64/texturec.exe
Binary file not shown.
65 changes: 62 additions & 3 deletions Engine/Source/Editor/ECWorld/ECWorldConsumer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,21 +74,41 @@ void ECWorldConsumer::Execute(const cd::SceneDatabase* pSceneDatabase)
}
};

auto ParseMeshWithParticles= [&](cd::MeshID meshID, const cd::ParticleEmitter& emitter)
{
engine::Entity meshEntity = m_pSceneWorld->GetWorld()->CreateEntity();

engine::MaterialType* pMaterialType = m_pSceneWorld->GetParticleMaterialType();

const auto& mesh = pSceneDatabase->GetMesh(meshID.Data());
AddParticleEmitter(meshEntity, mesh, pMaterialType->GetRequiredVertexFormat(),emitter);
};

// There are multiple kinds of cases in the SceneDatabase:
// 1. No nodes but have meshes in the SceneDatabase.
// 2. Only a root node with multiple meshes.
// 3. Node hierarchy.
// Another case is that we want to skip Node/Mesh which alreay parsed previously.
std::set<uint32_t> parsedMeshIDs;
m_particleMinID = 0;
for (const auto& mesh : pSceneDatabase->GetMeshes())
{
if (m_meshMinID > mesh.GetID().Data())
{
continue;
}

ParseMesh(mesh.GetID(), cd::Transform::Identity());
parsedMeshIDs.insert(mesh.GetID().Data());

if (pSceneDatabase->GetParticleEmitterCount())
OVOAOVO marked this conversation as resolved.
Show resolved Hide resolved
{
ParseMeshWithParticles(mesh.GetID(), pSceneDatabase->GetParticleEmitter(m_particleMinID));
parsedMeshIDs.insert(mesh.GetID().Data());
++m_particleMinID;
}
else
{
ParseMesh(mesh.GetID(), cd::Transform::Identity());
parsedMeshIDs.insert(mesh.GetID().Data());
}
}

for (const auto& node : pSceneDatabase->GetNodes())
Expand Down Expand Up @@ -398,4 +418,43 @@ void ECWorldConsumer::AddBlendShape(engine::Entity entity, const cd::Mesh* pMesh
blendShapeComponent.Build();
}

void ECWorldConsumer::AddParticleEmitter(engine::Entity entity, const cd::Mesh& mesh, const cd::VertexFormat& vertexFormat, const cd::ParticleEmitter& emitter)
{
engine::World* pWorld = m_pSceneWorld->GetWorld();
engine::MaterialType* pMaterialType = m_pSceneWorld->GetParticleMaterialType();
engine::NameComponent& nameComponent = pWorld->CreateComponent<engine::NameComponent>(entity);
nameComponent.SetName(emitter.GetName());
auto& particleEmitterComponent = pWorld->CreateComponent<engine::ParticleEmitterComponent>(entity);
// TODO : Some initialization here.
auto& transformComponent = pWorld->CreateComponent<engine::TransformComponent>(entity);
cd::Vec3f pos = emitter.GetPosition();
cd::Vec3f rotation = emitter.GetFixedRotation();
cd::Vec3f scale = emitter.GetFixedScale();
auto fixedrotation = cd::Math::RadianToDegree(rotation);
OVOAOVO marked this conversation as resolved.
Show resolved Hide resolved
cd::Quaternion rotationQuat = cd::Quaternion::FromPitchYawRoll(fixedrotation.x(), fixedrotation.y(), fixedrotation.z());
transformComponent.GetTransform().SetTranslation(pos);
transformComponent.GetTransform().SetRotation(rotationQuat);
transformComponent.GetTransform().SetScale(scale);
transformComponent.Build();

particleEmitterComponent.SetRequiredVertexFormat(&vertexFormat);
////const cd::VertexFormat *requriredVertexFormat = emitter.GetVertexFormat();
////particleEmitterComponent.SetRequiredVertexFormat(requriredVertexFormat);
////particleEmitterComponent.GetParticleSystem().Init();
if (nameof::nameof_enum(emitter.GetType()) == "Sprite") { particleEmitterComponent.SetEmitterParticleType(engine::ParticleType::Sprite); }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just use cd::ParticleType is better because they are all same:
particleEmitterComponent.SetEmitterParticleType(emitter.GetType());

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But it's not.
cd::ParticleEmitterTypeTraits::Type not suit engine::particleType

else if (nameof::nameof_enum(emitter.GetType()) == "Ribbon") { particleEmitterComponent.SetEmitterParticleType(engine::ParticleType::Ribbon); }
else if (nameof::nameof_enum(emitter.GetType()) == "Ring") { particleEmitterComponent.SetEmitterParticleType(engine::ParticleType::Ring); }
else if (nameof::nameof_enum(emitter.GetType()) == "Model") { particleEmitterComponent.SetEmitterParticleType(engine::ParticleType::Model); }
else if (nameof::nameof_enum(emitter.GetType()) == "Track") { particleEmitterComponent.SetEmitterParticleType(engine::ParticleType::Track); }

particleEmitterComponent.SetSpawnCount(emitter.GetMaxCount());
particleEmitterComponent.SetEmitterColor(emitter.GetColor()/255.0f);
particleEmitterComponent.SetEmitterVelocity(emitter.GetVelocity());
particleEmitterComponent.SetEmitterAcceleration(emitter.GetAccelerate());
particleEmitterComponent.SetMeshData(&mesh);
particleEmitterComponent.SetMaterialType(pMaterialType);
particleEmitterComponent.ActivateShaderFeature(engine::ShaderFeature::PARTICLE_INSTANCE);
particleEmitterComponent.Build();
}

}
4 changes: 3 additions & 1 deletion Engine/Source/Editor/ECWorld/ECWorldConsumer.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ class Material;
class Mesh;
class Morph;
class Node;
class ParticleEmitter;
class SceneDatabase;
class Texture;
class VertexFormat;
Expand Down Expand Up @@ -69,7 +70,7 @@ class ECWorldConsumer final : public cdtools::IConsumer
void AddAnimation(engine::Entity entity, const cd::Animation& animation, const cd::SceneDatabase* pSceneDatabase);
void AddMaterial(engine::Entity entity, const cd::Material* pMaterial, engine::MaterialType* pMaterialType, const cd::SceneDatabase* pSceneDatabase);
void AddBlendShape(engine::Entity entity, const cd::Mesh* pMesh, const cd::BlendShape& blendShape, const cd::SceneDatabase* pSceneDatabase);

void AddParticleEmitter(engine::Entity entity, const cd::Mesh& mesh, const cd::VertexFormat& vertexFormat, const cd::ParticleEmitter& emitter);
private:
engine::MaterialType* m_pDefaultMaterialType = nullptr;
engine::SceneWorld* m_pSceneWorld = nullptr;
Expand All @@ -78,6 +79,7 @@ class ECWorldConsumer final : public cdtools::IConsumer

uint32_t m_nodeMinID;
uint32_t m_meshMinID;
uint32_t m_particleMinID = 0;
};

}
34 changes: 34 additions & 0 deletions Engine/Source/Editor/EditorApp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
#include "Rendering/TerrainRenderer.h"
#include "Rendering/WorldRenderer.h"
#include "Rendering/ParticleRenderer.h"
#include "Rendering/ParticleForceFieldRenderer.h"
#include "Resources/FileWatcher.h"
#include "Resources/ResourceBuilder.h"
#include "Resources/ShaderBuilder.h"
Expand Down Expand Up @@ -260,19 +261,23 @@ void EditorApp::InitMaterialType()
constexpr const char* WorldProgram = "WorldProgram";
constexpr const char* AnimationProgram = "AnimationProgram";
constexpr const char* TerrainProgram = "TerrainProgram";
constexpr const char* ParticleProgram = "ParticleProgram";

constexpr engine::StringCrc WorldProgramCrc{ WorldProgram };
constexpr engine::StringCrc AnimationProgramCrc{ AnimationProgram };
constexpr engine::StringCrc TerrainProgramCrc{ TerrainProgram };
constexpr engine::StringCrc ParticleProgramCrc{ ParticleProgram};

m_pRenderContext->RegisterShaderProgram(WorldProgramCrc, { "vs_PBR", "fs_PBR" });
m_pRenderContext->RegisterShaderProgram(AnimationProgramCrc, { "vs_animation", "fs_animation" });
m_pRenderContext->RegisterShaderProgram(TerrainProgramCrc, { "vs_terrain", "fs_terrain" });
m_pRenderContext->RegisterShaderProgram(ParticleProgramCrc, { "vs_particle","fs_particle" });
OVOAOVO marked this conversation as resolved.
Show resolved Hide resolved

m_pSceneWorld = std::make_unique<engine::SceneWorld>();
m_pSceneWorld->CreatePBRMaterialType(WorldProgram, IsAtmosphericScatteringEnable());
m_pSceneWorld->CreateAnimationMaterialType(AnimationProgram);
m_pSceneWorld->CreateTerrainMaterialType(TerrainProgram);
m_pSceneWorld->CreateParticleMaterialType(ParticleProgram);
}

void EditorApp::InitEditorCameraEntity()
Expand Down Expand Up @@ -416,6 +421,30 @@ void EditorApp::UpdateMaterials()
}
}

void EditorApp::UpdatePatricleInstanceState()
OVOAOVO marked this conversation as resolved.
Show resolved Hide resolved
{
for (engine::Entity entity : m_pSceneWorld->GetParticleEmitterEntities())
{
engine::ParticleEmitterComponent* pParticleEmitterComponent = m_pSceneWorld->GetParticleEmitterComponent(entity);
const std::string& programName = pParticleEmitterComponent->GetShaderProgramName();
const std::string& featuresCombine = pParticleEmitterComponent->GetFeaturesCombine();

// New shader feature added, need to compile new variants.
m_pRenderContext->CheckShaderProgram(entity, programName, featuresCombine);

// Shader source files have been modified, need to re-compile existing variants.
if (m_crtInputFocus && !m_preInputFocus)
{
m_pRenderContext->OnShaderHotModified(entity, programName, featuresCombine);
}
}

if (m_crtInputFocus && !m_preInputFocus)
{
m_pRenderContext->ClearModifiedProgramNameCrcs();
}
}

void EditorApp::CompileAndLoadShaders()
{
// 1. Compile
Expand Down Expand Up @@ -554,6 +583,10 @@ void EditorApp::InitEngineRenderers()
pParticleRenderer->SetSceneWorld(m_pSceneWorld.get());
AddEngineRenderer(cd::MoveTemp(pParticleRenderer));

auto pParticleForceFieldRenderer = std::make_unique<engine::ParticleForceFieldRenderer>(m_pRenderContext->CreateView(), pSceneRenderTarget);
pParticleForceFieldRenderer->SetSceneWorld(m_pSceneWorld.get());
AddEngineRenderer(cd::MoveTemp(pParticleForceFieldRenderer));

#ifdef ENABLE_DDGI
auto pDDGIRenderer = std::make_unique<engine::DDGIRenderer>(m_pRenderContext->CreateView(), pSceneRenderTarget);
pDDGIRenderer->SetSceneWorld(m_pSceneWorld.get());
Expand Down Expand Up @@ -742,6 +775,7 @@ bool EditorApp::Update(float deltaTime)
m_pEngineImGuiContext->Update(deltaTime);

UpdateMaterials();
UpdatePatricleInstanceState();
CompileAndLoadShaders();

for (std::unique_ptr<engine::Renderer>& pRenderer : m_pEngineRenderers)
Expand Down
1 change: 1 addition & 0 deletions Engine/Source/Editor/EditorApp.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ class EditorApp final : public engine::IApplication
void OnShaderHotModifiedCallback(const char* rootDir, const char* filePath);

void UpdateMaterials();
void UpdatePatricleInstanceState();
void CompileAndLoadShaders();
void OnShaderCompileFailed(uint32_t handle, std::span<const char> str);

Expand Down
Loading
Loading