66 const float (*coarse_vertex_cos)[3])
76 for (
int poly_index = 0; poly_index <
mesh->
totpoly; poly_index++) {
77 const MPoly *poly = &mpoly[poly_index];
83 for (
int vertex_index = 0, manifold_vertex_index = 0; vertex_index <
mesh->
totvert;
88 const float *vertex_co;
89 if (coarse_vertex_cos !=
NULL) {
90 vertex_co = coarse_vertex_cos[vertex_index];
93 const MVert *vertex = &mvert[vertex_index];
94 vertex_co = vertex->
co;
97 manifold_vertex_index++;
104 const int layer_index)
108 const int num_faces = topology_refiner->
getNumFaces(topology_refiner);
113 for (
int face_index = 0; face_index < num_faces; face_index++) {
117 topology_refiner, face_index, layer_index);
118 for (
int vertex_index = 0; vertex_index < num_face_vertices; vertex_index++, mluv++) {
126 const float (*coarse_vertex_cos)[3])
136 const float (*coarse_vertex_cos)[3])
147 for (
int layer_index = 0; layer_index < num_uv_layers; layer_index++) {
172 Subdiv *subdiv,
const int ptex_face_index,
const float u,
const float v,
float r_P[3])
178 const int ptex_face_index,
198 if (r_dPdu !=
NULL && r_dPdv !=
NULL) {
202 u * 0.999f + 0.0005f,
203 v * 0.999f + 0.0005f,
212 const int ptex_face_index,
218 float dPdu[3], dPdv[3];
225 const int ptex_face_index,
237 const int face_varying_channel,
238 const int ptex_face_index,
241 float r_face_varying[2])
244 subdiv->
evaluator, face_varying_channel, ptex_face_index, u,
v, r_face_varying);
248 const int ptex_face_index,
264 Subdiv *subdiv,
const int ptex_face_index,
const float u,
const float v,
float r_P[3])
267 float dPdu[3], dPdv[3],
D[3];
288 memcpy(*
buffer, values_buffer,
sizeof(
float) * num_values);
294 memcpy(*
buffer, values_buffer,
sizeof(
short) * num_values);
298 const int ptex_face_index,
299 const int resolution,
305 const float inv_resolution_1 = 1.0f / (
float)(resolution - 1);
306 for (
int y = 0;
y < resolution;
y++) {
307 const float v =
y * inv_resolution_1;
308 for (
int x = 0;
x < resolution;
x++) {
309 const float u =
x * inv_resolution_1;
317 const int ptex_face_index,
318 const int resolution,
320 const int point_offset,
321 const int point_stride,
332 const float inv_resolution_1 = 1.0f / (
float)(resolution - 1);
333 for (
int y = 0;
y < resolution;
y++) {
334 const float v =
y * inv_resolution_1;
335 for (
int x = 0;
x < resolution;
x++) {
336 const float u =
x * inv_resolution_1;
338 subdiv, ptex_face_index, u,
v, point_buffer, du_buffer, dv_buffer);
347 const int ptex_face_index,
348 const int resolution,
350 const int point_offset,
351 const int point_stride,
353 const int normal_offset,
354 const int normal_stride)
358 const float inv_resolution_1 = 1.0f / (
float)(resolution - 1);
359 for (
int y = 0;
y < resolution;
y++) {
360 const float v =
y * inv_resolution_1;
361 for (
int x = 0;
x < resolution;
x++) {
362 const float u =
x * inv_resolution_1;
373 const int ptex_face_index,
374 const int resolution,
376 const int point_offset,
377 const int point_stride,
379 const int normal_offset,
380 const int normal_stride)
384 const float inv_resolution_1 = 1.0f / (
float)(resolution - 1);
385 for (
int y = 0;
y < resolution;
y++) {
386 const float v =
y * inv_resolution_1;
387 for (
int x = 0;
x < resolution;
x++) {
388 const float u =
x * inv_resolution_1;
391 subdiv, ptex_face_index, u,
v, point_buffer,
normal);
typedef float(TangentPoint)[2]
CustomData interface, see also DNA_customdata_types.h.
int CustomData_number_of_layers(const struct CustomData *data, int type)
void * CustomData_get_layer_n(const struct CustomData *data, int type, int n)
@ SUBDIV_STATS_EVALUATOR_REFINE
@ SUBDIV_STATS_EVALUATOR_CREATE
void BKE_subdiv_stats_end(SubdivStats *stats, eSubdivStatsValue value)
void BKE_subdiv_stats_reset(SubdivStats *stats, eSubdivStatsValue value)
void BKE_subdiv_stats_begin(SubdivStats *stats, eSubdivStatsValue value)
#define BLI_BITMAP_ENABLE(_bitmap, _index)
#define BLI_BITMAP_TEST_BOOL(_bitmap, _index)
#define BLI_BITMAP_NEW(_tot, _alloc_string)
MINLINE void normal_float_to_short_v3(short r[3], const float n[3])
MINLINE float normalize_v3(float r[3])
MINLINE bool is_zero_v3(const float a[3]) ATTR_WARN_UNUSED_RESULT
MINLINE void cross_v3_v3v3(float r[3], const float a[3], const float b[3])
MINLINE bool equals_v3v3(const float a[3], const float b[3]) ATTR_WARN_UNUSED_RESULT
MINLINE void zero_v3(float r[3])
MINLINE void add_v3_v3(float r[3], const float a[3])
_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 stride
Read Guarded memory(de)allocation.
ATTR_WARN_UNUSED_RESULT const BMVert * v
OpenSubdiv_Evaluator * openSubdiv_createEvaluatorFromTopologyRefiner(OpenSubdiv_TopologyRefiner *topology_refiner)
IconTextureDrawCall normal
__kernel void ccl_constant KernelData ccl_global void ccl_global char ccl_global int ccl_global char ccl_global unsigned int ccl_global float * buffer
void(* MEM_freeN)(void *vmemh)
struct CustomData pdata ldata
void(* setCoarsePositions)(struct OpenSubdiv_Evaluator *evaluator, const float *positions, const int start_vertex_index, const int num_vertices)
void(* evaluateLimit)(struct OpenSubdiv_Evaluator *evaluator, const int ptex_face_index, float face_u, float face_v, float P[3], float dPdu[3], float dPdv[3])
void(* setFaceVaryingData)(struct OpenSubdiv_Evaluator *evaluator, const int face_varying_channel, const float *face_varying_data, const int start_vertex_index, const int num_vertices)
void(* evaluateFaceVarying)(struct OpenSubdiv_Evaluator *evaluator, const int face_varying_channel, const int ptex_face_index, float face_u, float face_v, float face_varying[2])
void(* refine)(struct OpenSubdiv_Evaluator *evaluator)
int(* getNumFaceVertices)(const struct OpenSubdiv_TopologyRefiner *topology_refiner, const int face_index)
const int *(* getFaceFVarValueIndices)(const struct OpenSubdiv_TopologyRefiner *topology_refiner, const int face_index, const int channel)
int(* getNumFaces)(const struct OpenSubdiv_TopologyRefiner *topology_refiner)
void(* eval_displacement)(struct 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])
void(* initialize)(struct SubdivDisplacement *displacement)
struct SubdivDisplacement * displacement_evaluator
struct OpenSubdiv_TopologyRefiner * topology_refiner
struct OpenSubdiv_Evaluator * evaluator
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_init_displacement(Subdiv *subdiv)
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_limit_patch_resolution_point(Subdiv *subdiv, const int ptex_face_index, const int resolution, void *buffer, const int offset, const int stride)
bool BKE_subdiv_eval_begin_from_mesh(Subdiv *subdiv, const Mesh *mesh, const float(*coarse_vertex_cos)[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])
bool BKE_subdiv_eval_refine_from_mesh(Subdiv *subdiv, const Mesh *mesh, const float(*coarse_vertex_cos)[3])
void BKE_subdiv_eval_final_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_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_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])
bool BKE_subdiv_eval_begin(Subdiv *subdiv)
static void buffer_write_float_value(void **buffer, const float *values_buffer, int num_values)
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)
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)
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_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)
static void buffer_write_short_value(void **buffer, const short *values_buffer, int num_values)
static void buffer_apply_offset(void **buffer, const int offset)
BLI_INLINE float D(const float *data, const int res[3], int x, int y, int z)