Changeset View
Changeset View
Standalone View
Standalone View
intern/opensubdiv/opensubdiv_evaluator_capi.h
| Show First 20 Lines • Show All 63 Lines • ▼ Show 20 Lines | |||||
| } OpenSubdiv_Buffer; | } OpenSubdiv_Buffer; | ||||
| typedef struct OpenSubdiv_Evaluator { | typedef struct OpenSubdiv_Evaluator { | ||||
| // Set coarse positions from a continuous array of coordinates. | // Set coarse positions from a continuous array of coordinates. | ||||
| void (*setCoarsePositions)(struct OpenSubdiv_Evaluator *evaluator, | void (*setCoarsePositions)(struct OpenSubdiv_Evaluator *evaluator, | ||||
| const float *positions, | const float *positions, | ||||
| const int start_vertex_index, | const int start_vertex_index, | ||||
| const int num_vertices); | const int num_vertices); | ||||
| // Set extra vertex data from a continuous array of coordinates. | |||||
| void (*setVertexData)(struct OpenSubdiv_Evaluator *evaluator, | |||||
| const float *extra_data, | |||||
| const int start_vertex_index, | |||||
| const int num_vertices); | |||||
| // Set varying data from a continuous array of data. | // Set varying data from a continuous array of data. | ||||
| void (*setVaryingData)(struct OpenSubdiv_Evaluator *evaluator, | void (*setVaryingData)(struct OpenSubdiv_Evaluator *evaluator, | ||||
| const float *varying_data, | const float *varying_data, | ||||
| const int start_vertex_index, | const int start_vertex_index, | ||||
| const int num_vertices); | const int num_vertices); | ||||
| // Set face varying data from a continuous array of data. | // Set face varying data from a continuous array of data. | ||||
| // | // | ||||
| // TODO(sergey): Find a better name for vertex here. It is not the vertex of | // TODO(sergey): Find a better name for vertex here. It is not the vertex of | ||||
| ▲ Show 20 Lines • Show All 44 Lines • ▼ Show 20 Lines | typedef struct OpenSubdiv_Evaluator { | ||||
| void (*evaluateLimit)(struct OpenSubdiv_Evaluator *evaluator, | void (*evaluateLimit)(struct OpenSubdiv_Evaluator *evaluator, | ||||
| const int ptex_face_index, | const int ptex_face_index, | ||||
| float face_u, | float face_u, | ||||
| float face_v, | float face_v, | ||||
| float P[3], | float P[3], | ||||
| float dPdu[3], | float dPdu[3], | ||||
| float dPdv[3]); | float dPdv[3]); | ||||
| // Evaluate vertex data at a given bilinear coordinate of given ptex face. | |||||
| void (*evaluateVertexData)(struct OpenSubdiv_Evaluator *evaluator, | |||||
| const int ptex_face_index, | |||||
| float face_u, | |||||
| float face_v, | |||||
| float extra_data[]); | |||||
| // Evaluate varying data at a given bilinear coordinate of given ptex face. | // Evaluate varying data at a given bilinear coordinate of given ptex face. | ||||
| void (*evaluateVarying)(struct OpenSubdiv_Evaluator *evaluator, | void (*evaluateVarying)(struct OpenSubdiv_Evaluator *evaluator, | ||||
| const int ptex_face_index, | const int ptex_face_index, | ||||
| float face_u, | float face_u, | ||||
| float face_v, | float face_v, | ||||
| float varying[3]); | float varying[3]); | ||||
| // Evaluate face-varying data at a given bilinear coordinate of given | // Evaluate face-varying data at a given bilinear coordinate of given | ||||
| ▲ Show 20 Lines • Show All 70 Lines • ▼ Show 20 Lines | typedef struct OpenSubdiv_Evaluator { | ||||
| eOpenSubdivEvaluator type; | eOpenSubdivEvaluator type; | ||||
| } OpenSubdiv_Evaluator; | } OpenSubdiv_Evaluator; | ||||
| typedef struct OpenSubdiv_EvaluatorCache { | typedef struct OpenSubdiv_EvaluatorCache { | ||||
| // Implementation of the evaluator cache. | // Implementation of the evaluator cache. | ||||
| struct OpenSubdiv_EvaluatorCacheImpl *impl; | struct OpenSubdiv_EvaluatorCacheImpl *impl; | ||||
| } OpenSubdiv_EvaluatorCache; | } OpenSubdiv_EvaluatorCache; | ||||
| typedef struct OpenSubdiv_EvaluatorSettings { | |||||
| // Number of smoothly interpolated vertex data channels. | |||||
| int num_vertex_data; | |||||
| } OpenSubdiv_EvaluatorSettings; | |||||
| OpenSubdiv_Evaluator *openSubdiv_createEvaluatorFromTopologyRefiner( | OpenSubdiv_Evaluator *openSubdiv_createEvaluatorFromTopologyRefiner( | ||||
| struct OpenSubdiv_TopologyRefiner *topology_refiner, | struct OpenSubdiv_TopologyRefiner *topology_refiner, | ||||
| eOpenSubdivEvaluator evaluator_type, | eOpenSubdivEvaluator evaluator_type, | ||||
| OpenSubdiv_EvaluatorCache *evaluator_cache); | OpenSubdiv_EvaluatorCache *evaluator_cache, | ||||
| const OpenSubdiv_EvaluatorSettings *settings); | |||||
| void openSubdiv_deleteEvaluator(OpenSubdiv_Evaluator *evaluator); | void openSubdiv_deleteEvaluator(OpenSubdiv_Evaluator *evaluator); | ||||
| OpenSubdiv_EvaluatorCache *openSubdiv_createEvaluatorCache(eOpenSubdivEvaluator evaluator_type); | OpenSubdiv_EvaluatorCache *openSubdiv_createEvaluatorCache(eOpenSubdivEvaluator evaluator_type); | ||||
| void openSubdiv_deleteEvaluatorCache(OpenSubdiv_EvaluatorCache *evaluator_cache); | void openSubdiv_deleteEvaluatorCache(OpenSubdiv_EvaluatorCache *evaluator_cache); | ||||
| // Return the GLSL source code from the OpenSubDiv library used for patch evaluation. | // Return the GLSL source code from the OpenSubDiv library used for patch evaluation. | ||||
| // This function is not thread-safe. | // This function is not thread-safe. | ||||
| const char *openSubdiv_getGLSLPatchBasisSource(void); | const char *openSubdiv_getGLSLPatchBasisSource(void); | ||||
| #ifdef __cplusplus | #ifdef __cplusplus | ||||
| } | } | ||||
| #endif | #endif | ||||
| #endif // OPENSUBDIV_EVALUATOR_CAPI_H_ | #endif // OPENSUBDIV_EVALUATOR_CAPI_H_ | ||||