OpenSubdiv: Re-work C-API integration
Main goal is to make API simpler to follow (at least ion terms what
is defined/declared where, as opposite of handful big headers which
includes all the declarations), and also avoid a big set of long and
obscure functions.
Now C-API files are split into smaller ones, following OpenSubdiv
behavior more closely, and also function pointers in structures
used a lot more, which shortens functions names,
UV integration part in GL Mesh is mainly stripped away, it needs
to be done differently. On a related topic, UV coordinates API in
converter needs to be removed as well, we do not need coordinates,
only island connectivity information there.
Additional changes:
- Varying interpolation in evaluator API are temporarily disabled,
need to extend API somewhere (probably, evaluator's API) to inform
layout information of vertex data (whether it contains varying
data, width, stride and such).
- Evaluator now can interpolate face-varying data.
Only works for adaptive refiner, since some issues in OpenSubdiv
itself.
Planned changes:
- Remove uv coordinates from TopologyConverter.
- Support evaluation of patches (as opposite to individual coordinates
as it happens currently).
- Support more flexible layout of varying and face-varying data.
It is stupid to assume varying is 3 floats and face-varying 2 floats.
- Support of second order derivatives.
- Everything else what i'm missing in this list.
2018-07-16 07:28:05 +00:00
|
|
|
// Copyright 2018 Blender Foundation. All rights reserved.
|
|
|
|
//
|
|
|
|
// This program is free software; you can redistribute it and/or
|
|
|
|
// modify it under the terms of the GNU General Public License
|
|
|
|
// as published by the Free Software Foundation; either version 2
|
|
|
|
// of the License, or (at your option) any later version.
|
|
|
|
//
|
|
|
|
// This program is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
// GNU General Public License for more details.
|
|
|
|
//
|
|
|
|
// You should have received a copy of the GNU General Public License
|
|
|
|
// along with this program; if not, write to the Free Software Foundation,
|
|
|
|
// Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
//
|
|
|
|
// Author: Sergey Sharybin
|
|
|
|
|
|
|
|
#ifndef OPENSUBDIV_TOPOLOGY_REFINER_CAPI_H_
|
|
|
|
#define OPENSUBDIV_TOPOLOGY_REFINER_CAPI_H_
|
|
|
|
|
|
|
|
#include <stdint.h> // for bool
|
|
|
|
|
2018-07-17 16:06:32 +00:00
|
|
|
#include "opensubdiv_capi_type.h"
|
|
|
|
|
OpenSubdiv: Re-work C-API integration
Main goal is to make API simpler to follow (at least ion terms what
is defined/declared where, as opposite of handful big headers which
includes all the declarations), and also avoid a big set of long and
obscure functions.
Now C-API files are split into smaller ones, following OpenSubdiv
behavior more closely, and also function pointers in structures
used a lot more, which shortens functions names,
UV integration part in GL Mesh is mainly stripped away, it needs
to be done differently. On a related topic, UV coordinates API in
converter needs to be removed as well, we do not need coordinates,
only island connectivity information there.
Additional changes:
- Varying interpolation in evaluator API are temporarily disabled,
need to extend API somewhere (probably, evaluator's API) to inform
layout information of vertex data (whether it contains varying
data, width, stride and such).
- Evaluator now can interpolate face-varying data.
Only works for adaptive refiner, since some issues in OpenSubdiv
itself.
Planned changes:
- Remove uv coordinates from TopologyConverter.
- Support evaluation of patches (as opposite to individual coordinates
as it happens currently).
- Support more flexible layout of varying and face-varying data.
It is stupid to assume varying is 3 floats and face-varying 2 floats.
- Support of second order derivatives.
- Everything else what i'm missing in this list.
2018-07-16 07:28:05 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
struct OpenSubdiv_Converter;
|
2020-05-18 16:47:38 +00:00
|
|
|
struct OpenSubdiv_TopologyRefinerImpl;
|
OpenSubdiv: Re-work C-API integration
Main goal is to make API simpler to follow (at least ion terms what
is defined/declared where, as opposite of handful big headers which
includes all the declarations), and also avoid a big set of long and
obscure functions.
Now C-API files are split into smaller ones, following OpenSubdiv
behavior more closely, and also function pointers in structures
used a lot more, which shortens functions names,
UV integration part in GL Mesh is mainly stripped away, it needs
to be done differently. On a related topic, UV coordinates API in
converter needs to be removed as well, we do not need coordinates,
only island connectivity information there.
Additional changes:
- Varying interpolation in evaluator API are temporarily disabled,
need to extend API somewhere (probably, evaluator's API) to inform
layout information of vertex data (whether it contains varying
data, width, stride and such).
- Evaluator now can interpolate face-varying data.
Only works for adaptive refiner, since some issues in OpenSubdiv
itself.
Planned changes:
- Remove uv coordinates from TopologyConverter.
- Support evaluation of patches (as opposite to individual coordinates
as it happens currently).
- Support more flexible layout of varying and face-varying data.
It is stupid to assume varying is 3 floats and face-varying 2 floats.
- Support of second order derivatives.
- Everything else what i'm missing in this list.
2018-07-16 07:28:05 +00:00
|
|
|
|
|
|
|
// Those settings don't really belong to OpenSubdiv's topology refiner, but
|
|
|
|
// we are keeping track of them on our side of topology refiner. This is to
|
|
|
|
// make it possible to ensure we are not trying to abuse same OpenSubdiv's
|
|
|
|
// topology refiner with different subdivision levels or with different
|
|
|
|
// adaptive settings.
|
|
|
|
typedef struct OpenSubdiv_TopologyRefinerSettings {
|
|
|
|
bool is_adaptive;
|
|
|
|
int level;
|
|
|
|
} OpenSubdiv_TopologyRefinerSettings;
|
|
|
|
|
2020-05-18 16:47:38 +00:00
|
|
|
// C-style wrapper around actual topology refiner.
|
|
|
|
//
|
|
|
|
// The only purpose is to allow C-only code to access C++ implementation of the
|
|
|
|
// topology refiner.
|
OpenSubdiv: Re-work C-API integration
Main goal is to make API simpler to follow (at least ion terms what
is defined/declared where, as opposite of handful big headers which
includes all the declarations), and also avoid a big set of long and
obscure functions.
Now C-API files are split into smaller ones, following OpenSubdiv
behavior more closely, and also function pointers in structures
used a lot more, which shortens functions names,
UV integration part in GL Mesh is mainly stripped away, it needs
to be done differently. On a related topic, UV coordinates API in
converter needs to be removed as well, we do not need coordinates,
only island connectivity information there.
Additional changes:
- Varying interpolation in evaluator API are temporarily disabled,
need to extend API somewhere (probably, evaluator's API) to inform
layout information of vertex data (whether it contains varying
data, width, stride and such).
- Evaluator now can interpolate face-varying data.
Only works for adaptive refiner, since some issues in OpenSubdiv
itself.
Planned changes:
- Remove uv coordinates from TopologyConverter.
- Support evaluation of patches (as opposite to individual coordinates
as it happens currently).
- Support more flexible layout of varying and face-varying data.
It is stupid to assume varying is 3 floats and face-varying 2 floats.
- Support of second order derivatives.
- Everything else what i'm missing in this list.
2018-07-16 07:28:05 +00:00
|
|
|
typedef struct OpenSubdiv_TopologyRefiner {
|
|
|
|
// Query subdivision level the refiner is created for.
|
2019-04-17 04:17:24 +00:00
|
|
|
int (*getSubdivisionLevel)(const struct OpenSubdiv_TopologyRefiner *topology_refiner);
|
|
|
|
bool (*getIsAdaptive)(const struct OpenSubdiv_TopologyRefiner *topology_refiner);
|
OpenSubdiv: Re-work C-API integration
Main goal is to make API simpler to follow (at least ion terms what
is defined/declared where, as opposite of handful big headers which
includes all the declarations), and also avoid a big set of long and
obscure functions.
Now C-API files are split into smaller ones, following OpenSubdiv
behavior more closely, and also function pointers in structures
used a lot more, which shortens functions names,
UV integration part in GL Mesh is mainly stripped away, it needs
to be done differently. On a related topic, UV coordinates API in
converter needs to be removed as well, we do not need coordinates,
only island connectivity information there.
Additional changes:
- Varying interpolation in evaluator API are temporarily disabled,
need to extend API somewhere (probably, evaluator's API) to inform
layout information of vertex data (whether it contains varying
data, width, stride and such).
- Evaluator now can interpolate face-varying data.
Only works for adaptive refiner, since some issues in OpenSubdiv
itself.
Planned changes:
- Remove uv coordinates from TopologyConverter.
- Support evaluation of patches (as opposite to individual coordinates
as it happens currently).
- Support more flexible layout of varying and face-varying data.
It is stupid to assume varying is 3 floats and face-varying 2 floats.
- Support of second order derivatives.
- Everything else what i'm missing in this list.
2018-07-16 07:28:05 +00:00
|
|
|
|
2018-07-17 16:06:32 +00:00
|
|
|
// NOTE: All queries are querying base level.
|
|
|
|
//
|
|
|
|
// TODO(sergey): Consider making it more obvious in function naming,
|
|
|
|
// but since it's unlikely (or at least, will be uncommon use) for API
|
|
|
|
// which queries final geometry, we should be fine with this name for
|
|
|
|
// now.
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
OpenSubdiv: Re-work C-API integration
Main goal is to make API simpler to follow (at least ion terms what
is defined/declared where, as opposite of handful big headers which
includes all the declarations), and also avoid a big set of long and
obscure functions.
Now C-API files are split into smaller ones, following OpenSubdiv
behavior more closely, and also function pointers in structures
used a lot more, which shortens functions names,
UV integration part in GL Mesh is mainly stripped away, it needs
to be done differently. On a related topic, UV coordinates API in
converter needs to be removed as well, we do not need coordinates,
only island connectivity information there.
Additional changes:
- Varying interpolation in evaluator API are temporarily disabled,
need to extend API somewhere (probably, evaluator's API) to inform
layout information of vertex data (whether it contains varying
data, width, stride and such).
- Evaluator now can interpolate face-varying data.
Only works for adaptive refiner, since some issues in OpenSubdiv
itself.
Planned changes:
- Remove uv coordinates from TopologyConverter.
- Support evaluation of patches (as opposite to individual coordinates
as it happens currently).
- Support more flexible layout of varying and face-varying data.
It is stupid to assume varying is 3 floats and face-varying 2 floats.
- Support of second order derivatives.
- Everything else what i'm missing in this list.
2018-07-16 07:28:05 +00:00
|
|
|
// Query basic topology information from base level.
|
2018-07-17 16:06:32 +00:00
|
|
|
|
2019-04-17 04:17:24 +00:00
|
|
|
int (*getNumVertices)(const struct OpenSubdiv_TopologyRefiner *topology_refiner);
|
|
|
|
int (*getNumEdges)(const struct OpenSubdiv_TopologyRefiner *topology_refiner);
|
|
|
|
int (*getNumFaces)(const struct OpenSubdiv_TopologyRefiner *topology_refiner);
|
2019-10-02 10:37:44 +00:00
|
|
|
|
2019-04-17 04:17:24 +00:00
|
|
|
int (*getNumFaceVertices)(const struct OpenSubdiv_TopologyRefiner *topology_refiner,
|
|
|
|
const int face_index);
|
|
|
|
void (*getFaceVertices)(const struct OpenSubdiv_TopologyRefiner *topology_refiner,
|
|
|
|
const int face_index,
|
|
|
|
int *face_vertices_indices);
|
2019-10-02 10:37:44 +00:00
|
|
|
|
2019-04-17 04:17:24 +00:00
|
|
|
int (*getNumFaceEdges)(const struct OpenSubdiv_TopologyRefiner *topology_refiner,
|
|
|
|
const int face_index);
|
|
|
|
void (*getFaceEdges)(const struct OpenSubdiv_TopologyRefiner *topology_refiner,
|
|
|
|
const int face_index,
|
|
|
|
int *face_edges_indices);
|
|
|
|
void (*getEdgeVertices)(const struct OpenSubdiv_TopologyRefiner *topology_refiner,
|
|
|
|
const int edge_index,
|
|
|
|
int edge_vertices_indices[2]);
|
OpenSubdiv: Re-work C-API integration
Main goal is to make API simpler to follow (at least ion terms what
is defined/declared where, as opposite of handful big headers which
includes all the declarations), and also avoid a big set of long and
obscure functions.
Now C-API files are split into smaller ones, following OpenSubdiv
behavior more closely, and also function pointers in structures
used a lot more, which shortens functions names,
UV integration part in GL Mesh is mainly stripped away, it needs
to be done differently. On a related topic, UV coordinates API in
converter needs to be removed as well, we do not need coordinates,
only island connectivity information there.
Additional changes:
- Varying interpolation in evaluator API are temporarily disabled,
need to extend API somewhere (probably, evaluator's API) to inform
layout information of vertex data (whether it contains varying
data, width, stride and such).
- Evaluator now can interpolate face-varying data.
Only works for adaptive refiner, since some issues in OpenSubdiv
itself.
Planned changes:
- Remove uv coordinates from TopologyConverter.
- Support evaluation of patches (as opposite to individual coordinates
as it happens currently).
- Support more flexible layout of varying and face-varying data.
It is stupid to assume varying is 3 floats and face-varying 2 floats.
- Support of second order derivatives.
- Everything else what i'm missing in this list.
2018-07-16 07:28:05 +00:00
|
|
|
|
2019-10-02 10:37:44 +00:00
|
|
|
int (*getNumVertexEdges)(const struct OpenSubdiv_TopologyRefiner *topology_refiner,
|
|
|
|
const int vertex_index);
|
|
|
|
void (*getVertexEdges)(const struct OpenSubdiv_TopologyRefiner *topology_refiner,
|
|
|
|
const int vertex_index,
|
|
|
|
int *vertex_edges_indices);
|
|
|
|
|
2018-07-17 16:06:32 +00:00
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
// PTex face geometry queries.
|
|
|
|
|
OpenSubdiv: Re-work C-API integration
Main goal is to make API simpler to follow (at least ion terms what
is defined/declared where, as opposite of handful big headers which
includes all the declarations), and also avoid a big set of long and
obscure functions.
Now C-API files are split into smaller ones, following OpenSubdiv
behavior more closely, and also function pointers in structures
used a lot more, which shortens functions names,
UV integration part in GL Mesh is mainly stripped away, it needs
to be done differently. On a related topic, UV coordinates API in
converter needs to be removed as well, we do not need coordinates,
only island connectivity information there.
Additional changes:
- Varying interpolation in evaluator API are temporarily disabled,
need to extend API somewhere (probably, evaluator's API) to inform
layout information of vertex data (whether it contains varying
data, width, stride and such).
- Evaluator now can interpolate face-varying data.
Only works for adaptive refiner, since some issues in OpenSubdiv
itself.
Planned changes:
- Remove uv coordinates from TopologyConverter.
- Support evaluation of patches (as opposite to individual coordinates
as it happens currently).
- Support more flexible layout of varying and face-varying data.
It is stupid to assume varying is 3 floats and face-varying 2 floats.
- Support of second order derivatives.
- Everything else what i'm missing in this list.
2018-07-16 07:28:05 +00:00
|
|
|
// Ptex face corresponds to OpenSubdiv's internal "patch" and to Blender's
|
|
|
|
// subdivision grid. The rule commes as:
|
|
|
|
// - Triangle face consist of 3 ptex faces, ordered in the order of
|
|
|
|
// face-vertices.
|
|
|
|
// - Quad face consists of a single ptex face.
|
|
|
|
// - N-gons (similar to triangle) consists of N ptex faces, ordered same
|
|
|
|
// way as for triangle.
|
2019-04-17 04:17:24 +00:00
|
|
|
int (*getNumFacePtexFaces)(const struct OpenSubdiv_TopologyRefiner *topology_refiner,
|
|
|
|
const int face_index);
|
|
|
|
int (*getNumPtexFaces)(const struct OpenSubdiv_TopologyRefiner *topology_refiner);
|
OpenSubdiv: Re-work C-API integration
Main goal is to make API simpler to follow (at least ion terms what
is defined/declared where, as opposite of handful big headers which
includes all the declarations), and also avoid a big set of long and
obscure functions.
Now C-API files are split into smaller ones, following OpenSubdiv
behavior more closely, and also function pointers in structures
used a lot more, which shortens functions names,
UV integration part in GL Mesh is mainly stripped away, it needs
to be done differently. On a related topic, UV coordinates API in
converter needs to be removed as well, we do not need coordinates,
only island connectivity information there.
Additional changes:
- Varying interpolation in evaluator API are temporarily disabled,
need to extend API somewhere (probably, evaluator's API) to inform
layout information of vertex data (whether it contains varying
data, width, stride and such).
- Evaluator now can interpolate face-varying data.
Only works for adaptive refiner, since some issues in OpenSubdiv
itself.
Planned changes:
- Remove uv coordinates from TopologyConverter.
- Support evaluation of patches (as opposite to individual coordinates
as it happens currently).
- Support more flexible layout of varying and face-varying data.
It is stupid to assume varying is 3 floats and face-varying 2 floats.
- Support of second order derivatives.
- Everything else what i'm missing in this list.
2018-07-16 07:28:05 +00:00
|
|
|
|
|
|
|
// Initialize a per-base-face offset measured in ptex face indices.
|
|
|
|
//
|
|
|
|
// Basically, face_ptex_offset[base_face_index] is a total number of ptex
|
|
|
|
// faces created for bases faces [0 .. base_face_index - 1].
|
|
|
|
//
|
|
|
|
// The array must contain at least total number of ptex faces elements.
|
2019-04-17 04:17:24 +00:00
|
|
|
void (*fillFacePtexIndexOffset)(const struct OpenSubdiv_TopologyRefiner *topology_refiner,
|
|
|
|
int *face_ptex_index_offset);
|
OpenSubdiv: Re-work C-API integration
Main goal is to make API simpler to follow (at least ion terms what
is defined/declared where, as opposite of handful big headers which
includes all the declarations), and also avoid a big set of long and
obscure functions.
Now C-API files are split into smaller ones, following OpenSubdiv
behavior more closely, and also function pointers in structures
used a lot more, which shortens functions names,
UV integration part in GL Mesh is mainly stripped away, it needs
to be done differently. On a related topic, UV coordinates API in
converter needs to be removed as well, we do not need coordinates,
only island connectivity information there.
Additional changes:
- Varying interpolation in evaluator API are temporarily disabled,
need to extend API somewhere (probably, evaluator's API) to inform
layout information of vertex data (whether it contains varying
data, width, stride and such).
- Evaluator now can interpolate face-varying data.
Only works for adaptive refiner, since some issues in OpenSubdiv
itself.
Planned changes:
- Remove uv coordinates from TopologyConverter.
- Support evaluation of patches (as opposite to individual coordinates
as it happens currently).
- Support more flexible layout of varying and face-varying data.
It is stupid to assume varying is 3 floats and face-varying 2 floats.
- Support of second order derivatives.
- Everything else what i'm missing in this list.
2018-07-16 07:28:05 +00:00
|
|
|
|
2018-07-17 16:06:32 +00:00
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Face-varying data.
|
|
|
|
|
|
|
|
// Number of face-varying channels (or how they are called in Blender layers).
|
2019-04-17 04:17:24 +00:00
|
|
|
int (*getNumFVarChannels)(const struct OpenSubdiv_TopologyRefiner *topology_refiner);
|
2018-07-17 16:06:32 +00:00
|
|
|
// Get face-varying interpolation type.
|
|
|
|
OpenSubdiv_FVarLinearInterpolation (*getFVarLinearInterpolation)(
|
2019-04-17 04:17:24 +00:00
|
|
|
const struct OpenSubdiv_TopologyRefiner *topology_refiner);
|
2018-07-17 16:06:32 +00:00
|
|
|
// Get total number of face-varying values in a particular channel.
|
2019-04-17 04:17:24 +00:00
|
|
|
int (*getNumFVarValues)(const struct OpenSubdiv_TopologyRefiner *topology_refiner,
|
|
|
|
const int channel);
|
2018-07-17 16:06:32 +00:00
|
|
|
// Get face-varying value indices associated with a particular face.
|
|
|
|
//
|
|
|
|
// This is an array of indices inside of face-varying array, array elements
|
|
|
|
// are aligned with face corners (or loops in Blender terminology).
|
2019-04-17 04:17:24 +00:00
|
|
|
const int *(*getFaceFVarValueIndices)(const struct OpenSubdiv_TopologyRefiner *topology_refiner,
|
|
|
|
const int face_index,
|
|
|
|
const int channel);
|
2018-07-17 16:06:32 +00:00
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Internal use.
|
|
|
|
|
2020-05-18 16:47:38 +00:00
|
|
|
// Implementation of the topology refiner.
|
|
|
|
struct OpenSubdiv_TopologyRefinerImpl *impl;
|
OpenSubdiv: Re-work C-API integration
Main goal is to make API simpler to follow (at least ion terms what
is defined/declared where, as opposite of handful big headers which
includes all the declarations), and also avoid a big set of long and
obscure functions.
Now C-API files are split into smaller ones, following OpenSubdiv
behavior more closely, and also function pointers in structures
used a lot more, which shortens functions names,
UV integration part in GL Mesh is mainly stripped away, it needs
to be done differently. On a related topic, UV coordinates API in
converter needs to be removed as well, we do not need coordinates,
only island connectivity information there.
Additional changes:
- Varying interpolation in evaluator API are temporarily disabled,
need to extend API somewhere (probably, evaluator's API) to inform
layout information of vertex data (whether it contains varying
data, width, stride and such).
- Evaluator now can interpolate face-varying data.
Only works for adaptive refiner, since some issues in OpenSubdiv
itself.
Planned changes:
- Remove uv coordinates from TopologyConverter.
- Support evaluation of patches (as opposite to individual coordinates
as it happens currently).
- Support more flexible layout of varying and face-varying data.
It is stupid to assume varying is 3 floats and face-varying 2 floats.
- Support of second order derivatives.
- Everything else what i'm missing in this list.
2018-07-16 07:28:05 +00:00
|
|
|
} OpenSubdiv_TopologyRefiner;
|
|
|
|
|
2018-07-17 16:06:32 +00:00
|
|
|
// NOTE: Will return NULL in cases of bad topology.
|
|
|
|
// NOTE: Mesh without faces is considered a bad topology.
|
2019-04-17 04:17:24 +00:00
|
|
|
OpenSubdiv_TopologyRefiner *openSubdiv_createTopologyRefinerFromConverter(
|
|
|
|
struct OpenSubdiv_Converter *converter, const OpenSubdiv_TopologyRefinerSettings *settings);
|
OpenSubdiv: Re-work C-API integration
Main goal is to make API simpler to follow (at least ion terms what
is defined/declared where, as opposite of handful big headers which
includes all the declarations), and also avoid a big set of long and
obscure functions.
Now C-API files are split into smaller ones, following OpenSubdiv
behavior more closely, and also function pointers in structures
used a lot more, which shortens functions names,
UV integration part in GL Mesh is mainly stripped away, it needs
to be done differently. On a related topic, UV coordinates API in
converter needs to be removed as well, we do not need coordinates,
only island connectivity information there.
Additional changes:
- Varying interpolation in evaluator API are temporarily disabled,
need to extend API somewhere (probably, evaluator's API) to inform
layout information of vertex data (whether it contains varying
data, width, stride and such).
- Evaluator now can interpolate face-varying data.
Only works for adaptive refiner, since some issues in OpenSubdiv
itself.
Planned changes:
- Remove uv coordinates from TopologyConverter.
- Support evaluation of patches (as opposite to individual coordinates
as it happens currently).
- Support more flexible layout of varying and face-varying data.
It is stupid to assume varying is 3 floats and face-varying 2 floats.
- Support of second order derivatives.
- Everything else what i'm missing in this list.
2018-07-16 07:28:05 +00:00
|
|
|
|
2019-04-17 04:17:24 +00:00
|
|
|
void openSubdiv_deleteTopologyRefiner(OpenSubdiv_TopologyRefiner *topology_refiner);
|
OpenSubdiv: Re-work C-API integration
Main goal is to make API simpler to follow (at least ion terms what
is defined/declared where, as opposite of handful big headers which
includes all the declarations), and also avoid a big set of long and
obscure functions.
Now C-API files are split into smaller ones, following OpenSubdiv
behavior more closely, and also function pointers in structures
used a lot more, which shortens functions names,
UV integration part in GL Mesh is mainly stripped away, it needs
to be done differently. On a related topic, UV coordinates API in
converter needs to be removed as well, we do not need coordinates,
only island connectivity information there.
Additional changes:
- Varying interpolation in evaluator API are temporarily disabled,
need to extend API somewhere (probably, evaluator's API) to inform
layout information of vertex data (whether it contains varying
data, width, stride and such).
- Evaluator now can interpolate face-varying data.
Only works for adaptive refiner, since some issues in OpenSubdiv
itself.
Planned changes:
- Remove uv coordinates from TopologyConverter.
- Support evaluation of patches (as opposite to individual coordinates
as it happens currently).
- Support more flexible layout of varying and face-varying data.
It is stupid to assume varying is 3 floats and face-varying 2 floats.
- Support of second order derivatives.
- Everything else what i'm missing in this list.
2018-07-16 07:28:05 +00:00
|
|
|
|
|
|
|
// Compare given topology refiner with converter. Returns truth if topology
|
|
|
|
// refiner matches given converter, false otherwise.
|
|
|
|
//
|
|
|
|
// This allows users to construct converter (which is supposed to be cheap)
|
|
|
|
// and compare with existing refiner before going into more computationally
|
|
|
|
// complicated parts of subdivision process.
|
|
|
|
bool openSubdiv_topologyRefinerCompareWithConverter(
|
2019-04-17 04:17:24 +00:00
|
|
|
const OpenSubdiv_TopologyRefiner *topology_refiner,
|
|
|
|
const struct OpenSubdiv_Converter *converter);
|
OpenSubdiv: Re-work C-API integration
Main goal is to make API simpler to follow (at least ion terms what
is defined/declared where, as opposite of handful big headers which
includes all the declarations), and also avoid a big set of long and
obscure functions.
Now C-API files are split into smaller ones, following OpenSubdiv
behavior more closely, and also function pointers in structures
used a lot more, which shortens functions names,
UV integration part in GL Mesh is mainly stripped away, it needs
to be done differently. On a related topic, UV coordinates API in
converter needs to be removed as well, we do not need coordinates,
only island connectivity information there.
Additional changes:
- Varying interpolation in evaluator API are temporarily disabled,
need to extend API somewhere (probably, evaluator's API) to inform
layout information of vertex data (whether it contains varying
data, width, stride and such).
- Evaluator now can interpolate face-varying data.
Only works for adaptive refiner, since some issues in OpenSubdiv
itself.
Planned changes:
- Remove uv coordinates from TopologyConverter.
- Support evaluation of patches (as opposite to individual coordinates
as it happens currently).
- Support more flexible layout of varying and face-varying data.
It is stupid to assume varying is 3 floats and face-varying 2 floats.
- Support of second order derivatives.
- Everything else what i'm missing in this list.
2018-07-16 07:28:05 +00:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif // OPENSUBDIV_TOPOLOGY_REFINER_CAPI_H_
|