Blender
V3.3
|
#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_task.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.
Classes | |
struct | FaceVaryingDataFromUVContext |
Typedefs | |
typedef struct FaceVaryingDataFromUVContext | FaceVaryingDataFromUVContext |
Functions | |
static eOpenSubdivEvaluator | opensubdiv_evalutor_from_subdiv_evaluator_type (eSubdivEvaluatorType evaluator_type) |
bool | BKE_subdiv_eval_begin (Subdiv *subdiv, eSubdivEvaluatorType evaluator_type, OpenSubdiv_EvaluatorCache *evaluator_cache, const OpenSubdiv_EvaluatorSettings *settings) |
static void | set_coarse_positions (Subdiv *subdiv, const Mesh *mesh, const float(*coarse_vertex_cos)[3]) |
static void | set_face_varying_data_from_uv_task (void *__restrict userdata, const int face_index, const TaskParallelTLS *__restrict UNUSED(tls)) |
static void | set_face_varying_data_from_uv (Subdiv *subdiv, const Mesh *mesh, const MLoopUV *mloopuv, const int layer_index) |
static void | set_vertex_data_from_orco (Subdiv *subdiv, const Mesh *mesh) |
static void | get_mesh_evaluator_settings (OpenSubdiv_EvaluatorSettings *settings, const Mesh *mesh) |
bool | BKE_subdiv_eval_begin_from_mesh (Subdiv *subdiv, const Mesh *mesh, const float(*coarse_vertex_cos)[3], eSubdivEvaluatorType evaluator_type, OpenSubdiv_EvaluatorCache *evaluator_cache) |
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_vertex_data (Subdiv *subdiv, const int ptex_face_index, const float u, const float v, float r_vertex_data[]) |
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]) |
typedef struct FaceVaryingDataFromUVContext FaceVaryingDataFromUVContext |
bool BKE_subdiv_eval_begin | ( | Subdiv * | subdiv, |
eSubdivEvaluatorType | evaluator_type, | ||
OpenSubdiv_EvaluatorCache * | evaluator_cache, | ||
const OpenSubdiv_EvaluatorSettings * | settings | ||
) |
Definition at line 49 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(), opensubdiv_evalutor_from_subdiv_evaluator_type(), OpenSubdiv_Evaluator::setSettings, Subdiv::stats, SUBDIV_STATS_EVALUATOR_CREATE, and Subdiv::topology_refiner.
Referenced by BKE_subdiv_eval_begin_from_mesh().
bool BKE_subdiv_eval_begin_from_mesh | ( | Subdiv * | subdiv, |
const Mesh * | mesh, | ||
const float(*) | coarse_vertex_cos[3], | ||
eSubdivEvaluatorType | evaluator_type, | ||
OpenSubdiv_EvaluatorCache * | evaluator_cache | ||
) |
Definition at line 225 of file subdiv_eval.c.
References BKE_subdiv_eval_begin(), BKE_subdiv_eval_refine_from_mesh(), get_mesh_evaluator_settings(), 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 350 of file subdiv_eval.c.
References Subdiv::displacement_evaluator, SubdivDisplacement::eval_displacement, NULL, v, and zero_v3().
Referenced by BKE_subdiv_eval_final_point(), and subdiv_accumulate_vertex_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 339 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 366 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 subdiv_ccg_eval_grid_element_limit(), and subdiv_mesh_vertex_inner().
Definition at line 265 of file subdiv_eval.c.
References Subdiv::displacement_evaluator, SubdivDisplacement::initialize, and NULL.
Referenced by BKE_subdiv_eval_begin().
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 280 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(), 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 286 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_point(), BKE_subdiv_eval_limit_point_and_normal(), multires_reshape_evaluate_limit_at_grid(), reshape_subdiv_evaluate_limit_at_grid(), and subdiv_accumulate_vertex_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 320 of file subdiv_eval.c.
References BKE_subdiv_eval_limit_point_and_derivatives(), cross_v3_v3v3(), normalize_v3(), and v.
Referenced by subdiv_ccg_eval_grid_element_limit().
bool BKE_subdiv_eval_refine_from_mesh | ( | Subdiv * | subdiv, |
const Mesh * | mesh, | ||
const float(*) | coarse_vertex_cos[3] | ||
) |
Definition at line 239 of file subdiv_eval.c.
References BKE_subdiv_stats_begin(), BKE_subdiv_stats_end(), BLI_assert_msg, 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(), set_vertex_data_from_orco(), Subdiv::stats, and SUBDIV_STATS_EVALUATOR_REFINE.
Referenced by BKE_subdiv_eval_begin_from_mesh().
void BKE_subdiv_eval_vertex_data | ( | Subdiv * | subdiv, |
const int | ptex_face_index, | ||
const float | u, | ||
const float | v, | ||
float | r_vertex_data[] | ||
) |
Definition at line 333 of file subdiv_eval.c.
References OpenSubdiv_Evaluator::evaluateVertexData, Subdiv::evaluator, and v.
Referenced by subdiv_vertex_orco_evaluate().
|
static |
Definition at line 219 of file subdiv_eval.c.
References CD_CLOTH_ORCO, CD_ORCO, CustomData_has_layer(), mesh, OpenSubdiv_EvaluatorSettings::num_vertex_data, and Mesh::vdata.
Referenced by BKE_subdiv_eval_begin_from_mesh().
|
static |
Definition at line 30 of file subdiv_eval.c.
References BLI_assert_msg, OPENSUBDIV_EVALUATOR_CPU, OPENSUBDIV_EVALUATOR_GPU, SUBDIV_EVALUATOR_TYPE_CPU, and SUBDIV_EVALUATOR_TYPE_GPU.
Referenced by BKE_subdiv_eval_begin().
|
static |
Definition at line 79 of file subdiv_eval.c.
References BLI_BITMAP_ENABLE, BLI_BITMAP_NEW, BLI_BITMAP_TEST_BOOL, buffer, MVert::co, copy_v3_v3(), Subdiv::evaluator, float(), MPoly::loopstart, MEM_freeN, MEM_mallocN, 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 155 of file subdiv_eval.c.
References BLI_parallel_range_settings_defaults(), BLI_task_parallel_range(), buffer, FaceVaryingDataFromUVContext::buffer, Subdiv::evaluator, float(), OpenSubdiv_TopologyRefiner::getNumFaces, OpenSubdiv_TopologyRefiner::getNumFVarValues, FaceVaryingDataFromUVContext::layer_index, MEM_freeN, MEM_mallocN, FaceVaryingDataFromUVContext::mesh, mesh, TaskParallelSettings::min_iter_per_thread, FaceVaryingDataFromUVContext::mloopuv, set_face_varying_data_from_uv_task(), OpenSubdiv_Evaluator::setFaceVaryingData, Subdiv::topology_refiner, and FaceVaryingDataFromUVContext::topology_refiner.
Referenced by BKE_subdiv_eval_refine_from_mesh().
|
static |
Definition at line 133 of file subdiv_eval.c.
References FaceVaryingDataFromUVContext::buffer, copy_v2_v2(), OpenSubdiv_TopologyRefiner::getFaceFVarValueIndices, OpenSubdiv_TopologyRefiner::getNumFaceVertices, FaceVaryingDataFromUVContext::layer_index, MPoly::loopstart, FaceVaryingDataFromUVContext::mesh, mesh, FaceVaryingDataFromUVContext::mloopuv, Mesh::mpoly, FaceVaryingDataFromUVContext::topology_refiner, and MLoopUV::uv.
Referenced by set_face_varying_data_from_uv().
Definition at line 188 of file subdiv_eval.c.
References CD_CLOTH_ORCO, CD_ORCO, copy_v3_v3(), CustomData_get_layer(), data, Subdiv::evaluator, float(), OpenSubdiv_TopologyRefiner::getNumVertices, mesh, OpenSubdiv_Evaluator::setVertexData, Subdiv::topology_refiner, and Mesh::vdata.
Referenced by BKE_subdiv_eval_refine_from_mesh().