mirror of
https://github.com/PixarAnimationStudios/OpenSubdiv
synced 2024-11-13 23:50:09 +00:00
Merge pull request #495 from c64kernal/dev_farviewerfix
Fixed crash in farViewer when not using Adaptive.
This commit is contained in:
commit
e42885a4cc
@ -678,7 +678,7 @@ createFarGLMesh(Shape * shape, int maxlevel) {
|
||||
stencilTables = Far::StencilTablesFactory::Create(*refiner, options);
|
||||
|
||||
// append endpatch stencils if needed
|
||||
if (patchTables->GetEndCapVertexStencilTables()) {
|
||||
if (patchTables and patchTables->GetEndCapVertexStencilTables()) {
|
||||
if (Far::StencilTables const * stencilTablesWithEndCap =
|
||||
Far::StencilTablesFactory::AppendEndCapStencilTables(
|
||||
*refiner, stencilTables,
|
||||
@ -745,11 +745,10 @@ createFarGLMesh(Shape * shape, int maxlevel) {
|
||||
options.edgeColorMode=g_Adaptive ? GLMesh::EDGECOLOR_BY_PATCHTYPE : GLMesh::EDGECOLOR_BY_SHARPNESS;
|
||||
options.faceColorMode=g_Adaptive ? GLMesh::FACECOLOR_BY_PATCHTYPE :GLMesh::FACECOLOR_SOLID;
|
||||
|
||||
g_far_glmesh.Initialize(options, *refiner, patchTables, (float *)&verts[0]);
|
||||
if (g_Adaptive) {
|
||||
g_far_glmesh.Initialize(options, *refiner, patchTables, (float *)&verts[0]);
|
||||
g_far_glmesh.SetDiffuseColor(1.0f, 1.0f, 1.0f, 1.0f);
|
||||
} else {
|
||||
g_far_glmesh.Initialize(options, *refiner, patchTables, (float *)&verts[0]);
|
||||
g_far_glmesh.SetDiffuseColor(0.75f, 0.9f, 1.0f, 1.0f);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user