[Bf-blender-cvs] [b817ca9ff68] cycles_procedural_api: fix triangle indexing
Kévin Dietrich
noreply at git.blender.org
Sun Dec 6 06:26:30 CET 2020
Commit: b817ca9ff6829d437651bb45bceae0190fe8d7c0
Author: Kévin Dietrich
Date: Fri Dec 4 19:20:11 2020 +0100
Branches: cycles_procedural_api
https://developer.blender.org/rBb817ca9ff6829d437651bb45bceae0190fe8d7c0
fix triangle indexing
===================================================================
M intern/cycles/render/alembic.cpp
===================================================================
diff --git a/intern/cycles/render/alembic.cpp b/intern/cycles/render/alembic.cpp
index 8a53c5a226c..5ed453b50aa 100644
--- a/intern/cycles/render/alembic.cpp
+++ b/intern/cycles/render/alembic.cpp
@@ -306,12 +306,7 @@ static void add_normals(const Int32ArraySamplePtr face_indices,
for (size_t i = 0; i < face_indices->size(); ++i) {
int point_index = face_indices_array[i];
- /* polygon winding order in Alembic follows the RenderMan convention, which is the
- * reverse of Cycle, so the normal has to be flipped
- * this code also assumes that the vertices of each polygon corresponding to the same
- * point have the same normal (that we do not have split normals, which is not
- * supported in Cycles anyway) */
- data_float3[point_index] = -make_float3_from_yup(values->get()[i]);
+ data_float3[point_index] = make_float3_from_yup(values->get()[i]);
}
attr.data.add_data(data, time);
@@ -414,9 +409,11 @@ static void add_triangles(const Int32ArraySamplePtr face_counts,
int v2 = face_indices_array[index_offset + j + 2];
shader.push_back_reserved(current_shader);
- triangles.push_back_reserved(make_int3(v0, v1, v2));
+
+ /* Alembic orders the loops following the RenderMan convetion, so need to go in reverse. */
+ triangles.push_back_reserved(make_int3(v2, v1, v0));
triangles_loops.push_back_reserved(
- make_int3(index_offset, index_offset + j + 1, index_offset + j + 2));
+ make_int3(index_offset + j + 2, index_offset + j + 1, index_offset));
}
index_offset += face_counts_array[i];
More information about the Bf-blender-cvs
mailing list