diff options
author | Rémi Verschelde <remi@verschelde.fr> | 2021-06-12 01:08:03 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-12 01:08:03 +0200 |
commit | fe7559f751e81b21da2eb8252123f384b8a8622d (patch) | |
tree | beff9b1c82829c16438469e64bf004b6cf54c32a | |
parent | 243be9308750c0ab1bef337b9cde005e644a2904 (diff) | |
parent | 336778ed21dcdeead02f3206f859437baf35091f (diff) | |
download | redot-engine-fe7559f751e81b21da2eb8252123f384b8a8622d.tar.gz |
Merge pull request #49522 from JFonS/fix_surfacetool_tangents
Fix tangents array in SurfaceTool
-rw-r--r-- | scene/resources/surface_tool.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/scene/resources/surface_tool.cpp b/scene/resources/surface_tool.cpp index f728376310..1e78561bec 100644 --- a/scene/resources/surface_tool.cpp +++ b/scene/resources/surface_tool.cpp @@ -370,13 +370,13 @@ Array SurfaceTool::commit_to_arrays() { for (uint32_t idx = 0; idx < vertex_array.size(); idx++) { const Vertex &v = vertex_array[idx]; - w[idx + 0] = v.tangent.x; - w[idx + 1] = v.tangent.y; - w[idx + 2] = v.tangent.z; + w[idx * 4 + 0] = v.tangent.x; + w[idx * 4 + 1] = v.tangent.y; + w[idx * 4 + 2] = v.tangent.z; //float d = v.tangent.dot(v.binormal,v.normal); float d = v.binormal.dot(v.normal.cross(v.tangent)); - w[idx + 3] = d < 0 ? -1 : 1; + w[idx * 4 + 3] = d < 0 ? -1 : 1; } a[i] = array; |