How can i do the samething in c++? What is the equivalent of shader mat3 type in GDScript and C++? How can i set uniform mat3 paramater in both using Transform?
Basis works fine for passing a 3x3 matrix from C++/GDScript to a mat3 uniform in a shader.
Note that you can’t fit all information in Transform into mat3 though. If your Transform describes any translation or projection, you’ll need to use a mat3 together with a Vector3 (or just a mat4 on its own) to represent it.
As for C++, you can do the following (assuming the node is a MeshInstance): Ref<ShaderMaterial> shaderMaterial = godot::Object::cast_to<MeshInstance>(get_node("..."))->get_mesh()->surface_get_material(0);