Blender
V3.3
|
#include <math.h>
#include "BKE_subdiv.h"
#include "DNA_mesh_types.h"
#include "DNA_meshdata_types.h"
#include "DNA_modifier_types.h"
#include "DNA_object_types.h"
#include "BLI_math_vector.h"
#include "BLI_utildefines.h"
#include "BKE_customdata.h"
#include "BKE_multires.h"
#include "BKE_subdiv_eval.h"
#include "MEM_guardedalloc.h"
Go to the source code of this file.
Classes | |
struct | PolyCornerIndex |
struct | MultiresDisplacementData |
Typedefs | |
typedef struct PolyCornerIndex | PolyCornerIndex |
typedef struct MultiresDisplacementData | MultiresDisplacementData |
typedef enum eAverageWith | eAverageWith |
Enumerations | |
enum | eAverageWith { AVERAGE_WITH_NONE , AVERAGE_WITH_ALL , AVERAGE_WITH_PREV , AVERAGE_WITH_NEXT } |
Functions | |
static int | displacement_get_grid_and_coord (SubdivDisplacement *displacement, const int ptex_face_index, const float u, const float v, const MDisps **r_displacement_grid, float *grid_u, float *grid_v) |
static const MDisps * | displacement_get_other_grid (SubdivDisplacement *displacement, const int ptex_face_index, const int corner, const int corner_delta) |
BLI_INLINE eAverageWith | read_displacement_grid (const MDisps *displacement_grid, const int grid_size, const float grid_u, const float grid_v, float r_tangent_D[3]) |
static void | average_convert_grid_coord_to_ptex (const MPoly *poly, const int corner, const float grid_u, const float grid_v, float *r_ptex_face_u, float *r_ptex_face_v) |
static void | average_construct_tangent_matrix (Subdiv *subdiv, const MPoly *poly, const int ptex_face_index, const int corner, const float u, const float v, float r_tangent_matrix[3][3]) |
static void | average_read_displacement_tangent (MultiresDisplacementData *data, const MDisps *other_displacement_grid, const float grid_u, const float grid_v, float r_tangent_D[3]) |
static void | average_read_displacement_object (MultiresDisplacementData *data, const MDisps *displacement_grid, const float grid_u, const float grid_v, const int ptex_face_index, const int corner_index, float r_D[3]) |
static void | average_get_other_ptex_and_corner (MultiresDisplacementData *data, const int ptex_face_index, const int corner, const int corner_delta, int *r_other_ptex_face_index, int *r_other_corner_index) |
static void | average_with_other (SubdivDisplacement *displacement, const int ptex_face_index, const int corner, const float grid_u, const float grid_v, const int corner_delta, float r_D[3]) |
static void | average_with_all (SubdivDisplacement *displacement, const int ptex_face_index, const int corner, const float UNUSED(grid_u), const float UNUSED(grid_v), float r_D[3]) |
static void | average_with_next (SubdivDisplacement *displacement, const int ptex_face_index, const int corner, const float grid_u, const float UNUSED(grid_v), float r_D[3]) |
static void | average_with_prev (SubdivDisplacement *displacement, const int ptex_face_index, const int corner, const float UNUSED(grid_u), const float grid_v, float r_D[3]) |
static void | average_displacement (SubdivDisplacement *displacement, eAverageWith average_with, const int ptex_face_index, const int corner, const float grid_u, const float grid_v, float r_D[3]) |
static int | displacement_get_face_corner (MultiresDisplacementData *data, const int ptex_face_index, const float u, const float v) |
static void | initialize (SubdivDisplacement *displacement) |
static void | eval_displacement (SubdivDisplacement *displacement, const int ptex_face_index, const float u, const float v, const float dPdu[3], const float dPdv[3], float r_D[3]) |
static void | free_displacement (SubdivDisplacement *displacement) |
static int | count_num_ptex_faces (const Mesh *mesh) |
static void | displacement_data_init_mapping (SubdivDisplacement *displacement, const Mesh *mesh) |
static void | displacement_init_data (SubdivDisplacement *displacement, Subdiv *subdiv, Mesh *mesh, const MultiresModifierData *mmd) |
static void | displacement_init_functions (SubdivDisplacement *displacement) |
void | BKE_subdiv_displacement_attach_from_multires (Subdiv *subdiv, Mesh *mesh, const MultiresModifierData *mmd) |
typedef enum eAverageWith eAverageWith |
typedef struct MultiresDisplacementData MultiresDisplacementData |
typedef struct PolyCornerIndex PolyCornerIndex |
enum eAverageWith |
Enumerator | |
---|---|
AVERAGE_WITH_NONE | |
AVERAGE_WITH_ALL | |
AVERAGE_WITH_PREV | |
AVERAGE_WITH_NEXT |
Definition at line 55 of file subdiv_displacement_multires.c.
|
static |
Definition at line 141 of file subdiv_displacement_multires.c.
References BKE_multires_construct_tangent_matrix(), BKE_subdiv_eval_limit_point_and_derivatives(), MPoly::totloop, and v.
Referenced by average_read_displacement_object().
|
static |
Definition at line 126 of file subdiv_displacement_multires.c.
References BKE_subdiv_grid_uv_to_ptex_face_uv(), BKE_subdiv_rotate_grid_to_quad(), and MPoly::totloop.
Referenced by average_read_displacement_object().
|
static |
Definition at line 274 of file subdiv_displacement_multires.c.
References AVERAGE_WITH_ALL, average_with_all(), AVERAGE_WITH_NEXT, average_with_next(), AVERAGE_WITH_NONE, AVERAGE_WITH_PREV, and average_with_prev().
Referenced by eval_displacement().
|
static |
Definition at line 191 of file subdiv_displacement_multires.c.
References data, PolyCornerIndex::poly_index, and MPoly::totloop.
Referenced by average_with_other().
|
static |
Definition at line 165 of file subdiv_displacement_multires.c.
References average_construct_tangent_matrix(), average_convert_grid_coord_to_ptex(), average_read_displacement_tangent(), data, mul_v3_m3v3(), PolyCornerIndex::poly_index, and v.
Referenced by average_with_other().
|
static |
Definition at line 156 of file subdiv_displacement_multires.c.
References data, and read_displacement_grid().
Referenced by average_read_displacement_object().
|
static |
Definition at line 238 of file subdiv_displacement_multires.c.
References average_with_other(), data, PolyCornerIndex::poly_index, MPoly::totloop, and SubdivDisplacement::user_data.
Referenced by average_displacement().
|
static |
Definition at line 254 of file subdiv_displacement_multires.c.
References average_with_other().
Referenced by average_displacement().
|
static |
Definition at line 210 of file subdiv_displacement_multires.c.
References add_v3_v3(), average_get_other_ptex_and_corner(), average_read_displacement_object(), data, displacement_get_other_grid(), mul_v3_fl(), and SubdivDisplacement::user_data.
Referenced by average_with_all(), average_with_next(), and average_with_prev().
|
static |
Definition at line 264 of file subdiv_displacement_multires.c.
References average_with_other().
Referenced by average_displacement().
void BKE_subdiv_displacement_attach_from_multires | ( | Subdiv * | subdiv, |
Mesh * | mesh, | ||
const MultiresModifierData * | mmd | ||
) |
Definition at line 423 of file subdiv_displacement_multires.c.
References BKE_subdiv_displacement_detach(), CD_MDISPS, CustomData_has_layer(), Subdiv::displacement_evaluator, displacement_init_data(), displacement_init_functions(), Mesh::ldata, MEM_callocN, mesh, and SubdivDisplacement::user_data.
|
static |
Definition at line 360 of file subdiv_displacement_multires.c.
References mesh, Mesh::mpoly, MPoly::totloop, and Mesh::totpoly.
Referenced by displacement_data_init_mapping().
|
static |
Definition at line 371 of file subdiv_displacement_multires.c.
References PolyCornerIndex::corner, count_num_ptex_faces(), data, MEM_malloc_arrayN, mesh, Mesh::mpoly, PolyCornerIndex::poly_index, MPoly::totloop, Mesh::totpoly, and SubdivDisplacement::user_data.
Referenced by displacement_init_data().
|
static |
Definition at line 297 of file subdiv_displacement_multires.c.
References BKE_subdiv_rotate_quad_to_corner(), PolyCornerIndex::corner, data, PolyCornerIndex::poly_index, MPoly::totloop, and v.
Referenced by eval_displacement().
|
static |
Definition at line 62 of file subdiv_displacement_multires.c.
References BKE_subdiv_ptex_face_uv_to_grid_uv(), BKE_subdiv_rotate_quad_to_corner(), PolyCornerIndex::corner, data, MPoly::loopstart, PolyCornerIndex::poly_index, MPoly::totloop, SubdivDisplacement::user_data, and v.
Referenced by eval_displacement().
|
static |
Definition at line 88 of file subdiv_displacement_multires.c.
References PolyCornerIndex::corner, data, MPoly::loopstart, PolyCornerIndex::poly_index, MPoly::totloop, and SubdivDisplacement::user_data.
Referenced by average_with_other().
|
static |
Definition at line 399 of file subdiv_displacement_multires.c.
References BKE_subdiv_face_ptex_offset_get(), BKE_subdiv_grid_size_from_level(), CD_MDISPS, CustomData_get_layer(), data, displacement_data_init_mapping(), Mesh::ldata, mesh, Mesh::mpoly, MultiresModifierData::totlvl, and SubdivDisplacement::user_data.
Referenced by BKE_subdiv_displacement_attach_from_multires().
|
static |
Definition at line 416 of file subdiv_displacement_multires.c.
References eval_displacement(), SubdivDisplacement::eval_displacement, SubdivDisplacement::free, free_displacement(), initialize(), and SubdivDisplacement::initialize.
Referenced by BKE_subdiv_displacement_attach_from_multires().
|
static |
Definition at line 321 of file subdiv_displacement_multires.c.
References average_displacement(), BKE_multires_construct_tangent_matrix(), BLI_assert, data, displacement_get_face_corner(), displacement_get_grid_and_coord(), mul_v3_m3v3(), read_displacement_grid(), SubdivDisplacement::user_data, and v.
Referenced by displacement_init_functions(), and shader_eval_displacement().
|
static |
Definition at line 351 of file subdiv_displacement_multires.c.
References data, MEM_freeN, and SubdivDisplacement::user_data.
Referenced by displacement_init_functions().
|
static |
Definition at line 314 of file subdiv_displacement_multires.c.
References data, multiresModifier_ensure_external_read(), and SubdivDisplacement::user_data.
Referenced by BKE_volumes_init(), btHeightfieldTerrainShape(), displacement_init_functions(), and read_layer_samples().
BLI_INLINE eAverageWith read_displacement_grid | ( | const MDisps * | displacement_grid, |
const int | grid_size, | ||
const float | grid_u, | ||
const float | grid_v, | ||
float | r_tangent_D[3] | ||
) |
Definition at line 101 of file subdiv_displacement_multires.c.
References AVERAGE_WITH_ALL, AVERAGE_WITH_NEXT, AVERAGE_WITH_NONE, AVERAGE_WITH_PREV, copy_v3_v3(), MDisps::disps, NULL, x, y, and zero_v3().
Referenced by average_read_displacement_tangent(), and eval_displacement().