Helmut2 Posted June 18, 2021 Share Posted June 18, 2021 Hello, I want to create a ObjectDynamic which uses the deferred pass from the built in mesh base material. The vertex shader in core\shaders\mesh\common\vertex.h requires the tangent space to be encoded as quaternion. How can I produce such a quaternion? I wonder if a function exists which does this job for me, either in UUSL or inside the C#/C++ Mathlib or in Unigine Script. Many thanks Helmut Link to comment
sweetluna Posted June 18, 2021 Share Posted June 18, 2021 Hi, you can checkout our samples for dynamic meshes at samples/objects. You can just call updateTangents() after adding vertices to the mesh. Don't forget to call updateIndices() and updateBounds(). Hope it helps! May RenderDoc/Nsight Graphics/Intel GPA bless you Link to comment
Helmut2 Posted June 21, 2021 Author Share Posted June 21, 2021 Hello sweetluna, thank you very much, I will try that. If I'm understanding the docs correctly the normals will be autogenerated as well - which in theory could become an issue, because they are provided by the content creation tool. Anyways, the ObjectMeshDynamic is a very good point to start. Best regards Helmut Link to comment
Recommended Posts