Skip to content

Commit

Permalink
conflict fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
OVOAOVO committed Feb 29, 2024
1 parent 5b501e6 commit 2f1fc90
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 9 deletions.
1 change: 1 addition & 0 deletions Engine/Source/Editor/UILayers/EntityList.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ void EntityList::AddEntity(engine::SceneWorld* pSceneWorld)
cd::SceneDatabase* pSceneDatabase = pSceneWorld->GetSceneDatabase();
engine::MaterialType* pPBRMaterialType = pSceneWorld->GetPBRMaterialType();
engine::MaterialType* pTerrainMaterialType = pSceneWorld->GetTerrainMaterialType();
engine::MaterialType* pParticleMaterialType = pSceneWorld->GetParticleMaterialType();
engine::ResourceContext* pResourceContext = GetRenderContext()->GetResourceContext();

auto AddNamedEntity = [&pWorld](std::string defaultName) -> engine::Entity
Expand Down
8 changes: 4 additions & 4 deletions Engine/Source/Runtime/ECWorld/ParticleEmitterComponent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ void engine::ParticleEmitterComponent::Build()
BuildParticleShape();

bgfx::VertexLayout vertexLayout;
VertexLayoutUtility::CreateVertexLayout(vertexLayout, m_pRequiredVertexFormat->GetVertexLayout());
VertexLayoutUtility::CreateVertexLayout(vertexLayout, m_pRequiredVertexFormat->GetVertexAttributeLayouts());
m_particleVertexBufferHandle = bgfx::createVertexBuffer(bgfx::makeRef(m_particleVertexBuffer.data(), static_cast<uint32_t>(m_particleVertexBuffer.size())), vertexLayout).idx;
m_particleIndexBufferHandle = bgfx::createIndexBuffer(bgfx::makeRef(m_particleIndexBuffer.data(), static_cast<uint32_t>(m_particleIndexBuffer.size())), 0U).idx;
}
Expand Down Expand Up @@ -288,7 +288,7 @@ void engine::ParticleEmitterComponent::BuildParticleShape()
if (m_emitterShape == ParticleEmitterShape::Box)
{
cd::VertexFormat vertexFormat;
vertexFormat.AddAttributeLayout(cd::VertexAttributeType::Position, cd::AttributeValueType::Float, 3);
vertexFormat.AddVertexAttributeLayout(cd::VertexAttributeType::Position, cd::AttributeValueType::Float, 3);

const uint32_t vertexCount = 8;
std::vector<cd::Point> vertexArray
Expand Down Expand Up @@ -344,7 +344,7 @@ void engine::ParticleEmitterComponent::BuildParticleShape()
}

bgfx::VertexLayout vertexLayout;
VertexLayoutUtility::CreateVertexLayout(vertexLayout, vertexFormat.GetVertexLayout());
VertexLayoutUtility::CreateVertexLayout(vertexLayout, vertexFormat.GetVertexAttributeLayouts());
m_emitterShapeVertexBufferHandle = bgfx::createVertexBuffer(bgfx::makeRef(m_emitterShapeVertexBuffer.data(), static_cast<uint32_t>(m_emitterShapeVertexBuffer.size())), vertexLayout).idx;
m_emitterShapeIndexBufferHandle = bgfx::createIndexBuffer(bgfx::makeRef(m_emitterShapeIndexBuffer.data(), static_cast<uint32_t>(m_emitterShapeIndexBuffer.size())), 0U).idx;
}
Expand All @@ -355,7 +355,7 @@ void engine::ParticleEmitterComponent::RePaddingShapeBuffer()
if (m_emitterShape == ParticleEmitterShape::Box)
{
cd::VertexFormat vertexFormat;
vertexFormat.AddAttributeLayout(cd::VertexAttributeType::Position, cd::AttributeValueType::Float, 3);
vertexFormat.AddVertexAttributeLayout(cd::VertexAttributeType::Position, cd::AttributeValueType::Float, 3);

const uint32_t vertexCount = 8;
std::vector<cd::Point> vertexArray
Expand Down
4 changes: 2 additions & 2 deletions Engine/Source/Runtime/ECWorld/ParticleForceFieldComponent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace engine
void ParticleForceFieldComponent::Build()
{
cd::VertexFormat vertexFormat;
vertexFormat.AddAttributeLayout(cd::VertexAttributeType::Position, cd::AttributeValueType::Float, 3);
vertexFormat.AddVertexAttributeLayout(cd::VertexAttributeType::Position, cd::AttributeValueType::Float, 3);

const uint32_t vertexCount = 8;
std::vector<cd::Point> vertexArray
Expand Down Expand Up @@ -64,7 +64,7 @@ void ParticleForceFieldComponent::Build()
}

bgfx::VertexLayout vertexLayout;
VertexLayoutUtility::CreateVertexLayout(vertexLayout, vertexFormat.GetVertexLayout());
VertexLayoutUtility::CreateVertexLayout(vertexLayout, vertexFormat.GetVertexAttributeLayouts());
m_vertexBufferHandle = bgfx::createVertexBuffer(bgfx::makeRef(m_vertexBuffer.data(), static_cast<uint32_t>(m_vertexBuffer.size())), vertexLayout).idx;
m_indexBufferHandle = bgfx::createIndexBuffer(bgfx::makeRef(m_indexBuffer.data(), static_cast<uint32_t>(m_indexBuffer.size())), 0U).idx;
}
Expand Down
6 changes: 3 additions & 3 deletions Engine/Source/Runtime/ECWorld/SceneWorld.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,9 @@ void SceneWorld::CreateParticleMaterialType(std::string shaderProgramName)
m_pParticleMaterialType->SetShaderSchema(cd::MoveTemp(shaderSchema));

cd::VertexFormat particleVertexFormat;
particleVertexFormat.AddAttributeLayout(cd::VertexAttributeType::Position, cd::GetAttributeValueType<cd::Point::ValueType>(), cd::Point::Size);
particleVertexFormat.AddAttributeLayout(cd::VertexAttributeType::Color, cd::GetAttributeValueType<cd::Color::ValueType>(), cd::Color::Size);
particleVertexFormat.AddAttributeLayout(cd::VertexAttributeType::UV, cd::GetAttributeValueType<cd::UV::ValueType>(), cd::UV::Size);
particleVertexFormat.AddVertexAttributeLayout(cd::VertexAttributeType::Position, cd::GetAttributeValueType<cd::Point::ValueType>(), cd::Point::Size);
particleVertexFormat.AddVertexAttributeLayout(cd::VertexAttributeType::Color, cd::GetAttributeValueType<cd::Color::ValueType>(), cd::Color::Size);
particleVertexFormat.AddVertexAttributeLayout(cd::VertexAttributeType::UV, cd::GetAttributeValueType<cd::UV::ValueType>(), cd::UV::Size);
m_pParticleMaterialType->SetRequiredVertexFormat(cd::MoveTemp(particleVertexFormat));
}

Expand Down

0 comments on commit 2f1fc90

Please sign in to comment.