OpenSubdiv: Properly respect Subdivide UVs option
This commit is contained in:
@@ -567,9 +567,12 @@ struct OpenSubdiv_TopologyRefinerDescr *openSubdiv_createTopologyRefinerDescr(
|
||||
Options options;
|
||||
options.SetVtxBoundaryInterpolation(Options::VTX_BOUNDARY_EDGE_ONLY);
|
||||
options.SetCreasingMethod(Options::CREASE_UNIFORM);
|
||||
/* TODO(sergey): Get proper UV subdivide flag. */
|
||||
// options.SetFVarLinearInterpolation(Options::FVAR_LINEAR_ALL);
|
||||
options.SetFVarLinearInterpolation(Options::FVAR_LINEAR_CORNERS_ONLY);
|
||||
if (converter->get_subdiv_uvs(converter)) {
|
||||
options.SetFVarLinearInterpolation(Options::FVAR_LINEAR_CORNERS_ONLY);
|
||||
}
|
||||
else {
|
||||
options.SetFVarLinearInterpolation(Options::FVAR_LINEAR_ALL);
|
||||
}
|
||||
|
||||
TopologyRefinerFactory<TopologyRefinerData>::Options
|
||||
topology_options(scheme_type, options);
|
||||
@@ -649,6 +652,7 @@ int openSubdiv_topologyRefnerCompareConverter(
|
||||
const OpenSubdiv_TopologyRefinerDescr *topology_refiner,
|
||||
OpenSubdiv_Converter *converter)
|
||||
{
|
||||
typedef OpenSubdiv::Sdc::Options Options;
|
||||
using OpenSubdiv::Far::ConstIndexArray;
|
||||
using OpenSubdiv::Far::TopologyRefiner;
|
||||
using OpenSubdiv::Far::TopologyLevel;
|
||||
@@ -663,6 +667,12 @@ int openSubdiv_topologyRefnerCompareConverter(
|
||||
if (scheme_type != refiner->GetSchemeType()) {
|
||||
return false;
|
||||
}
|
||||
const Options options = refiner->GetSchemeOptions();
|
||||
Options::FVarLinearInterpolation interp = options.GetFVarLinearInterpolation();
|
||||
const bool subdiv_uvs = (interp != Options::FVAR_LINEAR_ALL);
|
||||
if (converter->get_subdiv_uvs(converter) != subdiv_uvs) {
|
||||
return false;
|
||||
}
|
||||
if (converter->get_num_verts(converter) != num_verts ||
|
||||
converter->get_num_edges(converter) != num_edges ||
|
||||
converter->get_num_faces(converter) != num_faces)
|
||||
|
@@ -47,6 +47,8 @@ typedef struct OpenSubdiv_Converter {
|
||||
|
||||
OpenSubdiv_SchemeType (*get_type)(const OpenSubdiv_Converter *converter);
|
||||
|
||||
bool (*get_subdiv_uvs)(const OpenSubdiv_Converter *converter);
|
||||
|
||||
int (*get_num_faces)(const OpenSubdiv_Converter *converter);
|
||||
int (*get_num_edges)(const OpenSubdiv_Converter *converter);
|
||||
int (*get_num_verts)(const OpenSubdiv_Converter *converter);
|
||||
|
Reference in New Issue
Block a user