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

Update latest asset pipeline #437

Merged
merged 1 commit into from
Dec 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions Engine/Source/Editor/EditorApp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -721,8 +721,8 @@ bool EditorApp::Update(float deltaTime)
{
if (pRenderer->IsEnable())
{
const float* pViewMatrix = pMainCameraComponent->GetViewMatrix().Begin();
const float* pProjectionMatrix = pMainCameraComponent->GetProjectionMatrix().Begin();
const float* pViewMatrix = pMainCameraComponent->GetViewMatrix().begin();
const float* pProjectionMatrix = pMainCameraComponent->GetProjectionMatrix().begin();
pRenderer->UpdateView(pViewMatrix, pProjectionMatrix);
pRenderer->Render(deltaTime);
}
Expand Down
2 changes: 1 addition & 1 deletion Engine/Source/Editor/Resources/ResourceBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ void ResourceBuilder::UpdateModifyTimeCache()
{
for (auto& [filePath, fileTime] : m_newModifyTimeCache)
{
m_modifyTimeCache[cd::MoveTemp(filePath)] = cd::MoveTemp(fileTime);
m_modifyTimeCache[filePath] = fileTime;
}

m_newModifyTimeCache.clear();
Expand Down
12 changes: 6 additions & 6 deletions Engine/Source/Editor/UILayers/AssetBrowser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -918,14 +918,14 @@ void AssetBrowser::ImportModelFile(const char* pFilePath)
{
#ifdef ENABLE_GENERIC_PRODUCER
cdtools::GenericProducer genericProducer(pFilePath);
genericProducer.ActivateBoundingBoxService();
genericProducer.ActivateCleanUnusedService();
genericProducer.ActivateTangentsSpaceService();
genericProducer.ActivateTriangulateService();
genericProducer.ActivateSimpleAnimationService();
genericProducer.EnableOption(cdtools::GenericProducerOptions::GenerateBoundingBox);
genericProducer.EnableOption(cdtools::GenericProducerOptions::CleanUnusedObjects);
genericProducer.EnableOption(cdtools::GenericProducerOptions::GenerateTangentSpace);
genericProducer.EnableOption(cdtools::GenericProducerOptions::TriangulateModel);
genericProducer.EnableOption(cdtools::GenericProducerOptions::OnlyTransformAnimationKey);
if (!m_importOptions.ImportAnimation)
{
genericProducer.ActivateFlattenHierarchyService();
genericProducer.EnableOption(cdtools::GenericProducerOptions::FlattenTransformHierarchy);
}

cd::SceneDatabase newSceneDatabase;
Expand Down
4 changes: 2 additions & 2 deletions Engine/Source/Editor/UILayers/ImGuizmoView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ void ImGuizmoView::Update()
ImGuiIO& io = ImGui::GetIO();
ImGuizmo::SetRect(0.0f, 0.0f, ImGui::GetIO().DisplaySize.x, io.DisplaySize.y);
cd::Matrix4x4 worldMatrix = pTransformComponent->GetWorldMatrix();
ImGuizmo::Manipulate(pCameraComponent->GetViewMatrix().Begin(), pCameraComponent->GetProjectionMatrix().Begin(),
operation, ImGuizmo::LOCAL, worldMatrix.Begin());
ImGuizmo::Manipulate(pCameraComponent->GetViewMatrix().begin(), pCameraComponent->GetProjectionMatrix().begin(),
operation, ImGuizmo::LOCAL, worldMatrix.begin());

if (ImGuizmo::IsUsing())
{
Expand Down
10 changes: 5 additions & 5 deletions Engine/Source/Runtime/ECWorld/BlendShapeComponent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,15 @@ void BlendShapeComponent::Build()

for (uint32_t vertexIndex = 0; vertexIndex < m_meshVertexCount; ++vertexIndex)
{
std::memcpy(&morphAffectedVBDataPtr[morphAffectedVBDataSize], m_pMesh->GetVertexPosition(vertexIndex).Begin(), positionSize);
std::memcpy(&morphAffectedVBDataPtr[morphAffectedVBDataSize], m_pMesh->GetVertexPosition(vertexIndex).begin(), positionSize);
morphAffectedVBDataSize += positionSize;
std::memcpy(&morphAffectedVBDataPtr[morphAffectedVBDataSize], &placeholder, placeholderSize);
morphAffectedVBDataSize += placeholderSize;
std::memcpy(&nonMorphAffectedDataPtr[nonMorphAffectedVBDataSize], m_pMesh->GetVertexNormal(vertexIndex).Begin(), normalSize);
std::memcpy(&nonMorphAffectedDataPtr[nonMorphAffectedVBDataSize], m_pMesh->GetVertexNormal(vertexIndex).begin(), normalSize);
nonMorphAffectedVBDataSize += normalSize;
std::memcpy(&nonMorphAffectedDataPtr[nonMorphAffectedVBDataSize], m_pMesh->GetVertexTangent(vertexIndex).Begin(), tangentSize);
std::memcpy(&nonMorphAffectedDataPtr[nonMorphAffectedVBDataSize], m_pMesh->GetVertexTangent(vertexIndex).begin(), tangentSize);
nonMorphAffectedVBDataSize += tangentSize;
std::memcpy(&nonMorphAffectedDataPtr[nonMorphAffectedVBDataSize], m_pMesh->GetVertexUV(0, vertexIndex).Begin(), UVSize);
std::memcpy(&nonMorphAffectedDataPtr[nonMorphAffectedVBDataSize], m_pMesh->GetVertexUV(0, vertexIndex).begin(), UVSize);
nonMorphAffectedVBDataSize += UVSize;
}

Expand Down Expand Up @@ -128,7 +128,7 @@ void BlendShapeComponent::Build()
uint32_t vertexIDData= m_pMorphsData[morphIndex].GetVertexSourceID(vertexIndex).Data();
std::memcpy(&allMorphVertexIDDataPtr[allMorphVertexIDDataSize], &vertexIDData, sizeof(vertexIDData));
allMorphVertexIDDataSize += sizeof(vertexIDData);
std::memcpy(&allMorphVertexIDDataPtr[allMorphVertexIDDataSize], m_pMorphsData[morphIndex].GetVertexPosition(vertexIndex).Begin(), positionSize);
std::memcpy(&allMorphVertexIDDataPtr[allMorphVertexIDDataSize], m_pMorphsData[morphIndex].GetVertexPosition(vertexIndex).begin(), positionSize);
allMorphVertexIDDataSize += positionSize;
}
}
Expand Down
4 changes: 2 additions & 2 deletions Engine/Source/Runtime/ECWorld/CollisionMeshComponent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,13 @@ void CollisionMeshComponent::Build()
// position
const cd::Point& position = meshData.GetVertexPosition(vertexIndex);
constexpr uint32_t posDataSize = cd::Point::Size * sizeof(cd::Point::ValueType);
std::memcpy(&currentDataPtr[currentDataSize], position.Begin(), posDataSize);
std::memcpy(&currentDataPtr[currentDataSize], position.begin(), posDataSize);
currentDataSize += posDataSize;

// barycentric
//const cd::Vec4f& barycentricCoordinates = meshData.GetVertexColor(0U, vertexIndex);
//constexpr uint32_t bcDataSize = cd::Vec4f::Size * sizeof(cd::Vec4f::ValueType);
//std::memcpy(&currentDataPtr[currentDataSize], barycentricCoordinates.Begin(), bcDataSize);
//std::memcpy(&currentDataPtr[currentDataSize], barycentricCoordinates.begin(), bcDataSize);
//currentDataSize += bcDataSize;
}

Expand Down
12 changes: 6 additions & 6 deletions Engine/Source/Runtime/ECWorld/StaticMeshComponent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -174,37 +174,37 @@ void StaticMeshComponent::Build()
if (containsPosition)
{
constexpr uint32_t dataSize = cd::Point::Size * sizeof(cd::Point::ValueType);
FillVertexBuffer(m_pMeshData->GetVertexPosition(vertexIndex).Begin(), dataSize);
FillVertexBuffer(m_pMeshData->GetVertexPosition(vertexIndex).begin(), dataSize);
}

if (containsNormal)
{
constexpr uint32_t dataSize = cd::Direction::Size * sizeof(cd::Direction::ValueType);
FillVertexBuffer(m_pMeshData->GetVertexNormal(vertexIndex).Begin(), dataSize);
FillVertexBuffer(m_pMeshData->GetVertexNormal(vertexIndex).begin(), dataSize);
}

if (containsTangent)
{
constexpr uint32_t dataSize = cd::Direction::Size * sizeof(cd::Direction::ValueType);
FillVertexBuffer(m_pMeshData->GetVertexTangent(vertexIndex).Begin(), dataSize);
FillVertexBuffer(m_pMeshData->GetVertexTangent(vertexIndex).begin(), dataSize);
}

if (containsBiTangent)
{
constexpr uint32_t dataSize = cd::Direction::Size * sizeof(cd::Direction::ValueType);
FillVertexBuffer(m_pMeshData->GetVertexBiTangent(vertexIndex).Begin(), dataSize);
FillVertexBuffer(m_pMeshData->GetVertexBiTangent(vertexIndex).begin(), dataSize);
}

if (containsUV)
{
constexpr uint32_t dataSize = cd::UV::Size * sizeof(cd::UV::ValueType);
FillVertexBuffer(m_pMeshData->GetVertexUV(0)[vertexIndex].Begin(), dataSize);
FillVertexBuffer(m_pMeshData->GetVertexUV(0)[vertexIndex].begin(), dataSize);
}

if (containsColor)
{
constexpr uint32_t dataSize = cd::Color::Size * sizeof(cd::Color::ValueType);
FillVertexBuffer(m_pMeshData->GetVertexColor(0)[vertexIndex].Begin(), dataSize);
FillVertexBuffer(m_pMeshData->GetVertexColor(0)[vertexIndex].begin(), dataSize);
}

if (containsBoneIndex && containsBoneWeight)
Expand Down
12 changes: 6 additions & 6 deletions Engine/Source/Runtime/ImGui/ImGuiUtils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,21 +145,21 @@ static bool ImGuiVectorProperty(const char* pName, T& value, cd::Unit unit = cd:
float dragSpeed = (speed <= 0.0) ? (cd::Math::IsEqualToZero(delta) ? 1.0f : delta * 0.05f) : speed;
if constexpr (std::is_same<T, cd::Vec2f>())
{
if (ImGui::DragFloat2(pName, value.Begin(), dragSpeed, minValue.x(), maxValue.x(), metricName.c_str()))
if (ImGui::DragFloat2(pName, value.begin(), dragSpeed, minValue.x(), maxValue.x(), metricName.c_str()))
{
dirty = true;
}
}
else if constexpr (std::is_same<T, cd::Vec3f>())
{
if (ImGui::DragFloat3(pName, value.Begin(), dragSpeed, minValue.x(), maxValue.x(), metricName.c_str()))
if (ImGui::DragFloat3(pName, value.begin(), dragSpeed, minValue.x(), maxValue.x(), metricName.c_str()))
{
dirty = true;
}
}
else if constexpr (std::is_same<T, cd::Vec4f>())
{
if (ImGui::DragFloat4(pName, value.Begin(), dragSpeed, minValue.x(), maxValue.x(), metricName.c_str()))
if (ImGui::DragFloat4(pName, value.begin(), dragSpeed, minValue.x(), maxValue.x(), metricName.c_str()))
{
dirty = true;
}
Expand Down Expand Up @@ -201,7 +201,7 @@ static bool ImGuiTransformProperty(const char* pName, cd::Transform& value)
ImGui::NextColumn();
ImGui::PushItemWidth(-1);

if (ImGui::DragFloat3("##Scale", scale.Begin(), 0.1f, 0.001f, 999.0f))
if (ImGui::DragFloat3("##Scale", scale.begin(), 0.1f, 0.001f, 999.0f))
{
if (!cd::Math::IsEqualTo(scale.x(), originScale.x()))
{
Expand Down Expand Up @@ -282,7 +282,7 @@ static void ColorPickerProperty(const char* Name, cd::Vec3f& veccolor)
ImGui::PushItemWidth(-1);
ImGui::SameLine();
ImGui::NextColumn();
ImGui::DragFloat3("", veccolor.Begin(), 0, 0.0f, 1.0f);
ImGui::DragFloat3("", veccolor.begin(), 0, 0.0f, 1.0f);
ImGui::PopItemWidth();
if (showMap[Name])
{
Expand All @@ -294,7 +294,7 @@ static void ColorPickerProperty(const char* Name, cd::Vec3f& veccolor)

ImGui::SetNextWindowPos(windowPos, ImGuiCond_Always);
ImGui::Begin(Name, &showMap[Name], ImGuiWindowFlags_NoMove | ImGuiWindowFlags_AlwaysAutoResize);
ImGui::ColorPicker3("Color Picker", veccolor.Begin());
ImGui::ColorPicker3("Color Picker", veccolor.begin());
ImGui::End();
}
ImGui::Separator();
Expand Down
2 changes: 1 addition & 1 deletion Engine/Source/Runtime/Rendering/AABBRenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ void AABBRenderer::Render(float deltaTime)
if (auto* pTransformComponent = m_pCurrentSceneWorld->GetTransformComponent(entity))
{
pTransformComponent->Build();
bgfx::setTransform(pTransformComponent->GetWorldMatrix().Begin());
bgfx::setTransform(pTransformComponent->GetWorldMatrix().begin());
}

bgfx::setVertexBuffer(0, bgfx::VertexBufferHandle{ pCollisionMesh->GetVertexBuffer() });
Expand Down
2 changes: 1 addition & 1 deletion Engine/Source/Runtime/Rendering/AnimationRenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ void AnimationRenderer::Render(float deltaTime)
}

TransformComponent* pTransformComponent = m_pCurrentSceneWorld->GetTransformComponent(entity);
bgfx::setTransform(pTransformComponent->GetWorldMatrix().Begin());
bgfx::setTransform(pTransformComponent->GetWorldMatrix().begin());

AnimationComponent* pAnimationComponent = m_pCurrentSceneWorld->GetAnimationComponent(entity);

Expand Down
10 changes: 5 additions & 5 deletions Engine/Source/Runtime/Rendering/BlendShapeRenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ void BlendShapeRenderer::Render(float deltaTime)
// Transform
if (TransformComponent* pTransformComponent = m_pCurrentSceneWorld->GetTransformComponent(entity))
{
bgfx::setTransform(pTransformComponent->GetWorldMatrix().Begin());
bgfx::setTransform(pTransformComponent->GetWorldMatrix().begin());
}

uint16_t viewId = GetViewID();
Expand Down Expand Up @@ -259,22 +259,22 @@ void BlendShapeRenderer::Render(float deltaTime)

// Submit uniform values : material settings
constexpr StringCrc albedoColorCrc(albedoColor);
GetRenderContext()->FillUniform(albedoColorCrc, pMaterialComponent->GetAlbedoColor().Begin(), 1);
GetRenderContext()->FillUniform(albedoColorCrc, pMaterialComponent->GetAlbedoColor().begin(), 1);

constexpr StringCrc mrFactorCrc(metallicRoughnessFactor);
cd::Vec4f metallicRoughnessFactorData(pMaterialComponent->GetMetallicFactor(), pMaterialComponent->GetRoughnessFactor(), 1.0f, 1.0f);
GetRenderContext()->FillUniform(mrFactorCrc, metallicRoughnessFactorData.Begin(), 1);
GetRenderContext()->FillUniform(mrFactorCrc, metallicRoughnessFactorData.begin(), 1);

constexpr StringCrc emissiveColorCrc(emissiveColor);
GetRenderContext()->FillUniform(emissiveColorCrc, pMaterialComponent->GetEmissiveColor().Begin(), 1);
GetRenderContext()->FillUniform(emissiveColorCrc, pMaterialComponent->GetEmissiveColor().begin(), 1);

// Submit uniform values : light settings
auto lightEntities = m_pCurrentSceneWorld->GetLightEntities();
size_t lightEntityCount = lightEntities.size();
constexpr engine::StringCrc lightCountAndStrideCrc(lightCountAndStride);
static cd::Vec4f lightInfoData(0, LightUniform::LIGHT_STRIDE, 0.0f, 0.0f);
lightInfoData.x() = static_cast<float>(lightEntityCount);
GetRenderContext()->FillUniform(lightCountAndStrideCrc, lightInfoData.Begin(), 1);
GetRenderContext()->FillUniform(lightCountAndStrideCrc, lightInfoData.begin(), 1);
if (lightEntityCount > 0)
{
// Light component storage has continus memory address and layout.
Expand Down
12 changes: 6 additions & 6 deletions Engine/Source/Runtime/Rendering/BloomRenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ void BloomRenderer::Render(float deltaTime)
// capture
bgfx::setViewFrameBuffer(GetViewID(), m_sampleChainFB[0]);
bgfx::setViewRect(GetViewID(), 0, 0, m_width, m_height);
bgfx::setViewTransform(GetViewID(), nullptr, orthoMatrix.Begin());
bgfx::setViewTransform(GetViewID(), nullptr, orthoMatrix.begin());

constexpr StringCrc luminanceThresholdUniformName("u_luminanceThreshold");
bgfx::setUniform(GetRenderContext()->GetUniform(luminanceThresholdUniformName), &pCameraComponent->GetLuminanceThreshold());
Expand Down Expand Up @@ -190,7 +190,7 @@ void BloomRenderer::Render(float deltaTime)

bgfx::setViewFrameBuffer(m_startDowmSamplePassID + i, m_sampleChainFB[shift]);
bgfx::setViewRect(m_startDowmSamplePassID + i, 0, 0, m_width >> shift, m_height >> shift);
bgfx::setViewTransform(m_startDowmSamplePassID + i, nullptr, orthoMatrix.Begin());
bgfx::setViewTransform(m_startDowmSamplePassID + i, nullptr, orthoMatrix.begin());

constexpr StringCrc textureSizeUniformName("u_textureSize");
bgfx::setUniform(GetRenderContext()->GetUniform(textureSizeUniformName), pixelSize);
Expand Down Expand Up @@ -227,7 +227,7 @@ void BloomRenderer::Render(float deltaTime)

bgfx::setViewFrameBuffer(m_startUpSamplePassID + i, m_sampleChainFB[shift]);
bgfx::setViewRect(m_startUpSamplePassID + i, 0, 0, m_width >> shift, m_height >> shift);
bgfx::setViewTransform(m_startUpSamplePassID + i, nullptr, orthoMatrix.Begin());
bgfx::setViewTransform(m_startUpSamplePassID + i, nullptr, orthoMatrix.begin());

constexpr StringCrc textureSizeUniformName("u_textureSize");
bgfx::setUniform(GetRenderContext()->GetUniform(textureSizeUniformName), pixelSize);
Expand All @@ -253,7 +253,7 @@ void BloomRenderer::Render(float deltaTime)
// combine
bgfx::setViewFrameBuffer(m_combinePassID, m_combineFB);
bgfx::setViewRect(m_combinePassID, 0, 0, m_width, m_height);
bgfx::setViewTransform(m_combinePassID, nullptr, orthoMatrix.Begin());
bgfx::setViewTransform(m_combinePassID, nullptr, orthoMatrix.begin());

constexpr StringCrc lightColorSampler("s_lightingColor");
bgfx::setTexture(0, GetRenderContext()->GetUniform(lightColorSampler), screenTextureHandle);
Expand Down Expand Up @@ -295,7 +295,7 @@ void BloomRenderer::Blur(uint16_t width, uint16_t height, int iteration, float b

bgfx::setViewFrameBuffer(verticalViewID, m_blurChainFB[0]);
bgfx::setViewRect(verticalViewID, 0, 0, width, height);
bgfx::setViewTransform(verticalViewID, nullptr, ortho.Begin());
bgfx::setViewTransform(verticalViewID, nullptr, ortho.begin());

constexpr StringCrc textureSizeUniformName("u_textureSize");
bgfx::setUniform(GetRenderContext()->GetUniform(textureSizeUniformName), pixelSize);
Expand All @@ -314,7 +314,7 @@ void BloomRenderer::Blur(uint16_t width, uint16_t height, int iteration, float b
// vertical
bgfx::setViewFrameBuffer(horizontalViewID, m_blurChainFB[1]);
bgfx::setViewRect(horizontalViewID, 0, 0, width, height);
bgfx::setViewTransform(horizontalViewID, nullptr, ortho.Begin());
bgfx::setViewTransform(horizontalViewID, nullptr, ortho.begin());

bgfx::setUniform(GetRenderContext()->GetUniform(textureSizeUniformName), pixelSize);

Expand Down
2 changes: 1 addition & 1 deletion Engine/Source/Runtime/Rendering/ImGuiRenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ void ImGuiRenderer::UpdateView(const float* pViewMatrix, const float* pProjectio

cd::Matrix4x4 orthoMatrix = cd::Matrix4x4::Orthographic(x, x + width, y, y + height, 0.0f, 1000.0f, 0.0f, pCapabilities->homogeneousDepth);
bgfx::setViewRect(GetViewID(), 0, 0, uint16_t(width), uint16_t(height));
bgfx::setViewTransform(GetViewID(), nullptr, orthoMatrix.Begin());
bgfx::setViewTransform(GetViewID(), nullptr, orthoMatrix.begin());
}

void ImGuiRenderer::Render(float deltaTime)
Expand Down
2 changes: 1 addition & 1 deletion Engine/Source/Runtime/Rendering/PostProcessRenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ void PostProcessRenderer::UpdateView(const float* pViewMatrix, const float* pPro
UpdateViewRenderTarget();

cd::Matrix4x4 orthoMatrix = cd::Matrix4x4::Orthographic(0.0f, 1.0f, 0.0f, 1.0f, 0.0f, 1000.0f, 0.0f, bgfx::getCaps()->homogeneousDepth);
bgfx::setViewTransform(GetViewID(), nullptr, orthoMatrix.Begin());
bgfx::setViewTransform(GetViewID(), nullptr, orthoMatrix.begin());
}

void PostProcessRenderer::Render(float deltaTime)
Expand Down
6 changes: 3 additions & 3 deletions Engine/Source/Runtime/Rendering/SkeletonRenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ void TraverseBone(const cd::Bone& bone, const cd::SceneDatabase* pSceneDatabase,

uint16_t parentID = currBone.GetParentID().Data();
uint16_t currBoneID = currBone.GetID().Data();
std::memcpy(&currentDataPtr[vertexOffset], translate.Begin(), posDataSize);
std::memcpy(&currentDataPtr[vertexOffset], translate.begin(), posDataSize);
vertexOffset += posDataSize;
std::memcpy(&currentIndexPtr[indexOffset], &parentID, indexTypeSize);
indexOffset += static_cast<uint32_t>(indexTypeSize);
Expand Down Expand Up @@ -90,7 +90,7 @@ void SkeletonRenderer::Build()
return;
}

bgfx::setTransform(cd::Matrix4x4::Identity().Begin());
bgfx::setTransform(cd::Matrix4x4::Identity().begin());
cd::VertexFormat vertexFormat;
vertexFormat.AddAttributeLayout(cd::VertexAttributeType::Position, cd::AttributeValueType::Float, 3);

Expand All @@ -101,7 +101,7 @@ void SkeletonRenderer::Build()
uint32_t currentIndexOffset = 0U;
std::byte* pCurrentVertexBuffer = m_vertexBuffer.data();
const cd::Point& position = firstBone.GetTransform().GetTranslation();
std::memcpy(&pCurrentVertexBuffer[currentVertexOffset], position.Begin(), details::posDataSize);
std::memcpy(&pCurrentVertexBuffer[currentVertexOffset], position.begin(), details::posDataSize);
currentVertexOffset += details::posDataSize;

details::TraverseBone(firstBone, pSceneDatabase, m_vertexBuffer.data(), m_indexBuffer.data(), currentVertexOffset, currentIndexOffset);
Expand Down
10 changes: 5 additions & 5 deletions Engine/Source/Runtime/Rendering/TerrainRenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ void TerrainRenderer::Render(float deltaTime)
// Transform
if (TransformComponent* pTransformComponent = m_pCurrentSceneWorld->GetTransformComponent(entity))
{
bgfx::setTransform(pTransformComponent->GetWorldMatrix().Begin());
bgfx::setTransform(pTransformComponent->GetWorldMatrix().begin());
}

// Mesh
Expand Down Expand Up @@ -180,22 +180,22 @@ void TerrainRenderer::Render(float deltaTime)

// Submit uniform values : material settings
constexpr StringCrc albedoColorCrc(albedoColor);
GetRenderContext()->FillUniform(albedoColorCrc, pMaterialComponent->GetAlbedoColor().Begin(), 1);
GetRenderContext()->FillUniform(albedoColorCrc, pMaterialComponent->GetAlbedoColor().begin(), 1);

constexpr StringCrc mrFactorCrc(metallicRoughnessFactor);
cd::Vec4f metallicRoughnessFactorData(pMaterialComponent->GetMetallicFactor(), pMaterialComponent->GetRoughnessFactor(), 1.0f, 1.0f);
GetRenderContext()->FillUniform(mrFactorCrc, metallicRoughnessFactorData.Begin(), 1);
GetRenderContext()->FillUniform(mrFactorCrc, metallicRoughnessFactorData.begin(), 1);

constexpr StringCrc emissiveColorCrc(emissiveColor);
GetRenderContext()->FillUniform(emissiveColorCrc, pMaterialComponent->GetEmissiveColor().Begin(), 1);
GetRenderContext()->FillUniform(emissiveColorCrc, pMaterialComponent->GetEmissiveColor().begin(), 1);

// Submit uniform values : light settings
auto lightEntities = m_pCurrentSceneWorld->GetLightEntities();
size_t lightEntityCount = lightEntities.size();
constexpr engine::StringCrc lightCountAndStrideCrc(lightCountAndStride);
static cd::Vec4f lightInfoData(0, LightUniform::LIGHT_STRIDE, 0.0f, 0.0f);
lightInfoData.x() = static_cast<float>(lightEntityCount);
GetRenderContext()->FillUniform(lightCountAndStrideCrc, lightInfoData.Begin(), 1);
GetRenderContext()->FillUniform(lightCountAndStrideCrc, lightInfoData.begin(), 1);
if (lightEntityCount > 0)
{
// Light component storage has continus memory address and layout.
Expand Down
2 changes: 1 addition & 1 deletion Engine/Source/Runtime/Rendering/WhiteModelRenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ void WhiteModelRenderer::Render(float deltaTime)
if (TransformComponent* pTransformComponent = m_pCurrentSceneWorld->GetTransformComponent(entity))
{
pTransformComponent->Build();
bgfx::setTransform(pTransformComponent->GetWorldMatrix().Begin());
bgfx::setTransform(pTransformComponent->GetWorldMatrix().begin());
}

// No mesh attached?
Expand Down
Loading
Loading