RenderKit / ospray

An Open, Scalable, Portable, Ray Tracing Based Rendering Engine for High-Fidelity Visualization
http://ospray.org
Apache License 2.0
1k stars 182 forks source link

Commit needed even when using default parameter values? #369

Closed paulmelis closed 4 years ago

paulmelis commented 4 years ago

Meta-remark: if there is a better place to post these questions (which might not be actual issues) please let me know.

Should it be enough to create a material with default parameters using only OSPMaterial mat = ospNewMaterial("pathtracer", "OBJMaterial") or is an ospCommit(mat) also needed in this case? If I leave out the ospCommit I get the segfault from https://github.com/ospray/ospray/issues/364#issuecomment-537429495, even if I set the material on the gmodel in the correct way (with ospSetObjectAsData(model, "material", OSP_MATERIAL, mat))

jeffamstutz commented 4 years ago

All good, keep posting away! :)

Some OSPRay objects are expensive to commit (which won't be valid by default), so for the sake of consistency we always assume that objects need committed to be valid. As you may find, we may accidentally allow some objects to work without being committed, but it is a non-goal of ours to keep those exceptions working (or add to that list). MPI contexts are even more restrictive, where there must be a commit for anything to happen on other nodes.