Closed tachyon-john closed 4 years ago
Looks like the actual implementation of the OBJ material indeed differs between scivis and pathtracer:
And class ScivisMaterial
supports only a small number of parameters as you found:
Supported OBJ parameters in SciVis have been cut down when moving to v2.0, but this should be temporary (albeit quite some time already...).
I knew something was wrong since the images I got from OSPRay 2.x didn't have the correct specular look for a given VMD material, but until I got the error output from the status callback, I wasn't sure why.
For now, I'll just view this as a case where the docs disagree with reality in the code. I leave it up to the OSPRay devs to decide if OBJ will remain as-is or not. I just expected it to do what the docs said it would.
I have been planning to separately support both sci-vis and pathtracer modes for OSPRay, but the OBJ material limitations are problematic for VMD, so this will lead me to ahead and reimplement using pathtracer and revisit a sci-vis implementation after OBJ has been made more comparable to what OSPRay 1.x used to support.
So, with the re-added lighting in SciVis starting with v2.3 the OBJ material parameters ks
and ns
work again.
Although the documentation indicates that the OBJ material works with both the SciVis and pathtracer OSPRay renderers, I find that when using the scivis renderer, I get parameter errors for "ks" and "ns", e.g.: OSPMaterial ospMat = ospNewMaterial("scivis", "obj"); ospSetParam(ospMat, "kd", OSP_VEC3F, kdtmp); // works as expected.... ospSetParam(ospMat, "ks", OSP_VEC3F, kstmp); // generates error ospSetParam(ospMat, "d", OSP_FLOAT, &materialcache[matindex].opacity); // works as expected... ospSetParam(ospMat, "ns", OSP_FLOAT, &materialcache[matindex].shininess); // generates error
The error/status messages generated are: ospray::Material: found unused (or of wrong data type) parameter 'ks' ospray::Material: found unused (or of wrong data type) parameter 'ns'
Nothing I see in the documentation for the OBJ material would indicate that these should not work with the scivis renderer: https://www.ospray.org/documentation.html#materials