172 linear_grids->
level = 0;
181 const size_t grid_area = grid_size * grid_size;
182 const size_t num_grid_elements = num_grids * grid_area;
185 linear_grids->
level = level;
192 for (
int i = 0; i < num_grids; ++i) {
193 const size_t element_offset = grid_area * i;
204 const int grid_size = linear_grids->
grid_size;
206 const int grid_x = lround(grid_coord->
u * (grid_size - 1));
207 const int grid_y = lround(grid_coord->
v * (grid_size - 1));
208 const int grid_element_index = grid_y * grid_size + grid_x;
211 return &grid->
elements[grid_element_index];
222 linear_grid_element->
mask = 0.0f;
235 const float weights[4])
237 result->mask = elements[0].
mask * weights[0] + elements[1].
mask * weights[1] +
238 elements[2].
mask * weights[2] + elements[3].
mask * weights[3];
251 const int num_grids = reshape_context->
num_grids;
253 const int grid_area = grid_size * grid_size;
257 for (
int grid_index = 0; grid_index < num_grids; ++grid_index) {
259 grid_area,
sizeof(
SurfacePoint),
"delta grid displacement");
273 const int num_grids = reshape_context->
num_grids;
274 for (
int grid_index = 0; grid_index < num_grids; ++grid_index) {
285 const int grid_index = grid_coord->
grid_index;
287 const int grid_x = lround(grid_coord->
u * (grid_size - 1));
288 const int grid_y = lround(grid_coord->
v * (grid_size - 1));
289 const int grid_element_index = grid_y * grid_size + grid_x;
292 return &surface_grid->
points[grid_element_index];
298 float tangent_matrix[3][3])
332 const int grid_index = first_corner->
grid_index;
335 for (
int face_corner = 0; face_corner < face->
num_corners; ++face_corner) {
377 return (
a +
t * (
b -
a));
397 const float u01 =
lerp(u, face_grid_coords[0]->u, face_grid_coords[1]->u);
398 const float u32 =
lerp(u, face_grid_coords[3]->u, face_grid_coords[2]->u);
400 const float v03 =
lerp(
v, face_grid_coords[0]->
v, face_grid_coords[3]->
v);
401 const float v12 =
lerp(
v, face_grid_coords[1]->
v, face_grid_coords[2]->
v);
409 const int face_index,
415 const int inner_grid_size =
data->inner_grid_size;
416 const float inner_grid_size_1_inv =
data->inner_grid_size_1_inv;
422 for (
int y = 0;
y < inner_grid_size; ++
y) {
423 const float ptex_v = (
float)
y * inner_grid_size_1_inv;
424 for (
int x = 0;
x < inner_grid_size; ++
x) {
425 const float ptex_u = (
float)
x * inner_grid_size_1_inv;
429 ptex_coord.
u = ptex_u;
430 ptex_coord.
v = ptex_v;
435 data->callback(reshape_smooth_context, &ptex_coord, &grid_coord,
data->callback_userdata_v);
442 void *callback_userdata_v)
448 data.reshape_smooth_context = reshape_smooth_context;
449 data.inner_grid_size = (1 << level_difference) + 1;
450 data.inner_grid_size_1_inv = 1.0f / (
float)(
data.inner_grid_size - 1);
452 data.callback_userdata_v = callback_userdata_v;
487 const MEdge *base_edge)
565 const int num_vertices,
568 const int num_polygons,
569 const int *
UNUSED(subdiv_polygon_offset))
579 num_vertices,
sizeof(
Vertex),
"smooth vertices");
583 max_edges,
sizeof(
Edge),
"smooth edges");
587 num_loops,
sizeof(
Corner),
"smooth corners");
591 num_polygons,
sizeof(
Face),
"smooth faces");
598 const int coarse_vertex_index,
599 const int subdiv_vertex_index)
603 BLI_assert(subdiv_vertex_index < reshape_smooth_context->geometry.num_vertices);
612 if (coarse_vertex_index == -1) {
619 if (cd_vertex_crease ==
NULL) {
623 float crease = cd_vertex_crease[coarse_vertex_index];
625 if (crease == 0.0f) {
636 const int coarse_vertex_index,
637 const int subdiv_vertex_index)
647 const MPoly *base_poly = &base_mesh->
mpoly[face_index];
648 const int num_corners = base_poly->
totloop;
652 if (grid_coord.
u == 0.0f && grid_coord.
v == 0.0f) {
653 for (
int current_corner = 0; current_corner < num_corners; ++current_corner) {
654 GridCoord corner_grid_coord = grid_coord;
655 corner_grid_coord.
grid_index = start_grid_index + current_corner;
657 foreach_context, &corner_grid_coord, coarse_vertex_index, subdiv_vertex_index);
664 if (grid_coord.
u == 0.0f) {
666 prev_grid_coord.
grid_index = start_grid_index + ((
corner + num_corners - 1) % num_corners);
667 prev_grid_coord.
u = grid_coord.
v;
668 prev_grid_coord.
v = 0.0f;
671 foreach_context, &prev_grid_coord, coarse_vertex_index, subdiv_vertex_index);
674 if (grid_coord.
v == 0.0f) {
676 next_grid_coord.
grid_index = start_grid_index + ((
corner + 1) % num_corners);
677 next_grid_coord.
u = 0.0f;
678 next_grid_coord.
v = grid_coord.
u;
681 foreach_context, &next_grid_coord, coarse_vertex_index, subdiv_vertex_index);
687 const int ptex_face_index,
688 const float ptex_face_u,
689 const float ptex_face_v,
690 const int UNUSED(coarse_poly_index),
691 const int UNUSED(coarse_corner),
692 const int subdiv_vertex_index)
699 foreach_vertex(foreach_context, &ptex_coord, -1, subdiv_vertex_index);
704 const int ptex_face_index,
705 const float ptex_face_u,
706 const float ptex_face_v,
707 const int coarse_vertex_index,
708 const int UNUSED(coarse_face_index),
709 const int UNUSED(coarse_face_corner),
710 const int subdiv_vertex_index)
717 foreach_vertex(foreach_context, &ptex_coord, coarse_vertex_index, subdiv_vertex_index);
722 const int ptex_face_index,
723 const float ptex_face_u,
724 const float ptex_face_v,
725 const int UNUSED(coarse_edge_index),
726 const int UNUSED(coarse_face_index),
727 const int UNUSED(coarse_face_corner),
728 const int subdiv_vertex_index)
735 foreach_vertex(foreach_context, &ptex_coord, -1, subdiv_vertex_index);
740 const int UNUSED(ptex_face_index),
741 const float UNUSED(ptex_face_u),
742 const float UNUSED(ptex_face_v),
743 const int UNUSED(coarse_loop_index),
744 const int coarse_poly_index,
745 const int coarse_corner,
746 const int subdiv_loop_index,
747 const int subdiv_vertex_index,
748 const int UNUSED(subdiv_edge_index))
753 BLI_assert(subdiv_loop_index < reshape_smooth_context->geometry.num_corners);
759 corner->grid_index = first_grid_index + coarse_corner;
764 const int UNUSED(coarse_poly_index),
765 const int subdiv_poly_index,
766 const int start_loop_index,
771 BLI_assert(subdiv_poly_index < reshape_smooth_context->geometry.num_faces);
780 const int UNUSED(coarse_edge_index),
782 const int vertex_index)
800 BLI_assert(edge_index < reshape_smooth_context->geometry.max_edges);
803 edge->v1 = subdiv_v1;
804 edge->v2 = subdiv_v2;
810 const int coarse_edge_index,
811 const int UNUSED(subdiv_edge_index),
821 store_edge(reshape_smooth_context, subdiv_v1, subdiv_v2, (
char)255);
838 const MEdge *base_edge = &base_mesh->
medge[coarse_edge_index];
843 store_edge(reshape_smooth_context, subdiv_v1, subdiv_v2, crease);
855 "non_loose_base_edge_map");
857 int num_used_edges = 0;
858 for (
int poly_index = 0; poly_index < base_mesh->
totpoly; ++poly_index) {
859 const MPoly *base_poly = &base_mpoly[poly_index];
874 const int num_subdiv_vertices_per_base_edge = resolution - 2;
876 (num_subdiv_vertices_per_base_edge + 1);
892 .user_data = reshape_smooth_context,
903 reshape_context->
subdiv, &foreach_context, &mesh_settings, reshape_context->
base_mesh);
959 BLI_assert(face_index < reshape_smooth_context->geometry.num_faces);
970 BLI_assert(face_index < reshape_smooth_context->geometry.num_faces);
988 const int edge_index,
989 int edge_vertices[2])
992 BLI_assert(edge_index < reshape_smooth_context->geometry.num_edges);
995 edge_vertices[0] = edge->v1;
996 edge_vertices[1] = edge->v2;
1002 BLI_assert(edge_index < reshape_smooth_context->geometry.num_edges);
1005 return edge->sharpness;
1011 BLI_assert(vertex_index < reshape_smooth_context->geometry.num_vertices);
1021 BLI_assert(vertex_index < reshape_smooth_context->geometry.num_vertices);
1063 converter->
user_data = (
void *)reshape_smooth_context;
1100 for (
int i = 0; i < num_vertices; ++i) {
1103 coarse_position_cb(reshape_smooth_context, vertex,
P);
1130 if (grid_coord ==
NULL) {
1136 float tangent_matrix[3][3];
1160 if (grid_coord ==
NULL) {
1166 reshape_context, grid_coord);
1182 float r_tangent_matrix[3][3])
1186 float dPdu[3], dPdv[3];
1199 reshape_context, face_index,
corner, dPdu, dPdv, r_tangent_matrix);
1218 linear_grid_element.
mask = orig_grid_element.
mask;
1220 return linear_grid_element;
1228 reshape_context, grid_coord);
1233 if (final_grid_element.
mask !=
NULL) {
1234 linear_grid_element.
mask = *final_grid_element.
mask;
1237 return linear_grid_element;
1252 const int reshape_level = reshape_context->
reshape.
level;
1254 const int reshape_level_grid_size_1 = reshape_level_grid_size - 1;
1255 const float reshape_level_grid_size_1_inv = 1.0f / (
float)(reshape_level_grid_size_1);
1257 const float x_f = grid_coord->
u * reshape_level_grid_size_1;
1258 const float y_f = grid_coord->
v * reshape_level_grid_size_1;
1260 const int x_i = x_f;
1261 const int y_i = y_f;
1262 const int x_n_i = (x_i == reshape_level_grid_size - 1) ? (x_i) : (x_i + 1);
1263 const int y_n_i = (y_i == reshape_level_grid_size - 1) ? (y_i) : (y_i + 1);
1265 const int corners_int_coords[4][2] = {{x_i, y_i}, {x_n_i, y_i}, {x_n_i, y_n_i}, {x_i, y_n_i}};
1268 for (
int i = 0; i < 4; ++i) {
1271 corner_grid_coord.
u = corners_int_coords[i][0] * reshape_level_grid_size_1_inv;
1272 corner_grid_coord.
v = corners_int_coords[i][1] * reshape_level_grid_size_1_inv;
1275 &corner_grid_coord);
1277 &corner_grid_coord);
1281 const float u = x_f - x_i;
1282 const float v = y_f - y_i;
1283 const float weights[4] = {(1.0f - u) * (1.0f -
v), u * (1.0f -
v), u *
v, (1.0f - u) *
v};
1292 void *
UNUSED(userdata_v))
1303 const int num_grids = reshape_context->
num_grids;
1304 const int top_level = reshape_context->
top.
level;
1323 if (final_grid_element->
mask !=
NULL) {
1325 orig_grid_element.
mask + linear_delta_element->
mask, 0.0f, 1.0f);
1339 void *
UNUSED(userdata_v))
1342 float tangent_matrix[3][3];
1344 reshape_smooth_context, ptex_coord, grid_coord, limit_P, tangent_matrix);
1365 float r_orig_final_P[3])
1374 float base_mesh_limit_P[3];
1375 float base_mesh_tangent_matrix[3][3];
1377 reshape_context, grid_coord, base_mesh_limit_P, base_mesh_tangent_matrix);
1380 float orig_displacement[3];
1384 add_v3_v3v3(r_orig_final_P, base_mesh_limit_P, orig_displacement);
1391 void *
UNUSED(userdata_v))
1396 float orig_final_P[3];
1404 float original_detail_delta[3];
1405 sub_v3_v3v3(original_detail_delta, orig_final_P, orig_sculpt_point->
P);
1409 float original_detail_delta_tangent[3];
1410 float original_sculpt_tangent_matrix_inv[3][3];
1413 original_detail_delta_tangent, original_sculpt_tangent_matrix_inv, original_detail_delta);
1416 float smooth_limit_P[3];
1417 float smooth_tangent_matrix[3][3];
1419 reshape_smooth_context, ptex_coord, grid_coord, smooth_limit_P, smooth_tangent_matrix);
1422 float smooth_delta[3];
1423 mul_v3_m3v3(smooth_delta, smooth_tangent_matrix, original_detail_delta_tangent);
1448 void *
UNUSED(userdata_v))
1484 if (level_difference == 0) {
1516 if (level_difference == 0) {
1522 context_init(&reshape_smooth_context, reshape_context, mode);
typedef float(TangentPoint)[2]
CustomData interface, see also DNA_customdata_types.h.
eMultiresSubdivideModeType
@ MULTIRES_SUBDIVIDE_LINEAR
@ MULTIRES_SUBDIVIDE_CATMULL_CLARK
@ MULTIRES_SUBDIVIDE_SIMPLE
BLI_INLINE int BKE_subdiv_grid_size_from_level(int level)
BLI_INLINE float BKE_subdiv_crease_to_sharpness_f(float edge_crease)
void BKE_subdiv_free(Subdiv *subdiv)
Subdiv * BKE_subdiv_new_from_converter(const SubdivSettings *settings, struct OpenSubdiv_Converter *converter)
BLI_INLINE float BKE_subdiv_crease_to_sharpness_char(char edge_crease)
@ SUBDIV_EVALUATOR_TYPE_CPU
bool BKE_subdiv_eval_begin(struct Subdiv *subdiv, eSubdivEvaluatorType evaluator_type, struct OpenSubdiv_EvaluatorCache *evaluator_cache, const struct OpenSubdiv_EvaluatorSettings *settings)
void BKE_subdiv_eval_limit_point(struct Subdiv *subdiv, int ptex_face_index, float u, float v, float r_P[3])
void BKE_subdiv_eval_limit_point_and_derivatives(struct Subdiv *subdiv, int ptex_face_index, float u, float v, float r_P[3], float r_dPdu[3], float r_dPdv[3])
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_BITMAP_NEW(_num, _alloc_string)
#define BLI_BITMAP_ENABLE(_bitmap, _index)
#define BLI_BITMAP_TEST_BOOL(_bitmap, _index)
MINLINE float clamp_f(float value, float min, float max)
void copy_m3_m3(float m1[3][3], const float m2[3][3])
bool invert_m3_m3(float R[3][3], const float A[3][3])
void mul_v3_m3v3(float r[3], const float M[3][3], const float a[3])
MINLINE void sub_v3_v3v3(float r[3], const float a[3], const float b[3])
MINLINE void copy_v3_v3(float r[3], const float a[3])
MINLINE void add_v3_v3v3(float r[3], const float a[3], const float b[3])
MINLINE void zero_v3(float r[3])
void BLI_task_parallel_range(int start, int stop, void *userdata, TaskParallelRangeFunc func, const TaskParallelSettings *settings)
BLI_INLINE void BLI_parallel_range_settings_defaults(TaskParallelSettings *settings)
_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 y
_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 GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble u2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLdouble GLdouble v2 _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLdouble GLdouble nz _GL_VOID_RET _GL_VOID GLfloat GLfloat nz _GL_VOID_RET _GL_VOID GLint GLint nz _GL_VOID_RET _GL_VOID GLshort GLshort nz _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const GLfloat *values _GL_VOID_RET _GL_VOID GLsizei const GLushort *values _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID const GLuint const GLclampf *priorities _GL_VOID_RET _GL_VOID GLdouble y _GL_VOID_RET _GL_VOID GLfloat y _GL_VOID_RET _GL_VOID GLint y _GL_VOID_RET _GL_VOID GLshort y _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLfloat GLfloat z _GL_VOID_RET _GL_VOID GLint GLint z _GL_VOID_RET _GL_VOID GLshort GLshort z _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble w _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat w _GL_VOID_RET _GL_VOID GLint GLint GLint w _GL_VOID_RET _GL_VOID GLshort GLshort GLshort w _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble y2 _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat y2 _GL_VOID_RET _GL_VOID GLint GLint GLint y2 _GL_VOID_RET _GL_VOID GLshort GLshort GLshort y2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLuint *buffer _GL_VOID_RET _GL_VOID GLdouble t _GL_VOID_RET _GL_VOID GLfloat t _GL_VOID_RET _GL_VOID GLint t _GL_VOID_RET _GL_VOID GLshort t _GL_VOID_RET _GL_VOID GLdouble t
Read Guarded memory(de)allocation.
#define MEM_reallocN(vmemh, len)
in reality light always falls off quadratically Particle Retrieve the data of the particle that spawned the object for example to give variation to multiple instances of an object Point Retrieve information about points in a point cloud Retrieve the edges of an object as it appears to Cycles topology will always appear triangulated Convert a blackbody temperature to an RGB value Normal Generate a perturbed normal from an RGB normal map image Typically used for faking highly detailed surfaces Generate an OSL shader from a file or text data block Image Sample an image file as a texture Sky Generate a procedural sky texture Noise Generate fractal Perlin noise Wave Generate procedural bands or rings with noise Voronoi Generate Worley noise based on the distance to random points Typically used to generate textures such as or biological cells Brick Generate a procedural texture producing bricks Texture Retrieve multiple types of texture coordinates nTypically used as inputs for texture nodes Vector Convert a point
Provides wrapper around system-specific atomic primitives, and some extensions (faked-atomic operatio...
ATOMIC_INLINE size_t atomic_fetch_and_add_z(size_t *p, size_t x)
ATTR_WARN_UNUSED_RESULT const BMVert * v
DEGForeachIDComponentCallback callback
SyclQueue void void size_t num_bytes void
void *(* MEM_malloc_arrayN)(size_t len, size_t size, const char *str)
void(* MEM_freeN)(void *vmemh)
void *(* MEM_calloc_arrayN)(size_t len, size_t size, const char *str)
int multires_reshape_grid_to_face_index(const MultiresReshapeContext *reshape_context, int grid_index)
ReshapeGridElement multires_reshape_grid_element_for_grid_coord(const MultiresReshapeContext *reshape_context, const GridCoord *grid_coord)
void multires_reshape_tangent_matrix_for_corner(const MultiresReshapeContext *reshape_context, int face_index, int corner, const float dPdu[3], const float dPdv[3], float r_tangent_matrix[3][3])
int multires_reshape_grid_to_corner(const MultiresReshapeContext *reshape_context, int grid_index)
ReshapeConstGridElement multires_reshape_orig_grid_element_for_grid_coord(const MultiresReshapeContext *reshape_context, const GridCoord *grid_coord)
GridCoord multires_reshape_ptex_coord_to_grid(const MultiresReshapeContext *reshape_context, const PTexCoord *ptex_coord)
void multires_reshape_evaluate_limit_at_grid(const MultiresReshapeContext *reshape_context, const GridCoord *grid_coord, float r_P[3], float r_tangent_matrix[3][3])
void multires_reshape_smooth_object_grids(const MultiresReshapeContext *reshape_context, const eMultiresSubdivideModeType mode)
static void foreach_vertex_every_corner(const struct SubdivForeachContext *foreach_context, void *UNUSED(tls_v), const int ptex_face_index, const float ptex_face_u, const float ptex_face_v, const int coarse_vertex_index, const int UNUSED(coarse_face_index), const int UNUSED(coarse_face_corner), const int subdiv_vertex_index)
static LinearGridElement linear_grid_element_final_get(const MultiresReshapeSmoothContext *reshape_smooth_context, const GridCoord *grid_coord)
static void reshape_subdiv_evaluate_limit_at_grid(const MultiresReshapeSmoothContext *reshape_smooth_context, const PTexCoord *ptex_coord, const GridCoord *grid_coord, float limit_P[3], float r_tangent_matrix[3][3])
static int get_num_edges(const struct OpenSubdiv_Converter *converter)
void(* ForeachTopLevelGridCoordCallback)(const MultiresReshapeSmoothContext *reshape_smooth_context, const PTexCoord *ptex_coord, const GridCoord *grid_coord, void *userdata_v)
static void reshape_subdiv_refine_final_P(const MultiresReshapeSmoothContext *reshape_smooth_context, const Vertex *vertex, float r_P[3])
static void foreach_vertex_every_edge(const struct SubdivForeachContext *foreach_context, void *UNUSED(tls_v), const int ptex_face_index, const float ptex_face_u, const float ptex_face_v, const int UNUSED(coarse_edge_index), const int UNUSED(coarse_face_index), const int UNUSED(coarse_face_corner), const int subdiv_vertex_index)
static void foreach_toplevel_grid_coord_task(void *__restrict userdata_v, const int face_index, const TaskParallelTLS *__restrict UNUSED(tls))
void multires_reshape_smooth_object_grids_with_details(const MultiresReshapeContext *reshape_context)
static void propagate_linear_data_delta(const MultiresReshapeSmoothContext *reshape_smooth_context, ReshapeGridElement *final_grid_element, const GridCoord *grid_coord)
static void reshape_subdiv_refine(const MultiresReshapeSmoothContext *reshape_smooth_context, ReshapeSubdivCoarsePositionCb coarse_position_cb)
static char get_effective_crease_char(const MultiresReshapeSmoothContext *reshape_smooth_context, const MEdge *base_edge)
static bool specifies_full_topology(const OpenSubdiv_Converter *UNUSED(converter))
static LinearGridElement * linear_grid_element_get(const LinearGrids *linear_grids, const GridCoord *grid_coord)
struct LinearGrid LinearGrid
struct SurfacePoint SurfacePoint
static float get_edge_sharpness(const OpenSubdiv_Converter *converter, const int edge_index)
struct MultiresReshapeSmoothContext MultiresReshapeSmoothContext
static OpenSubdiv_SchemeType get_scheme_type(const OpenSubdiv_Converter *UNUSED(converter))
static void foreach_single_vertex(const SubdivForeachContext *foreach_context, const GridCoord *grid_coord, const int coarse_vertex_index, const int subdiv_vertex_index)
static void evaluate_higher_grid_positions_callback(const MultiresReshapeSmoothContext *reshape_smooth_context, const PTexCoord *ptex_coord, const GridCoord *grid_coord, void *UNUSED(userdata_v))
static void foreach_poly(const SubdivForeachContext *foreach_context, void *UNUSED(tls), const int UNUSED(coarse_poly_index), const int subdiv_poly_index, const int start_loop_index, const int num_loops)
static void linear_grids_free(LinearGrids *linear_grids)
static void reshape_subdiv_create(MultiresReshapeSmoothContext *reshape_smooth_context)
static void linear_grid_element_sub(LinearGridElement *result, const LinearGridElement *a, const LinearGridElement *b)
static void evaluate_higher_grid_positions(const MultiresReshapeSmoothContext *reshape_smooth_context)
static LinearGridElement linear_grid_element_orig_get(const MultiresReshapeSmoothContext *reshape_smooth_context, const GridCoord *grid_coord)
static OpenSubdiv_VtxBoundaryInterpolation get_vtx_boundary_interpolation(const struct OpenSubdiv_Converter *converter)
static void foreach_toplevel_grid_coord(const MultiresReshapeSmoothContext *reshape_smooth_context, ForeachTopLevelGridCoordCallback callback, void *callback_userdata_v)
static void linear_grid_element_delta_interpolate(const MultiresReshapeSmoothContext *reshape_smooth_context, const GridCoord *grid_coord, LinearGridElement *result)
static int get_num_faces(const OpenSubdiv_Converter *converter)
static void evaluate_base_surface_grids(const MultiresReshapeSmoothContext *reshape_smooth_context)
static void evaluate_higher_grid_positions_with_details(const MultiresReshapeSmoothContext *reshape_smooth_context)
BLI_INLINE const GridCoord * reshape_subdiv_refine_vertex_grid_coord(const Vertex *vertex)
static void linear_grid_element_interpolate(LinearGridElement *result, const LinearGridElement elements[4], const float weights[4])
static void context_free(MultiresReshapeSmoothContext *reshape_smooth_context)
static void linear_grid_element_init(LinearGridElement *linear_grid_element)
static SurfacePoint * base_surface_grids_read(const MultiresReshapeSmoothContext *reshape_smooth_context, const GridCoord *grid_coord)
struct ForeachTopLevelGridCoordTaskData ForeachHighLevelCoordTaskData
static void grid_coords_from_face_vertices(const MultiresReshapeSmoothContext *reshape_smooth_context, const Face *face, const GridCoord *grid_coords[])
static void context_init(MultiresReshapeSmoothContext *reshape_smooth_context, const MultiresReshapeContext *reshape_context, const eMultiresSubdivideModeType mode)
struct SurfaceGrid SurfaceGrid
static GridCoord * vertex_grid_coord_with_grid_index(const Vertex *vertex, const int grid_index)
static int get_num_vertices(const OpenSubdiv_Converter *converter)
static void foreach_vertex_of_loose_edge(const struct SubdivForeachContext *foreach_context, void *UNUSED(tls), const int UNUSED(coarse_edge_index), const float UNUSED(u), const int vertex_index)
static void linear_grids_allocate(LinearGrids *linear_grids, int num_grids, int level)
static float get_effective_crease_float(const MultiresReshapeSmoothContext *reshape_smooth_context, const float crease)
static void foreach_edge(const struct SubdivForeachContext *foreach_context, void *UNUSED(tls), const int coarse_edge_index, const int UNUSED(subdiv_edge_index), const bool is_loose, const int subdiv_v1, const int subdiv_v2)
static void base_surface_grids_write(const MultiresReshapeSmoothContext *reshape_smooth_context, const GridCoord *grid_coord, float P[3], float tangent_matrix[3][3])
static void evaluate_base_surface_grids_callback(const MultiresReshapeSmoothContext *reshape_smooth_context, const PTexCoord *ptex_coord, const GridCoord *grid_coord, void *UNUSED(userdata_v))
static void base_surface_grids_free(MultiresReshapeSmoothContext *reshape_smooth_context)
static void reshape_subdiv_refine_final(const MultiresReshapeSmoothContext *reshape_smooth_context)
struct LinearGridElement LinearGridElement
static float lerp(float t, float a, float b)
static void evaluate_linear_delta_grids(MultiresReshapeSmoothContext *reshape_smooth_context)
struct LinearGrids LinearGrids
static void geometry_init_loose_information(MultiresReshapeSmoothContext *reshape_smooth_context)
void() ReshapeSubdivCoarsePositionCb(const MultiresReshapeSmoothContext *reshape_smooth_context, const Vertex *vertex, float r_P[3])
static void get_edge_vertices(const OpenSubdiv_Converter *converter, const int edge_index, int edge_vertices[2])
static void reshape_subdiv_refine_orig(const MultiresReshapeSmoothContext *reshape_smooth_context)
static int get_num_face_vertices(const OpenSubdiv_Converter *converter, int face_index)
static void base_surface_grids_allocate(MultiresReshapeSmoothContext *reshape_smooth_context)
static bool is_crease_supported(const MultiresReshapeSmoothContext *reshape_smooth_context)
static void store_edge(MultiresReshapeSmoothContext *reshape_smooth_context, const int subdiv_v1, const int subdiv_v2, const char crease)
static bool foreach_topology_info(const SubdivForeachContext *foreach_context, const int num_vertices, const int num_edges, const int num_loops, const int num_polygons, const int *UNUSED(subdiv_polygon_offset))
static void converter_init(const MultiresReshapeSmoothContext *reshape_smooth_context, OpenSubdiv_Converter *converter)
static void foreach_vertex_inner(const struct SubdivForeachContext *foreach_context, void *UNUSED(tls), const int ptex_face_index, const float ptex_face_u, const float ptex_face_v, const int UNUSED(coarse_poly_index), const int UNUSED(coarse_corner), const int subdiv_vertex_index)
static void evaluate_linear_delta_grids_callback(const MultiresReshapeSmoothContext *reshape_smooth_context, const PTexCoord *UNUSED(ptex_coord), const GridCoord *grid_coord, void *UNUSED(userdata_v))
static void linear_grids_init(LinearGrids *linear_grids)
static int get_reshape_level_resolution(const MultiresReshapeContext *reshape_context)
static void foreach_loop(const struct SubdivForeachContext *foreach_context, void *UNUSED(tls), const int UNUSED(ptex_face_index), const float UNUSED(ptex_face_u), const float UNUSED(ptex_face_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 UNUSED(subdiv_edge_index))
static bool is_infinite_sharp_vertex(const OpenSubdiv_Converter *converter, int vertex_index)
static float get_vertex_sharpness(const OpenSubdiv_Converter *converter, const int vertex_index)
static void reshape_subdiv_refine_orig_P(const MultiresReshapeSmoothContext *reshape_smooth_context, const Vertex *vertex, float r_P[3])
static OpenSubdiv_FVarLinearInterpolation get_fvar_linear_interpolation(const OpenSubdiv_Converter *converter)
static void foreach_vertex(const SubdivForeachContext *foreach_context, const PTexCoord *ptex_coord, const int coarse_vertex_index, const int subdiv_vertex_index)
static void evaluate_higher_grid_positions_with_details_callback(const MultiresReshapeSmoothContext *reshape_smooth_context, const PTexCoord *ptex_coord, const GridCoord *grid_coord, void *UNUSED(userdata_v))
static void evaluate_final_original_point(const MultiresReshapeSmoothContext *reshape_smooth_context, const GridCoord *grid_coord, float r_orig_final_P[3])
static int get_face_grid_index(const MultiresReshapeSmoothContext *reshape_smooth_context, const Face *face)
static void geometry_create(MultiresReshapeSmoothContext *reshape_smooth_context)
static void context_free_geometry(MultiresReshapeSmoothContext *reshape_smooth_context)
static void context_free_subdiv(MultiresReshapeSmoothContext *reshape_smooth_context)
static void interpolate_grid_coord(GridCoord *result, const GridCoord *face_grid_coords[4], const float u, const float v)
static void get_face_vertices(const OpenSubdiv_Converter *converter, int face_index, int *face_vertices)
static const pxr::TfToken b("b", pxr::TfToken::Immortal)
OpenSubdiv_FVarLinearInterpolation
OpenSubdiv_VtxBoundaryInterpolation
const MultiresReshapeSmoothContext * reshape_smooth_context
float inner_grid_size_1_inv
ForeachTopLevelGridCoordCallback callback
void * callback_userdata_v
LinearGridElement * elements
LinearGridElement * elements_storage
struct MultiresReshapeContext::@99 reshape
int * face_start_grid_index
const float * cd_vertex_crease
struct MultiresReshapeContext::@100 top
const MultiresReshapeContext * reshape_context
SurfaceGrid * base_surface_grids
BLI_bitmap * non_loose_base_edge_map
eMultiresSubdivideModeType smoothing_type
LinearGrids linear_delta_grids
struct MultiresReshapeSmoothContext::@102 geometry
int(* getNumVertexFaces)(const struct OpenSubdiv_Converter *converter, const int vertex_index)
bool(* specifiesFullTopology)(const struct OpenSubdiv_Converter *converter)
void(* freeUserData)(const struct OpenSubdiv_Converter *converter)
void(* getFaceVertices)(const struct OpenSubdiv_Converter *converter, const int face_index, int *face_vertices)
float(* getVertexSharpness)(const struct OpenSubdiv_Converter *converter, const int vertex_index)
void(* getFaceEdges)(const struct OpenSubdiv_Converter *converter, const int face_index, int *face_edges)
int(* getNumUVLayers)(const struct OpenSubdiv_Converter *converter)
int(* getNumVertexEdges)(const struct OpenSubdiv_Converter *converter, const int vertex_index)
OpenSubdiv_FVarLinearInterpolation(* getFVarLinearInterpolation)(const struct OpenSubdiv_Converter *converter)
void(* getEdgeVertices)(const struct OpenSubdiv_Converter *converter, const int edge_index, int edge_vertices[2])
OpenSubdiv_SchemeType(* getSchemeType)(const struct OpenSubdiv_Converter *converter)
bool(* isInfiniteSharpVertex)(const struct OpenSubdiv_Converter *converter, const int vertex_index)
void(* getVertexFaces)(const struct OpenSubdiv_Converter *converter, const int vertex_index, int *vertex_faces)
int(* getNumVertices)(const struct OpenSubdiv_Converter *converter)
float(* getEdgeSharpness)(const struct OpenSubdiv_Converter *converter, const int edge_index)
int(* getNumEdges)(const struct OpenSubdiv_Converter *converter)
int(* getNumFaces)(const struct OpenSubdiv_Converter *converter)
int(* getNumEdgeFaces)(const struct OpenSubdiv_Converter *converter, const int edge_index)
int(* getNumUVCoordinates)(const struct OpenSubdiv_Converter *converter)
void(* getVertexEdges)(const struct OpenSubdiv_Converter *converter, const int vertex_index, int *vertex_edges)
void(* finishUVLayer)(const struct OpenSubdiv_Converter *converter)
void(* getEdgeFaces)(const struct OpenSubdiv_Converter *converter, const int edge, int *edge_faces)
OpenSubdiv_VtxBoundaryInterpolation(* getVtxBoundaryInterpolation)(const struct OpenSubdiv_Converter *converter)
void(* precalcUVLayer)(const struct OpenSubdiv_Converter *converter, const int layer_index)
int(* getFaceCornerUVIndex)(const struct OpenSubdiv_Converter *converter, const int face_index, const int corner_index)
int(* getNumFaceVertices)(const struct OpenSubdiv_Converter *converter, const int face_index)
void(* setCoarsePositions)(struct OpenSubdiv_Evaluator *evaluator, const float *positions, const int start_vertex_index, const int num_vertices)
void(* refine)(struct OpenSubdiv_Evaluator *evaluator)
SubdivForeachTopologyInformationCb topology_info
struct OpenSubdiv_Evaluator * evaluator
float tangent_matrix[3][3]
int BKE_subdiv_converter_fvar_linear_from_settings(const SubdivSettings *settings)
void BKE_subdiv_converter_free(struct OpenSubdiv_Converter *converter)
int BKE_subdiv_converter_vtx_boundary_interpolation_from_settings(const SubdivSettings *settings)
BLI_INLINE float D(const float *data, const int res[3], int x, int y, int z)