Skip to content

Commit e7ebf21

Browse files
THaarerramses-tech-usernVxxbojackHaasmanmohhsharaf
authored
Oss release v1.4.5 created 2024-03-20-06-58 (#64)
see CHANGELOG.md for details Original commit sha: e779f1b92b9ca71cf3b027e14b5675898e8a4d8a Co-authored-by: Ramses Tech User <[email protected]> Co-authored-by: Askanaz Torosyan <[email protected]> Co-authored-by: Daniel Haas <[email protected]> Co-authored-by: Mohamed Sharaf-El-Deen <[email protected]> Co-authored-by: Mirko Sova <[email protected]> Co-authored-by: Tobias Hammer <[email protected]> Co-authored-by: Violin Yanev <[email protected]> Co-authored-by: Askanaz Torosyan <[email protected]>
1 parent bc172d6 commit e7ebf21

File tree

6 files changed

+86
-7
lines changed

6 files changed

+86
-7
lines changed

.readthedocs.yml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# -------------------------------------------------------------------------
2-
# Copyright (C) 2020 BMW AG
2+
# Copyright (C) 2024 BMW AG
33
# -------------------------------------------------------------------------
44
# This Source Code Form is subject to the terms of the Mozilla Public
55
# License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -13,12 +13,16 @@
1313
---
1414
version: 2
1515

16+
build:
17+
os: ubuntu-22.04
18+
tools:
19+
python: "3.7"
20+
1621
sphinx:
17-
configuration: doc/sphinx/conf.py
18-
fail_on_warning: true
22+
configuration: doc/sphinx/conf.py
23+
fail_on_warning: true
1924

2025
python:
21-
version: 3.7
22-
install:
23-
- requirements: doc/sphinx/requirements.txt
26+
install:
27+
- requirements: doc/sphinx/requirements.txt
2428
...

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
# v1.4.5
2+
3+
**FIXED**
4+
5+
- SkinBinding update order bug where skin bindings use old values in update
6+
17
# v1.4.4
28

39
**FIXED**

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ cmake_minimum_required(VERSION 3.13)
1515

1616
set(RLOGIC_VERSION_MAJOR 1)
1717
set(RLOGIC_VERSION_MINOR 4)
18-
set(RLOGIC_VERSION_PATCH 4)
18+
set(RLOGIC_VERSION_PATCH 5)
1919

2020
set(RLOGIC_VERSION ${RLOGIC_VERSION_MAJOR}.${RLOGIC_VERSION_MINOR}.${RLOGIC_VERSION_PATCH})
2121
set(ramses-logic_VERSION "${RLOGIC_VERSION}" CACHE STRING "Ramses Logic version" FORCE)

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ existing files exported with Logic Engine version **W** or newer (Binary file co
4040

4141
|Logic | Included Ramses version | Minimum required Ramses version | Binary file compatibility |
4242
|----------|-------------------------------|------------------------------------|------------------------------|
43+
|v1.4.5 | 27.0.139 | 27.0.102 | >= 1.0.0, F-Levels 01 - 05 |
4344
|v1.4.4 | 27.0.139 | 27.0.102 | >= 1.0.0, F-Levels 01 - 05 |
4445
|v1.4.3 | 27.0.130 | 27.0.102 | >= 1.0.0, F-Levels 01 - 05 |
4546
|v1.4.2 | 27.0.130 | 27.0.102 | >= 1.0.0, F-Levels 01 - 05 |

lib/internals/ApiObjects.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,9 @@ namespace rlogic::internal
276276
registerLogicObject(std::move(up));
277277
binding->m_impl.createRootProperties();
278278

279+
for (auto& joint: binding->m_skinBinding.getJoints())
280+
m_logicNodeDependencies.addBindingDependency(const_cast<RamsesNodeBindingImpl&>(*joint), binding->m_skinBinding); //NOLINT
281+
279282
return binding;
280283
}
281284

unittests/api/SkinBindingTest.cpp

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,71 @@ namespace rlogic::internal
171171
EXPECT_NEAR(expectedMat2[i], mat2[i], 1e-4f) << i;
172172
}
173173

174+
TEST_F(ASkinBinding, UpdatesBoundUniformOnNodeBindingChange)
175+
{
176+
// This is the same setup as regular tests, only recreated locally, since with the regular setup (by chance) the nodes are ordered differently.
177+
// If there is no binding dependency between node binding and skin binding, node binding created after skin binding might appear after skin binding
178+
// in update list, resulting in the changes to node binding not being propagated to skin binding and skin binding using old values during update.
179+
auto appearance = m_scene->createAppearance(createTestEffect(), "skinAppearance2");
180+
ramses::UniformInput uniform;
181+
appearance->getEffect().findUniformInput("jointMat", uniform);
182+
std::vector<ramses::Node*> jointNodes{ m_scene->createNode(), m_scene->createNode() };
183+
RamsesAppearanceBinding* appearanceBinding{ m_logicEngine.createRamsesAppearanceBinding(*appearance) };
184+
std::vector<const RamsesNodeBinding*> joints{ m_logicEngine.createRamsesNodeBinding(*jointNodes[0]), m_logicEngine.createRamsesNodeBinding(*jointNodes[1]) };
185+
186+
// add some transformations to the joints before calculating inverse mats and creating skin
187+
jointNodes[0]->setTranslation(1.f, 2.f, 3.f);
188+
jointNodes[1]->setRotation(10.f, 20.f, 30.f);
189+
190+
std::vector<matrix44f> inverseMats;
191+
inverseMats.resize(2u);
192+
193+
194+
float tempData[16]; // NOLINT(modernize-avoid-c-arrays) Ramses uses C array in matrix getters
195+
jointNodes[0]->getInverseModelMatrix(tempData);
196+
std::copy(std::begin(tempData), std::end(tempData), inverseMats[0].begin());
197+
jointNodes[1]->getInverseModelMatrix(tempData);
198+
std::copy(std::begin(tempData), std::end(tempData), inverseMats[1].begin());
199+
200+
auto skin = m_logicEngine.createSkinBinding(joints, inverseMats, *appearanceBinding, uniform, "skin2");
201+
202+
jointNodes[0]->setRotation(1.f, 2.f, 3.f);
203+
jointNodes[1]->setTranslation(-1.f, -2.f, -3.f);
204+
205+
// The crutial part of this test is having this binding created after other logic nodes to make it appear last in node update topology.
206+
RamsesNodeBinding& nodeBinding = *m_logicEngine.createRamsesNodeBinding(*jointNodes[0]);
207+
auto inputs = nodeBinding.getInputs();
208+
inputs->getChild("translation")->set<vec3f>(vec3f{2.1f, 2.2f, 2.3f});
209+
210+
EXPECT_TRUE(m_logicEngine.update());
211+
212+
const matrix44f expectedMat1 = {
213+
0.998f, -0.0523f, 0.0349f, 0.f,
214+
0.0529f, 0.9984f, -0.0174f, 0.f,
215+
-0.0339f, 0.01925f, 0.9992f, 0.f,
216+
1.0979f, 0.19764f, -0.69773f, 1.f
217+
};
218+
const matrix44f expectedMat2 = {
219+
1.f, 0.f, 0.f, 0.f,
220+
0.f, 1.f, 0.f, 0.f,
221+
0.f, 0.f, 1.f, 0.f,
222+
-1.f, -2.f, -3.f, 1.f
223+
};
224+
225+
std::array<float, 32u> uniformData{};
226+
appearance->getInputValueMatrix44f(skin->getAppearanceUniformInput(), 2u, uniformData.data());
227+
matrix44f mat1{};
228+
matrix44f mat2{};
229+
std::copy(uniformData.cbegin(), uniformData.cbegin() + 16u, mat1.begin());
230+
std::copy(uniformData.cbegin() + 16u, uniformData.cend(), mat2.begin());
231+
232+
for (size_t i = 0u; i < 16; ++i)
233+
EXPECT_NEAR(expectedMat1[i], mat1[i], 1e-4f) << i;
234+
235+
for (size_t i = 0u; i < 16; ++i)
236+
EXPECT_NEAR(expectedMat2[i], mat2[i], 1e-4f) << i;
237+
}
238+
174239
TEST_F(ASkinBinding, CalculatesSameValuesAfterLoadingFromFile)
175240
{
176241
WithTempDirectory tmpDir;

0 commit comments

Comments
 (0)