85 for (
int layer_index = 0; layer_index < ctx->
num_uv_layers; layer_index++) {
140 const MPoly *coarse_poly,
141 const int ptex_of_poly_index)
144 const int first_ptex_loop_index = coarse_poly->
loopstart + ptex_of_poly_index;
149 const int last_ptex_loop_index = coarse_poly->
loopstart +
150 (ptex_of_poly_index + coarse_poly->
totloop - 1) %
152 loops_of_ptex->
first_loop = &coarse_mloop[first_ptex_loop_index];
153 loops_of_ptex->
last_loop = &coarse_mloop[last_ptex_loop_index];
196 const MPoly *coarse_poly)
199 const MLoop *coarse_mloop = coarse_mesh->
mloop;
200 if (coarse_poly->
totloop == 4) {
201 vertex_interpolation->
vertex_data = &coarse_mesh->vdata;
224 const float weight = 1.0f / (
float)coarse_poly->
totloop;
227 for (
int i = 0; i < coarse_poly->
totloop; i++) {
243 const MPoly *coarse_poly,
246 if (coarse_poly->
totloop == 4) {
252 const MLoop *coarse_mloop = coarse_mesh->
mloop;
266 const float weights[2] = {0.5f, 0.5f};
267 const int first_loop_index = loops_of_ptex.
first_loop - coarse_mloop;
268 const int last_loop_index = loops_of_ptex.
last_loop - coarse_mloop;
269 const int first_indices[2] = {
270 coarse_mloop[first_loop_index].
v,
274 const int last_indices[2] = {
275 coarse_mloop[first_loop_index].
v,
276 coarse_mloop[last_loop_index].
v,
331 const MPoly *coarse_poly)
334 if (coarse_poly->
totloop == 4) {
358 const float weight = 1.0f / (
float)coarse_poly->
totloop;
361 for (
int i = 0; i < coarse_poly->
totloop; i++) {
377 const MPoly *coarse_poly,
380 if (coarse_poly->
totloop == 4) {
386 const MLoop *coarse_mloop = coarse_mesh->
mloop;
398 const float weights[2] = {0.5f, 0.5f};
399 const int base_loop_index = coarse_poly->
loopstart;
400 const int first_loop_index = loops_of_ptex.
first_loop - coarse_mloop;
401 const int second_loop_index = base_loop_index +
402 (first_loop_index - base_loop_index + 1) % coarse_poly->
totloop;
403 const int first_indices[2] = {first_loop_index, second_loop_index};
404 const int last_indices[2] = {
405 loops_of_ptex.last_loop - coarse_mloop,
406 loops_of_ptex.first_loop - coarse_mloop,
458 const int ptex_face_index,
479 const int ptex_face_index,
486 float dummy_P[3], dPdu[3], dPdv[3],
D[3];
514 const int num_vertices,
517 const int num_polygons)
526 subdiv_context->
coarse_mesh, num_vertices, num_edges, 0, num_loops, num_polygons,
mask);
539 const MVert *coarse_vertex,
540 MVert *subdiv_vertex)
544 const int coarse_vertex_index = coarse_vertex - coarse_mesh->
mvert;
545 const int subdiv_vertex_index = subdiv_vertex - subdiv_mesh->
mvert;
547 &coarse_mesh->vdata, &ctx->
subdiv_mesh->vdata, coarse_vertex_index, subdiv_vertex_index, 1);
551 MVert *subdiv_vertex,
557 const float weights[4] = {(1.0f - u) * (1.0f -
v), u * (1.0f -
v), u *
v, (1.0f - u) *
v};
564 subdiv_vertex_index);
571 const int ptex_face_index,
574 const MVert *coarse_vert,
580 float D[3] = {0.0f, 0.0f, 0.0f};
604 const int ptex_face_index,
613 float D[3] = {0.0f, 0.0f, 0.0f};
637 const int ptex_face_index,
640 const int subdiv_vertex_index)
645 MVert *subdiv_vert = &subdiv_mvert[subdiv_vertex_index];
651 const int ptex_face_index,
654 const int UNUSED(coarse_vertex_index),
655 const int UNUSED(coarse_poly_index),
656 const int UNUSED(coarse_corner),
657 const int subdiv_vertex_index)
660 foreach_context, tls, ptex_face_index, u,
v, subdiv_vertex_index);
665 const int ptex_face_index,
668 const int UNUSED(coarse_edge_index),
669 const int UNUSED(coarse_poly_index),
670 const int UNUSED(coarse_corner),
671 const int subdiv_vertex_index)
674 foreach_context, tls, ptex_face_index, u,
v, subdiv_vertex_index);
679 const int ptex_face_index,
682 const int coarse_vertex_index,
683 const int UNUSED(coarse_poly_index),
684 const int UNUSED(coarse_corner),
685 const int subdiv_vertex_index)
690 const MVert *coarse_mvert = coarse_mesh->
mvert;
693 const MVert *coarse_vert = &coarse_mvert[coarse_vertex_index];
694 MVert *subdiv_vert = &subdiv_mvert[subdiv_vertex_index];
696 ctx, ptex_face_index, u,
v, coarse_vert, subdiv_vert);
701 const MPoly *coarse_poly,
702 const int coarse_corner)
729 const int ptex_face_index,
732 const int UNUSED(coarse_edge_index),
733 const int coarse_poly_index,
734 const int coarse_corner,
735 const int subdiv_vertex_index)
740 const MPoly *coarse_mpoly = coarse_mesh->
mpoly;
741 const MPoly *coarse_poly = &coarse_mpoly[coarse_poly_index];
744 MVert *subdiv_vert = &subdiv_mvert[subdiv_vertex_index];
752 if (coarse_poly->
totloop == 4) {
753 if (u == 0.5f &&
v == 0.5f) {
758 if (u == 1.0f &&
v == 1.0f) {
777 const int ptex_face_index,
780 const int coarse_poly_index,
781 const int coarse_corner,
782 const int subdiv_vertex_index)
788 const MPoly *coarse_mpoly = coarse_mesh->
mpoly;
789 const MPoly *coarse_poly = &coarse_mpoly[coarse_poly_index];
792 MVert *subdiv_vert = &subdiv_mvert[subdiv_vertex_index];
796 subdiv, ptex_face_index, u,
v, subdiv_vert->
co, subdiv_vert->
no);
808 const MEdge *coarse_edge)
811 if (coarse_edge ==
NULL) {
814 subdiv_edge->
flag = 0;
831 const int coarse_edge_index,
832 const int subdiv_edge_index,
839 MEdge *subdiv_edge = &subdiv_medge[subdiv_edge_index];
843 const MEdge *coarse_medge = coarse_mesh->
medge;
844 coarse_edge = &coarse_medge[coarse_edge_index];
847 subdiv_edge->
v1 = subdiv_v1;
848 subdiv_edge->
v2 = subdiv_v2;
864 const float weights[4] = {(1.0f - u) * (1.0f -
v), u * (1.0f -
v), u *
v, (1.0f - u) *
v};
877 const int ptex_face_index,
886 for (
int layer_index = 0; layer_index < ctx->
num_uv_layers; layer_index++) {
894 const MPoly *coarse_poly,
895 const int coarse_corner)
922 const int ptex_face_index,
925 const int UNUSED(coarse_loop_index),
926 const int coarse_poly_index,
927 const int coarse_corner,
928 const int subdiv_loop_index,
929 const int subdiv_vertex_index,
930 const int subdiv_edge_index)
935 const MPoly *coarse_mpoly = coarse_mesh->
mpoly;
936 const MPoly *coarse_poly = &coarse_mpoly[coarse_poly_index];
939 MLoop *subdiv_loop = &subdiv_mloop[subdiv_loop_index];
943 subdiv_loop->
v = subdiv_vertex_index;
944 subdiv_loop->
e = subdiv_edge_index;
955 const MPoly *coarse_poly)
965 const int coarse_poly_index,
966 const int subdiv_poly_index,
967 const int start_loop_index,
973 const MPoly *coarse_mpoly = coarse_mesh->
mpoly;
974 const MPoly *coarse_poly = &coarse_mpoly[coarse_poly_index];
977 MPoly *subdiv_poly = &subdiv_mpoly[subdiv_poly_index];
979 subdiv_poly->
loopstart = start_loop_index;
980 subdiv_poly->
totloop = num_loops;
991 const int coarse_vertex_index,
992 const int subdiv_vertex_index)
996 const MVert *coarse_mvert = coarse_mesh->
mvert;
997 const MVert *coarse_vertex = &coarse_mvert[coarse_vertex_index];
1000 MVert *subdiv_vertex = &subdiv_mvert[subdiv_vertex_index];
1009 const MEdge *neighbors[2])
1012 const MEdge *coarse_medge = coarse_mesh->
medge;
1013 neighbors[0] =
NULL;
1014 neighbors[1] =
NULL;
1015 int neighbor_counters[2] = {0, 0};
1016 for (
int edge_index = 0; edge_index < coarse_mesh->
totedge; edge_index++) {
1017 const MEdge *current_edge = &coarse_medge[edge_index];
1018 if (current_edge == edge) {
1021 if (
ELEM(edge->
v1, current_edge->
v1, current_edge->
v2)) {
1022 neighbors[0] = current_edge;
1023 ++neighbor_counters[0];
1025 if (
ELEM(edge->
v2, current_edge->
v1, current_edge->
v2)) {
1026 neighbors[1] = current_edge;
1027 ++neighbor_counters[1];
1033 if (neighbor_counters[0] > 1) {
1034 neighbors[0] =
NULL;
1036 if (neighbor_counters[1] > 1) {
1037 neighbors[1] =
NULL;
1042 const MEdge *coarse_edge,
1043 const MEdge *neighbors[2],
1044 float points_r[4][3])
1047 const MVert *coarse_mvert = coarse_mesh->
mvert;
1052 if (neighbors[0] !=
NULL) {
1053 if (neighbors[0]->
v1 == coarse_edge->
v1) {
1054 copy_v3_v3(points_r[0], coarse_mvert[neighbors[0]->
v2].co);
1057 copy_v3_v3(points_r[0], coarse_mvert[neighbors[0]->
v1].co);
1061 sub_v3_v3v3(points_r[0], points_r[1], points_r[2]);
1065 if (neighbors[1] !=
NULL) {
1066 if (neighbors[1]->
v1 == coarse_edge->
v2) {
1067 copy_v3_v3(points_r[3], coarse_mvert[neighbors[1]->
v2].co);
1070 copy_v3_v3(points_r[3], coarse_mvert[neighbors[1]->
v1].co);
1074 sub_v3_v3v3(points_r[3], points_r[2], points_r[1]);
1080 const MEdge *coarse_edge,
1082 const int subdiv_vertex_index)
1088 &coarse_mesh->vdata, &subdiv_mesh->vdata, coarse_edge->
v1, subdiv_vertex_index, 1);
1090 else if (u == 1.0f) {
1092 &coarse_mesh->vdata, &subdiv_mesh->vdata, coarse_edge->
v2, subdiv_vertex_index, 1);
1097 const float interpolation_weights[2] = {1.0f - u, u};
1098 const int coarse_vertex_indices[2] = {coarse_edge->
v1, coarse_edge->
v2};
1100 &subdiv_mesh->vdata,
1101 coarse_vertex_indices,
1102 interpolation_weights,
1105 subdiv_vertex_index);
1114 const int coarse_edge_index,
1116 const int subdiv_vertex_index)
1120 const MEdge *coarse_edge = &coarse_mesh->
medge[coarse_edge_index];
1125 const MEdge *neighbors[2];
1130 MVert *subdiv_vertex = &subdiv_mvert[subdiv_vertex_index];
1132 const MVert *coarse_mvert = coarse_mesh->
mvert;
1133 const MVert *vert_1 = &coarse_mvert[coarse_edge->
v1];
1134 const MVert *vert_2 = &coarse_mvert[coarse_edge->
v2];
1145 subdiv_vertex->
flag = 0;
1148 subdiv_vertex->
bweight = 0.0f;
1166 memset(foreach_context, 0,
sizeof(*foreach_context));
1197 const Mesh *coarse_mesh)
1215 subdiv_context.
settings = settings;
1217 subdiv_context.
subdiv = subdiv;
1226 foreach_context.
user_data = &subdiv_context;
typedef float(TangentPoint)[2]
CustomData interface, see also DNA_customdata_types.h.
const CustomData_MeshMasks CD_MASK_EVERYTHING
void CustomData_free(struct CustomData *data, int totelem)
int CustomData_number_of_layers(const struct CustomData *data, int type)
void CustomData_interp(const struct CustomData *source, struct CustomData *dest, const int *src_indices, const float *weights, const float *sub_weights, int count, int dest_index)
void * CustomData_get_layer_n(const struct CustomData *data, int type, int n)
void * CustomData_get_layer(const struct CustomData *data, int type)
void CustomData_free_elem(struct CustomData *data, int index, int count)
void CustomData_copy(const struct CustomData *source, struct CustomData *dest, CustomDataMask mask, eCDAllocType alloctype, int totelem)
void CustomData_copy_data(const struct CustomData *source, struct CustomData *dest, int source_index, int dest_index, int count)
void key_curve_position_weights(float t, float data[4], int type)
struct Mesh * BKE_mesh_new_nomain_from_template_ex(const struct Mesh *me_src, int verts_len, int edges_len, int tessface_len, int loops_len, int polys_len, struct CustomData_MeshMasks mask)
@ SUBDIV_STATS_SUBDIV_TO_MESH_GEOMETRY
@ SUBDIV_STATS_SUBDIV_TO_MESH
void BKE_subdiv_stats_end(SubdivStats *stats, eSubdivStatsValue value)
void BKE_subdiv_stats_begin(SubdivStats *stats, eSubdivStatsValue value)
void BKE_subdiv_eval_limit_point_and_short_normal(struct Subdiv *subdiv, const int ptex_face_index, const float u, const float v, float r_P[3], short r_N[3])
void BKE_subdiv_eval_limit_point(struct Subdiv *subdiv, const int ptex_face_index, const float u, const float v, float r_P[3])
void BKE_subdiv_eval_displacement(struct Subdiv *subdiv, const int ptex_face_index, const float u, const float v, const float dPdu[3], const float dPdv[3], float r_D[3])
bool BKE_subdiv_eval_begin_from_mesh(struct Subdiv *subdiv, const struct Mesh *mesh, const float(*coarse_vertex_cos)[3])
void BKE_subdiv_eval_limit_point_and_derivatives(struct Subdiv *subdiv, const int ptex_face_index, const float u, const float v, float r_P[3], float r_dPdu[3], float r_dPdv[3])
void BKE_subdiv_eval_final_point(struct Subdiv *subdiv, const int ptex_face_index, const float u, const float v, float r_P[3])
void BKE_subdiv_eval_face_varying(struct Subdiv *subdiv, const int face_varying_channel, const int ptex_face_index, const float u, const float v, float r_face_varying[2])
bool BKE_subdiv_foreach_subdiv_geometry(struct Subdiv *subdiv, const struct SubdivForeachContext *context, const struct SubdivToMeshSettings *mesh_settings, const struct Mesh *coarse_mesh)
#define BLI_array_alloca(arr, realsize)
void interp_v3_v3v3(float r[3], const float a[3], const float b[3], const float t)
MINLINE void normal_float_to_short_v3(short r[3], const float n[3])
MINLINE float normalize_v3(float r[3])
MINLINE void sub_v3_v3v3(float r[3], const float a[3], const float b[3])
MINLINE void mul_v3_fl(float r[3], float f)
MINLINE void copy_v3_v3(float r[3], const float a[3])
MINLINE void cross_v3_v3v3(float r[3], const float a[3], const float b[3])
void interp_v3_v3v3v3v3(float p[3], const float v1[3], const float v2[3], const float v3[3], const float v4[3], const float w[4])
MINLINE float normalize_v3_v3(float r[3], const float a[3])
MINLINE void add_v3_v3(float r[3], const float a[3])
#define CD_MASK_MULTIRES_GRIDS
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble v1
Read Guarded memory(de)allocation.
Provides wrapper around system-specific atomic primitives, and some extensions (faked-atomic operatio...
ATTR_WARN_UNUSED_RESULT const BMVert * v2
ATTR_WARN_UNUSED_RESULT const BMVert * v
void *(* MEM_calloc_arrayN)(size_t len, size_t size, const char *str)
bool loop_data_storage_allocated
const CustomData * loop_data
CustomData loop_data_storage
const MLoop * second_loop
struct CustomData pdata ldata
SubdivForeachVertexFromEdgeCb vertex_every_edge
SubdivForeachPolygonCb poly
SubdivForeachTopologyInformationCb topology_info
size_t user_data_tls_size
SubdivForeachLooseCb vertex_loose
SubdivForeachVertexInnerCb vertex_inner
SubdivForeachVertexOfLooseEdgeCb vertex_of_loose_edge
void(* user_data_tls_free)(void *tls)
SubdivForeachVertexFromEdgeCb vertex_edge
SubdivForeachVertexFromCornerCb vertex_corner
SubdivForeachVertexFromCornerCb vertex_every_corner
int * accumulated_counters
const SubdivToMeshSettings * settings
bool can_evaluate_normals
MLoopUV * uv_layers[MAX_MTFACE]
float(* accumulated_normals)[3]
const MPoly * loop_interpolation_coarse_poly
VerticesForInterpolation vertex_interpolation
int loop_interpolation_coarse_corner
bool loop_interpolation_initialized
bool vertex_interpolation_initialized
const MPoly * vertex_interpolation_coarse_poly
int vertex_interpolation_coarse_corner
LoopsForInterpolation loop_interpolation
struct SubdivDisplacement * displacement_evaluator
CustomData vertex_data_storage
const CustomData * vertex_data
bool vertex_data_storage_allocated
static void subdiv_vertex_data_interpolate(const SubdivMeshContext *ctx, MVert *subdiv_vertex, const VerticesForInterpolation *vertex_interpolation, const float u, const float v)
static void subdiv_mesh_loop(const SubdivForeachContext *foreach_context, void *tls_v, const int ptex_face_index, const float u, const float v, const int UNUSED(coarse_loop_index), const int coarse_poly_index, const int coarse_corner, const int subdiv_loop_index, const int subdiv_vertex_index, const int subdiv_edge_index)
static void loop_interpolation_init(const SubdivMeshContext *ctx, LoopsForInterpolation *loop_interpolation, const MPoly *coarse_poly)
static void subdiv_mesh_vertex_corner(const SubdivForeachContext *foreach_context, void *UNUSED(tls), const int ptex_face_index, const float u, const float v, const int coarse_vertex_index, const int UNUSED(coarse_poly_index), const int UNUSED(coarse_corner), const int subdiv_vertex_index)
static void evaluate_vertex_and_apply_displacement_copy(const SubdivMeshContext *ctx, const int ptex_face_index, const float u, const float v, const MVert *coarse_vert, MVert *subdiv_vert)
struct SubdivMeshTLS SubdivMeshTLS
static void subdiv_mesh_vertex_of_loose_edge(const struct SubdivForeachContext *foreach_context, void *UNUSED(tls), const int coarse_edge_index, const float u, const int subdiv_vertex_index)
static void loops_of_ptex_get(const SubdivMeshContext *ctx, LoopsOfPtex *loops_of_ptex, const MPoly *coarse_poly, const int ptex_of_poly_index)
static void vertex_interpolation_from_corner(const SubdivMeshContext *ctx, VerticesForInterpolation *vertex_interpolation, const MPoly *coarse_poly, const int corner)
struct VerticesForInterpolation VerticesForInterpolation
static void subdiv_copy_poly_data(const SubdivMeshContext *ctx, MPoly *subdiv_poly, const MPoly *coarse_poly)
static void find_edge_neighbors(const SubdivMeshContext *ctx, const MEdge *edge, const MEdge *neighbors[2])
static void subdiv_mesh_context_free(SubdivMeshContext *ctx)
static bool subdiv_mesh_is_center_vertex(const MPoly *coarse_poly, const float u, const float v)
static void loop_interpolation_end(LoopsForInterpolation *loop_interpolation)
static void subdiv_mesh_vertex_every_corner(const SubdivForeachContext *foreach_context, void *tls, const int ptex_face_index, const float u, const float v, const int UNUSED(coarse_vertex_index), const int UNUSED(coarse_poly_index), const int UNUSED(coarse_corner), const int subdiv_vertex_index)
static void subdiv_mesh_edge(const SubdivForeachContext *foreach_context, void *UNUSED(tls), const int coarse_edge_index, const int subdiv_edge_index, const int subdiv_v1, const int subdiv_v2)
struct LoopsOfPtex LoopsOfPtex
static void subdiv_interpolate_loop_data(const SubdivMeshContext *ctx, MLoop *subdiv_loop, const LoopsForInterpolation *loop_interpolation, const float u, const float v)
static void subdiv_mesh_vertex_every_edge(const SubdivForeachContext *foreach_context, void *tls, const int ptex_face_index, const float u, const float v, const int UNUSED(coarse_edge_index), const int UNUSED(coarse_poly_index), const int UNUSED(coarse_corner), const int subdiv_vertex_index)
static void setup_foreach_callbacks(const SubdivMeshContext *subdiv_context, SubdivForeachContext *foreach_context)
static void subdiv_mesh_tag_center_vertex(const MPoly *coarse_poly, MVert *subdiv_vert, const float u, const float v)
static void subdiv_mesh_ensure_vertex_interpolation(SubdivMeshContext *ctx, SubdivMeshTLS *tls, const MPoly *coarse_poly, const int coarse_corner)
static void subdiv_mesh_tls_free(void *tls_v)
static void subdiv_vertex_data_copy(const SubdivMeshContext *ctx, const MVert *coarse_vertex, MVert *subdiv_vertex)
static void subdiv_eval_uv_layer(SubdivMeshContext *ctx, MLoop *subdiv_loop, const int ptex_face_index, const float u, const float v)
static void subdiv_mesh_vertex_of_loose_edge_interpolate(SubdivMeshContext *ctx, const MEdge *coarse_edge, const float u, const int subdiv_vertex_index)
static void subdiv_mesh_ctx_cache_custom_data_layers(SubdivMeshContext *ctx)
static void vertex_interpolation_end(VerticesForInterpolation *vertex_interpolation)
static void subdiv_accumulate_vertex_normal_and_displacement(SubdivMeshContext *ctx, const int ptex_face_index, const float u, const float v, MVert *subdiv_vert)
static void evaluate_vertex_and_apply_displacement_interpolate(const SubdivMeshContext *ctx, const int ptex_face_index, const float u, const float v, VerticesForInterpolation *vertex_interpolation, MVert *subdiv_vert)
static void subdiv_mesh_vertex_every_corner_or_edge(const SubdivForeachContext *foreach_context, void *UNUSED(tls), const int ptex_face_index, const float u, const float v, const int subdiv_vertex_index)
static void subdiv_mesh_poly(const SubdivForeachContext *foreach_context, void *UNUSED(tls), const int coarse_poly_index, const int subdiv_poly_index, const int start_loop_index, const int num_loops)
struct SubdivMeshContext SubdivMeshContext
static void subdiv_mesh_vertex_inner(const SubdivForeachContext *foreach_context, void *tls_v, const int ptex_face_index, const float u, const float v, const int coarse_poly_index, const int coarse_corner, const int subdiv_vertex_index)
static void subdiv_copy_edge_data(SubdivMeshContext *ctx, MEdge *subdiv_edge, const MEdge *coarse_edge)
static void subdiv_mesh_vertex_edge(const SubdivForeachContext *foreach_context, void *tls_v, const int ptex_face_index, const float u, const float v, const int UNUSED(coarse_edge_index), const int coarse_poly_index, const int coarse_corner, const int subdiv_vertex_index)
static void vertex_interpolation_init(const SubdivMeshContext *ctx, VerticesForInterpolation *vertex_interpolation, const MPoly *coarse_poly)
Mesh * BKE_subdiv_to_mesh(Subdiv *subdiv, const SubdivToMeshSettings *settings, const Mesh *coarse_mesh)
static void loop_interpolation_from_corner(const SubdivMeshContext *ctx, LoopsForInterpolation *loop_interpolation, const MPoly *coarse_poly, const int corner)
struct LoopsForInterpolation LoopsForInterpolation
static void eval_final_point_and_vertex_normal(Subdiv *subdiv, const int ptex_face_index, const float u, const float v, float r_P[3], short r_N[3])
static void subdiv_mesh_ctx_cache_uv_layers(SubdivMeshContext *ctx)
static void subdiv_mesh_vertex_loose(const SubdivForeachContext *foreach_context, void *UNUSED(tls), const int coarse_vertex_index, const int subdiv_vertex_index)
static void subdiv_mesh_ensure_loop_interpolation(SubdivMeshContext *ctx, SubdivMeshTLS *tls, const MPoly *coarse_poly, const int coarse_corner)
static void points_for_loose_edges_interpolation_get(SubdivMeshContext *ctx, const MEdge *coarse_edge, const MEdge *neighbors[2], float points_r[4][3])
static void subdiv_mesh_prepare_accumulator(SubdivMeshContext *ctx, int num_vertices)
static bool subdiv_mesh_topology_info(const SubdivForeachContext *foreach_context, const int num_vertices, const int num_edges, const int num_loops, const int num_polygons)
ccl_device_inline float4 mask(const int4 &mask, const float4 &a)
BLI_INLINE float D(const float *data, const int res[3], int x, int y, int z)