Skip to content

Commit

Permalink
Oss release v1.4.5 created 2024-03-20-06-58 (#64)
Browse files Browse the repository at this point in the history
see CHANGELOG.md for details

Original commit sha: e779f1b92b9ca71cf3b027e14b5675898e8a4d8a

Co-authored-by: Ramses Tech User <94632088+ramses-tech-user@users.noreply.github.com>
Co-authored-by: Askanaz Torosyan <46795157+nVxx@users.noreply.github.com>
Co-authored-by: Daniel Haas <25718295+bojackHaasman@users.noreply.github.com>
Co-authored-by: Mohamed Sharaf-El-Deen <769940+mohhsharaf@users.noreply.github.com>
Co-authored-by: Mirko Sova <64351017+smirko-dev@users.noreply.github.com>
Co-authored-by: Tobias Hammer <tohammer@users.noreply.github.com>
Co-authored-by: Violin Yanev <violinyanev@users.noreply.github.com>
Co-authored-by: Askanaz Torosyan <askanaz.torosyan@bmw.de>
  • Loading branch information
9 people committed Mar 20, 2024
1 parent bc172d6 commit e7ebf21
Show file tree
Hide file tree
Showing 6 changed files with 86 additions and 7 deletions.
16 changes: 10 additions & 6 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -------------------------------------------------------------------------
# Copyright (C) 2020 BMW AG
# Copyright (C) 2024 BMW AG
# -------------------------------------------------------------------------
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
Expand All @@ -13,12 +13,16 @@
---
version: 2

build:
os: ubuntu-22.04
tools:
python: "3.7"

sphinx:
configuration: doc/sphinx/conf.py
fail_on_warning: true
configuration: doc/sphinx/conf.py
fail_on_warning: true

python:
version: 3.7
install:
- requirements: doc/sphinx/requirements.txt
install:
- requirements: doc/sphinx/requirements.txt
...
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# v1.4.5

**FIXED**

- SkinBinding update order bug where skin bindings use old values in update

# v1.4.4

**FIXED**
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ cmake_minimum_required(VERSION 3.13)

set(RLOGIC_VERSION_MAJOR 1)
set(RLOGIC_VERSION_MINOR 4)
set(RLOGIC_VERSION_PATCH 4)
set(RLOGIC_VERSION_PATCH 5)

set(RLOGIC_VERSION ${RLOGIC_VERSION_MAJOR}.${RLOGIC_VERSION_MINOR}.${RLOGIC_VERSION_PATCH})
set(ramses-logic_VERSION "${RLOGIC_VERSION}" CACHE STRING "Ramses Logic version" FORCE)
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ existing files exported with Logic Engine version **W** or newer (Binary file co

|Logic | Included Ramses version | Minimum required Ramses version | Binary file compatibility |
|----------|-------------------------------|------------------------------------|------------------------------|
|v1.4.5 | 27.0.139 | 27.0.102 | >= 1.0.0, F-Levels 01 - 05 |
|v1.4.4 | 27.0.139 | 27.0.102 | >= 1.0.0, F-Levels 01 - 05 |
|v1.4.3 | 27.0.130 | 27.0.102 | >= 1.0.0, F-Levels 01 - 05 |
|v1.4.2 | 27.0.130 | 27.0.102 | >= 1.0.0, F-Levels 01 - 05 |
Expand Down
3 changes: 3 additions & 0 deletions lib/internals/ApiObjects.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,9 @@ namespace rlogic::internal
registerLogicObject(std::move(up));
binding->m_impl.createRootProperties();

for (auto& joint: binding->m_skinBinding.getJoints())
m_logicNodeDependencies.addBindingDependency(const_cast<RamsesNodeBindingImpl&>(*joint), binding->m_skinBinding); //NOLINT

return binding;
}

Expand Down
65 changes: 65 additions & 0 deletions unittests/api/SkinBindingTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,71 @@ namespace rlogic::internal
EXPECT_NEAR(expectedMat2[i], mat2[i], 1e-4f) << i;
}

TEST_F(ASkinBinding, UpdatesBoundUniformOnNodeBindingChange)
{
// This is the same setup as regular tests, only recreated locally, since with the regular setup (by chance) the nodes are ordered differently.
// If there is no binding dependency between node binding and skin binding, node binding created after skin binding might appear after skin binding
// in update list, resulting in the changes to node binding not being propagated to skin binding and skin binding using old values during update.
auto appearance = m_scene->createAppearance(createTestEffect(), "skinAppearance2");
ramses::UniformInput uniform;
appearance->getEffect().findUniformInput("jointMat", uniform);
std::vector<ramses::Node*> jointNodes{ m_scene->createNode(), m_scene->createNode() };
RamsesAppearanceBinding* appearanceBinding{ m_logicEngine.createRamsesAppearanceBinding(*appearance) };
std::vector<const RamsesNodeBinding*> joints{ m_logicEngine.createRamsesNodeBinding(*jointNodes[0]), m_logicEngine.createRamsesNodeBinding(*jointNodes[1]) };

// add some transformations to the joints before calculating inverse mats and creating skin
jointNodes[0]->setTranslation(1.f, 2.f, 3.f);
jointNodes[1]->setRotation(10.f, 20.f, 30.f);

std::vector<matrix44f> inverseMats;
inverseMats.resize(2u);


float tempData[16]; // NOLINT(modernize-avoid-c-arrays) Ramses uses C array in matrix getters
jointNodes[0]->getInverseModelMatrix(tempData);
std::copy(std::begin(tempData), std::end(tempData), inverseMats[0].begin());
jointNodes[1]->getInverseModelMatrix(tempData);
std::copy(std::begin(tempData), std::end(tempData), inverseMats[1].begin());

auto skin = m_logicEngine.createSkinBinding(joints, inverseMats, *appearanceBinding, uniform, "skin2");

jointNodes[0]->setRotation(1.f, 2.f, 3.f);
jointNodes[1]->setTranslation(-1.f, -2.f, -3.f);

// The crutial part of this test is having this binding created after other logic nodes to make it appear last in node update topology.
RamsesNodeBinding& nodeBinding = *m_logicEngine.createRamsesNodeBinding(*jointNodes[0]);
auto inputs = nodeBinding.getInputs();
inputs->getChild("translation")->set<vec3f>(vec3f{2.1f, 2.2f, 2.3f});

EXPECT_TRUE(m_logicEngine.update());

const matrix44f expectedMat1 = {
0.998f, -0.0523f, 0.0349f, 0.f,
0.0529f, 0.9984f, -0.0174f, 0.f,
-0.0339f, 0.01925f, 0.9992f, 0.f,
1.0979f, 0.19764f, -0.69773f, 1.f
};
const matrix44f expectedMat2 = {
1.f, 0.f, 0.f, 0.f,
0.f, 1.f, 0.f, 0.f,
0.f, 0.f, 1.f, 0.f,
-1.f, -2.f, -3.f, 1.f
};

std::array<float, 32u> uniformData{};
appearance->getInputValueMatrix44f(skin->getAppearanceUniformInput(), 2u, uniformData.data());
matrix44f mat1{};
matrix44f mat2{};
std::copy(uniformData.cbegin(), uniformData.cbegin() + 16u, mat1.begin());
std::copy(uniformData.cbegin() + 16u, uniformData.cend(), mat2.begin());

for (size_t i = 0u; i < 16; ++i)
EXPECT_NEAR(expectedMat1[i], mat1[i], 1e-4f) << i;

for (size_t i = 0u; i < 16; ++i)
EXPECT_NEAR(expectedMat2[i], mat2[i], 1e-4f) << i;
}

TEST_F(ASkinBinding, CalculatesSameValuesAfterLoadingFromFile)
{
WithTempDirectory tmpDir;
Expand Down

0 comments on commit e7ebf21

Please sign in to comment.