|
Blender
V2.93
|
#include "BKE_subdiv_eval.h"#include "DNA_mesh_types.h"#include "DNA_meshdata_types.h"#include "BLI_bitmap.h"#include "BLI_math_vector.h"#include "BLI_utildefines.h"#include "BKE_customdata.h"#include "BKE_subdiv.h"#include "MEM_guardedalloc.h"#include "opensubdiv_evaluator_capi.h"#include "opensubdiv_topology_refiner_capi.h"Go to the source code of this file.
Functions | |
| bool | BKE_subdiv_eval_begin (Subdiv *subdiv) |
| static void | set_coarse_positions (Subdiv *subdiv, const Mesh *mesh, const float(*coarse_vertex_cos)[3]) |
| static void | set_face_varying_data_from_uv (Subdiv *subdiv, const MLoopUV *mloopuv, const int layer_index) |
| bool | BKE_subdiv_eval_begin_from_mesh (Subdiv *subdiv, const Mesh *mesh, const float(*coarse_vertex_cos)[3]) |
| bool | BKE_subdiv_eval_refine_from_mesh (Subdiv *subdiv, const Mesh *mesh, const float(*coarse_vertex_cos)[3]) |
| void | BKE_subdiv_eval_init_displacement (Subdiv *subdiv) |
| void | BKE_subdiv_eval_limit_point (Subdiv *subdiv, const int ptex_face_index, const float u, const float v, float r_P[3]) |
| void | BKE_subdiv_eval_limit_point_and_derivatives (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_limit_point_and_normal (Subdiv *subdiv, const int ptex_face_index, const float u, const float v, float r_P[3], float r_N[3]) |
| void | BKE_subdiv_eval_limit_point_and_short_normal (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_face_varying (Subdiv *subdiv, const int face_varying_channel, const int ptex_face_index, const float u, const float v, float r_face_varying[2]) |
| void | BKE_subdiv_eval_displacement (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]) |
| void | BKE_subdiv_eval_final_point (Subdiv *subdiv, const int ptex_face_index, const float u, const float v, float r_P[3]) |
| static void | buffer_apply_offset (void **buffer, const int offset) |
| static void | buffer_write_float_value (void **buffer, const float *values_buffer, int num_values) |
| static void | buffer_write_short_value (void **buffer, const short *values_buffer, int num_values) |
| void | BKE_subdiv_eval_limit_patch_resolution_point (Subdiv *subdiv, const int ptex_face_index, const int resolution, void *buffer, const int offset, const int stride) |
| void | BKE_subdiv_eval_limit_patch_resolution_point_and_derivatives (Subdiv *subdiv, const int ptex_face_index, const int resolution, void *point_buffer, const int point_offset, const int point_stride, void *du_buffer, const int du_offset, const int du_stride, void *dv_buffer, const int dv_offset, const int dv_stride) |
| void | BKE_subdiv_eval_limit_patch_resolution_point_and_normal (Subdiv *subdiv, const int ptex_face_index, const int resolution, void *point_buffer, const int point_offset, const int point_stride, void *normal_buffer, const int normal_offset, const int normal_stride) |
| void | BKE_subdiv_eval_limit_patch_resolution_point_and_short_normal (Subdiv *subdiv, const int ptex_face_index, const int resolution, void *point_buffer, const int point_offset, const int point_stride, void *normal_buffer, const int normal_offset, const int normal_stride) |
| bool BKE_subdiv_eval_begin | ( | Subdiv * | subdiv | ) |
Definition at line 41 of file subdiv_eval.c.
References BKE_subdiv_eval_init_displacement(), BKE_subdiv_stats_begin(), BKE_subdiv_stats_end(), BKE_subdiv_stats_reset(), Subdiv::evaluator, NULL, openSubdiv_createEvaluatorFromTopologyRefiner(), Subdiv::stats, SUBDIV_STATS_EVALUATOR_CREATE, and Subdiv::topology_refiner.
Referenced by BKE_subdiv_eval_begin_from_mesh(), and reshape_subdiv_create().
| bool BKE_subdiv_eval_begin_from_mesh | ( | Subdiv * | subdiv, |
| const Mesh * | mesh, | ||
| const float(*) | coarse_vertex_cos[3] | ||
| ) |
Definition at line 124 of file subdiv_eval.c.
References BKE_subdiv_eval_begin(), BKE_subdiv_eval_refine_from_mesh(), and mesh.
| void BKE_subdiv_eval_displacement | ( | 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] | ||
| ) |
Definition at line 247 of file subdiv_eval.c.
References Subdiv::displacement_evaluator, SubdivDisplacement::eval_displacement, NULL, v, and zero_v3().
Referenced by BKE_subdiv_eval_final_point(), subdiv_accumulate_vertex_displacement(), and subdiv_accumulate_vertex_normal_and_displacement().
| void BKE_subdiv_eval_face_varying | ( | Subdiv * | subdiv, |
| const int | face_varying_channel, | ||
| const int | ptex_face_index, | ||
| const float | u, | ||
| const float | v, | ||
| float | r_face_varying[2] | ||
| ) |
Definition at line 236 of file subdiv_eval.c.
References OpenSubdiv_Evaluator::evaluateFaceVarying, Subdiv::evaluator, and v.
Referenced by subdiv_eval_uv_layer().
| void BKE_subdiv_eval_final_point | ( | Subdiv * | subdiv, |
| const int | ptex_face_index, | ||
| const float | u, | ||
| const float | v, | ||
| float | r_P[3] | ||
| ) |
Definition at line 263 of file subdiv_eval.c.
References add_v3_v3(), BKE_subdiv_eval_displacement(), BKE_subdiv_eval_limit_point(), BKE_subdiv_eval_limit_point_and_derivatives(), D(), Subdiv::displacement_evaluator, and v.
Referenced by eval_final_point_and_vertex_normal(), and subdiv_ccg_eval_grid_element_limit().
| void BKE_subdiv_eval_init_displacement | ( | Subdiv * | subdiv | ) |
Definition at line 158 of file subdiv_eval.c.
References Subdiv::displacement_evaluator, SubdivDisplacement::initialize, and NULL.
Referenced by BKE_subdiv_eval_begin().
| void BKE_subdiv_eval_limit_patch_resolution_point | ( | Subdiv * | subdiv, |
| const int | ptex_face_index, | ||
| const int | resolution, | ||
| void * | buffer, | ||
| const int | offset, | ||
| const int | stride | ||
| ) |
Definition at line 297 of file subdiv_eval.c.
References BKE_subdiv_eval_limit_point(), buffer, buffer_apply_offset(), float(), stride, v, x, and y.
| void BKE_subdiv_eval_limit_patch_resolution_point_and_derivatives | ( | Subdiv * | subdiv, |
| const int | ptex_face_index, | ||
| const int | resolution, | ||
| void * | point_buffer, | ||
| const int | point_offset, | ||
| const int | point_stride, | ||
| void * | du_buffer, | ||
| const int | du_offset, | ||
| const int | du_stride, | ||
| void * | dv_buffer, | ||
| const int | dv_offset, | ||
| const int | dv_stride | ||
| ) |
Definition at line 316 of file subdiv_eval.c.
References BKE_subdiv_eval_limit_point_and_derivatives(), buffer_apply_offset(), float(), v, x, and y.
| void BKE_subdiv_eval_limit_patch_resolution_point_and_normal | ( | Subdiv * | subdiv, |
| const int | ptex_face_index, | ||
| const int | resolution, | ||
| void * | point_buffer, | ||
| const int | point_offset, | ||
| const int | point_stride, | ||
| void * | normal_buffer, | ||
| const int | normal_offset, | ||
| const int | normal_stride | ||
| ) |
Definition at line 346 of file subdiv_eval.c.
References BKE_subdiv_eval_limit_point_and_normal(), buffer_apply_offset(), buffer_write_float_value(), float(), normal, v, x, and y.
| void BKE_subdiv_eval_limit_patch_resolution_point_and_short_normal | ( | Subdiv * | subdiv, |
| const int | ptex_face_index, | ||
| const int | resolution, | ||
| void * | point_buffer, | ||
| const int | point_offset, | ||
| const int | point_stride, | ||
| void * | normal_buffer, | ||
| const int | normal_offset, | ||
| const int | normal_stride | ||
| ) |
Definition at line 372 of file subdiv_eval.c.
References BKE_subdiv_eval_limit_point_and_short_normal(), buffer_apply_offset(), buffer_write_short_value(), float(), normal, v, x, and y.
| void BKE_subdiv_eval_limit_point | ( | Subdiv * | subdiv, |
| const int | ptex_face_index, | ||
| const float | u, | ||
| const float | v, | ||
| float | r_P[3] | ||
| ) |
Definition at line 171 of file subdiv_eval.c.
References BKE_subdiv_eval_limit_point_and_derivatives(), NULL, and v.
Referenced by BKE_subdiv_ccg_eval_limit_point(), BKE_subdiv_eval_final_point(), BKE_subdiv_eval_limit_patch_resolution_point(), evaluate_higher_grid_positions_callback(), evaluate_vertex_and_apply_displacement_copy(), evaluate_vertex_and_apply_displacement_interpolate(), subdiv_ccg_eval_grid_element_limit(), and subdiv_mesh_vertex_corner().
| void BKE_subdiv_eval_limit_point_and_derivatives | ( | 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] | ||
| ) |
Definition at line 177 of file subdiv_eval.c.
References equals_v3v3(), OpenSubdiv_Evaluator::evaluateLimit, Subdiv::evaluator, is_zero_v3(), NULL, and v.
Referenced by average_construct_tangent_matrix(), BKE_subdiv_eval_final_point(), BKE_subdiv_eval_limit_patch_resolution_point_and_derivatives(), BKE_subdiv_eval_limit_point(), BKE_subdiv_eval_limit_point_and_normal(), multires_reshape_evaluate_limit_at_grid(), reshape_subdiv_evaluate_limit_at_grid(), subdiv_accumulate_vertex_displacement(), and subdiv_accumulate_vertex_normal_and_displacement().
| void BKE_subdiv_eval_limit_point_and_normal | ( | Subdiv * | subdiv, |
| const int | ptex_face_index, | ||
| const float | u, | ||
| const float | v, | ||
| float | r_P[3], | ||
| float | r_N[3] | ||
| ) |
Definition at line 211 of file subdiv_eval.c.
References BKE_subdiv_eval_limit_point_and_derivatives(), cross_v3_v3v3(), normalize_v3(), and v.
Referenced by BKE_subdiv_eval_limit_patch_resolution_point_and_normal(), BKE_subdiv_eval_limit_point_and_short_normal(), and subdiv_ccg_eval_grid_element_limit().
| void BKE_subdiv_eval_limit_point_and_short_normal | ( | Subdiv * | subdiv, |
| const int | ptex_face_index, | ||
| const float | u, | ||
| const float | v, | ||
| float | r_P[3], | ||
| short | r_N[3] | ||
| ) |
Definition at line 224 of file subdiv_eval.c.
References BKE_subdiv_eval_limit_point_and_normal(), normal_float_to_short_v3(), and v.
Referenced by BKE_subdiv_eval_limit_patch_resolution_point_and_short_normal(), and eval_final_point_and_vertex_normal().
| bool BKE_subdiv_eval_refine_from_mesh | ( | Subdiv * | subdiv, |
| const Mesh * | mesh, | ||
| const float(*) | coarse_vertex_cos[3] | ||
| ) |
Definition at line 134 of file subdiv_eval.c.
References BKE_subdiv_stats_begin(), BKE_subdiv_stats_end(), BLI_assert, CD_MLOOPUV, CustomData_get_layer_n(), CustomData_number_of_layers(), Subdiv::evaluator, Mesh::ldata, mesh, NULL, OpenSubdiv_Evaluator::refine, set_coarse_positions(), set_face_varying_data_from_uv(), Subdiv::stats, and SUBDIV_STATS_EVALUATOR_REFINE.
Referenced by BKE_subdiv_eval_begin_from_mesh().
|
static |
Definition at line 280 of file subdiv_eval.c.
References buffer.
Referenced by BKE_subdiv_eval_limit_patch_resolution_point(), BKE_subdiv_eval_limit_patch_resolution_point_and_derivatives(), BKE_subdiv_eval_limit_patch_resolution_point_and_normal(), and BKE_subdiv_eval_limit_patch_resolution_point_and_short_normal().
|
static |
Definition at line 286 of file subdiv_eval.c.
References buffer.
Referenced by BKE_subdiv_eval_limit_patch_resolution_point_and_normal().
|
static |
Definition at line 292 of file subdiv_eval.c.
References buffer.
Referenced by BKE_subdiv_eval_limit_patch_resolution_point_and_short_normal().
|
static |
Definition at line 64 of file subdiv_eval.c.
References BLI_BITMAP_ENABLE, BLI_BITMAP_NEW, BLI_BITMAP_TEST_BOOL, MVert::co, Subdiv::evaluator, MPoly::loopstart, MEM_freeN, mesh, Mesh::mloop, Mesh::mpoly, Mesh::mvert, NULL, OpenSubdiv_Evaluator::setCoarsePositions, MPoly::totloop, Mesh::totpoly, Mesh::totvert, and MLoop::v.
Referenced by BKE_subdiv_eval_refine_from_mesh().
|
static |
Definition at line 102 of file subdiv_eval.c.
References Subdiv::evaluator, OpenSubdiv_TopologyRefiner::getFaceFVarValueIndices, OpenSubdiv_TopologyRefiner::getNumFaces, OpenSubdiv_TopologyRefiner::getNumFaceVertices, OpenSubdiv_Evaluator::setFaceVaryingData, Subdiv::topology_refiner, and MLoopUV::uv.
Referenced by BKE_subdiv_eval_refine_from_mesh().