Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/render/intern/bake.c')
-rw-r--r--source/blender/render/intern/bake.c42
1 files changed, 21 insertions, 21 deletions
diff --git a/source/blender/render/intern/bake.c b/source/blender/render/intern/bake.c
index d9f7f9fa0af..8e413d3b80a 100644
--- a/source/blender/render/intern/bake.c
+++ b/source/blender/render/intern/bake.c
@@ -92,7 +92,7 @@ typedef struct TSpace {
} TSpace;
typedef struct TriTessFace {
- const MVert *mverts[3];
+ const float *positions[3];
const float *vert_normals[3];
const TSpace *tspace[3];
const float *loop_normal[3];
@@ -194,9 +194,9 @@ static void calc_point_from_barycentric_cage(TriTessFace *triangles_low,
triangle[1] = &triangles_cage[primitive_id];
for (i = 0; i < 2; i++) {
- copy_v3_v3(data[i][0], triangle[i]->mverts[0]->co);
- copy_v3_v3(data[i][1], triangle[i]->mverts[1]->co);
- copy_v3_v3(data[i][2], triangle[i]->mverts[2]->co);
+ copy_v3_v3(data[i][0], triangle[i]->positions[0]);
+ copy_v3_v3(data[i][1], triangle[i]->positions[1]);
+ copy_v3_v3(data[i][2], triangle[i]->positions[2]);
interp_barycentric_tri_v3(data[i], u, v, coord[i]);
}
@@ -236,9 +236,9 @@ static void calc_point_from_barycentric_extrusion(TriTessFace *triangles,
TriTessFace *triangle = &triangles[primitive_id];
is_smooth = triangle->is_smooth || is_cage;
- copy_v3_v3(data[0], triangle->mverts[0]->co);
- copy_v3_v3(data[1], triangle->mverts[1]->co);
- copy_v3_v3(data[2], triangle->mverts[2]->co);
+ copy_v3_v3(data[0], triangle->positions[0]);
+ copy_v3_v3(data[1], triangle->positions[1]);
+ copy_v3_v3(data[2], triangle->positions[2]);
interp_barycentric_tri_v3(data, u, v, coord);
@@ -393,8 +393,8 @@ static bool cast_ray_highpoly(BVHTreeFromMesh *treeData,
/* compute position differentials on low poly object */
float duco_low[3], dvco_low[3], dxco[3], dyco[3];
- sub_v3_v3v3(duco_low, triangle_low->mverts[0]->co, triangle_low->mverts[2]->co);
- sub_v3_v3v3(dvco_low, triangle_low->mverts[1]->co, triangle_low->mverts[2]->co);
+ sub_v3_v3v3(duco_low, triangle_low->positions[0], triangle_low->positions[2]);
+ sub_v3_v3v3(dvco_low, triangle_low->positions[1], triangle_low->positions[2]);
mul_v3_v3fl(dxco, duco_low, pixel_low->du_dx);
madd_v3_v3fl(dxco, dvco_low, pixel_low->dv_dx);
@@ -415,9 +415,9 @@ static bool cast_ray_highpoly(BVHTreeFromMesh *treeData,
/* compute barycentric differentials from position differentials */
barycentric_differentials_from_position(hits[hit_mesh].co,
- triangle_high->mverts[0]->co,
- triangle_high->mverts[1]->co,
- triangle_high->mverts[2]->co,
+ triangle_high->positions[0],
+ triangle_high->positions[1],
+ triangle_high->positions[2],
dxco,
dyco,
triangle_high->normal,
@@ -459,7 +459,7 @@ static TriTessFace *mesh_calc_tri_tessface(Mesh *me, bool tangent, Mesh *me_eval
uint mpoly_prev = UINT_MAX;
float no[3];
- const MVert *verts = BKE_mesh_verts(me);
+ const float(*positions)[3] = BKE_mesh_positions(me);
const MPoly *polys = BKE_mesh_polys(me);
const MLoop *loops = BKE_mesh_loops(me);
@@ -473,10 +473,10 @@ static TriTessFace *mesh_calc_tri_tessface(Mesh *me, bool tangent, Mesh *me_eval
if (precomputed_normals != NULL) {
BKE_mesh_recalc_looptri_with_normals(
- loops, polys, verts, me->totloop, me->totpoly, looptri, precomputed_normals);
+ loops, polys, positions, me->totloop, me->totpoly, looptri, precomputed_normals);
}
else {
- BKE_mesh_recalc_looptri(loops, polys, verts, me->totloop, me->totpoly, looptri);
+ BKE_mesh_recalc_looptri(loops, polys, positions, me->totloop, me->totpoly, looptri);
}
const TSpace *tspace = NULL;
@@ -497,9 +497,9 @@ static TriTessFace *mesh_calc_tri_tessface(Mesh *me, bool tangent, Mesh *me_eval
const MLoopTri *lt = &looptri[i];
const MPoly *mp = &polys[lt->poly];
- triangles[i].mverts[0] = &verts[loops[lt->tri[0]].v];
- triangles[i].mverts[1] = &verts[loops[lt->tri[1]].v];
- triangles[i].mverts[2] = &verts[loops[lt->tri[2]].v];
+ triangles[i].positions[0] = positions[loops[lt->tri[0]].v];
+ triangles[i].positions[1] = positions[loops[lt->tri[1]].v];
+ triangles[i].positions[2] = positions[loops[lt->tri[2]].v];
triangles[i].vert_normals[0] = vert_normals[loops[lt->tri[0]].v];
triangles[i].vert_normals[1] = vert_normals[loops[lt->tri[1]].v];
triangles[i].vert_normals[2] = vert_normals[loops[lt->tri[2]].v];
@@ -519,7 +519,7 @@ static TriTessFace *mesh_calc_tri_tessface(Mesh *me, bool tangent, Mesh *me_eval
if (calculate_normal) {
if (lt->poly != mpoly_prev) {
- BKE_mesh_calc_poly_normal(mp, &loops[mp->loopstart], verts, no);
+ BKE_mesh_calc_poly_normal(mp, &loops[mp->loopstart], positions, no);
mpoly_prev = lt->poly;
}
copy_v3_v3(triangles[i].normal, no);
@@ -741,10 +741,10 @@ void RE_bake_pixels_populate(Mesh *me,
const int tottri = poly_to_tri_count(me->totpoly, me->totloop);
MLoopTri *looptri = MEM_mallocN(sizeof(*looptri) * tottri, __func__);
- const MVert *verts = BKE_mesh_verts(me);
+ const float(*positions)[3] = BKE_mesh_positions(me);
const MPoly *polys = BKE_mesh_polys(me);
const MLoop *loops = BKE_mesh_loops(me);
- BKE_mesh_recalc_looptri(loops, polys, verts, me->totloop, me->totpoly, looptri);
+ BKE_mesh_recalc_looptri(loops, polys, positions, me->totloop, me->totpoly, looptri);
const int *material_indices = BKE_mesh_material_indices(me);
const int materials_num = targets->materials_num;