Closed paulmelis closed 4 years ago
Both the documentation and code agree on that only ior
is an array, so k
and eta
are vec3f
parameters respectively. You are seeing the "unused parameter" warnings because they were specified as the incorrect type (OSPData
).
Thus all you need is:
material = ospNewMaterial(current_renderer_type.c_str(), "Metal");
ospSetVec3f(material, "eta", 0.07, 0.37, 1.5);
ospSetVec3f(material, "k", 3.7, 2.3, 1.7);
ospSetFloat(material, "roughness", settings.roughness());
ospCommit(material);
Dang, it's easy to make these mistakes. I just submitted a pull request #373 to clearify that "unused" could actually also mean "wrong data type". That probably would have pointed me in the right direction here.
I added both the alloy and metal shaders to my app, the former is working fine, but the latter is not behaving as expected. First, a check: should I read the docs as saying that either the
ior
array needs to be provided, OR,eta
andk
arrays both (looking atpathtracer/materials/Metal.cpp
that seems to be the case)?Secondly, I'm getting status messages
ospray::pathtracer::Metal: found unused parameter 'eta'
(and same fork
). I think I'm committing where needed and set the arrays in the right way. Theroughness
value is coming through.Here's the relevant code: