message: added vertex crease weights slider to subdivision tutorial.
diff: @@ -227,6 +227,41 @@ int main(int argc, const char **argv)
  GLFWOSPRayWindow::getActiveWindow()->clearFrameBuffer();
  }
  +
  + static float vertexCreaseWeight = 1.f;
  + if (ImGui::SliderFloat(
  + "vertex crease weights", &vertexCreaseWeight, 0.f, 5.f)) {
  + // vertex crease indices for the cube
  + std::vector<unsigned int> vertexCreaseIndices(8);
  + std::iota(vertexCreaseIndices.begin(), vertexCreaseIndices.end(), 0);
  +
  + OSPData vertexCreaseIndicesData = ospNewData(
  + vertexCreaseIndices.size(), OSP_UINT, vertexCreaseIndices.data());
  +
  + // vertex crease weights; use a constant weight for each vertex
  + std::vector<float> vertexCreaseWeights(8);
  + std::fill(vertexCreaseWeights.begin(),
  + vertexCreaseWeights.end(),
  + vertexCreaseWeight);
  +
  + OSPData vertexCreaseWeightsData = ospNewData(
  + vertexCreaseWeights.size(), OSP_FLOAT, vertexCreaseWeights.data());
  +
  + ospSetData(subdivisionGeometry.geometry,
  + "vertexCrease.index",
  + vertexCreaseIndicesData);
  + ospRelease(vertexCreaseIndicesData);
  +
  + ospSetData(subdivisionGeometry.geometry,
  + "vertexCrease.weight",
  + vertexCreaseWeightsData);
  + ospRelease(vertexCreaseWeightsData);
  +
  + ospCommit(subdivisionGeometry.geometry);
  + ospCommit(world);
  +
  + GLFWOSPRayWindow::getActiveWindow()->clearFrameBuffer();
  + }
  });
  // start the GLFW main loop, which will continuously render
  