I’m having difficulty reasoning about documented OSPRay functionality and how to access it via VTK. Is there some definitive document somewhere that articulates that mapping that I’ve missed? Or is there some philosophical assumption I haven’t internalized (I admit to be a naive VTK user at best). For example, tasks that I’ve been unable to do/figure out:
- After setting the render node to be “raytracer”, I’m unsure how to set the renderer-specific parameters: e.g.,
shadowsEnabled, etc. The same applies for
- Defining OSPRay materials via any method other than writing an appropriate json file and parsing via
I’ll probably find more as I go. Thanks in advance.
Agreed, the documentation regarding OSPRay could be improved.
Regarding the parameters you are looking for:
It is possible to create materials of type
OBJMaterial (available in 8.2) or
Principled (on master only) directly without the JSON file.
The type of material is set using
vtkProperty::SetInterpolation (Phong for OBJMaterial, PBR for Principled).
All materials parameters are set using the same class
I appreciate the pointers. The take away lesson here is to recognize that any parameter that naturally overlaps the basic interface is going to be serviced there.
And the guidance for creating materials on the fly was particularly helpful.
One last question: if I set the background color in an OpenGL2 renderer, it is the clear color for the color buffer and any pixel not covered by geometry is rendered that color. However, in the OSPRay render, such is not the case (for either “scivis” or “pathtracer”). However, the background color does contribute to the overall lighting (for “pathtracer”). Is the only way to change the “empty pixel” color from black to some alternate to provide a background texture?
Correction on background colors:
- for “scivis” renderer, I find as long as I set the background alpha to 1, the set color does render in the empty pixels.
- that does not appear to affect the pathtracer (although, again, it contributes a fair amount of energy into the lighting).
Are you using remote rendering?
I don’t know. “Remote rendering” suggests distributed to me – or possibly in a situation in which I don’t have a proper GL context? Could you elaborate?
As I’ve done further research I’ve found:
- OSPRay supports a backplate defined as “texture image used as background, replacing visible lights in infinity”. That suggests two things:
- It’s definitely a texture and not a color.
- It must contribute to illumination. That in itself is a bit disappointing…particularly as I can’t twiddle its intensity.
Your question implies that I should be getting a background color (as if it were a backplate texture). It contributes to the lighting as such, but isn’t rendering.
That said, I also found this discussion.
Forget “Remote rendering”, this is a feature we use in ParaView but it is not related to VTK.
Yes, at the moment you cannot add a background that do not contribute to illumination. That should change though.
Thanks for the feedback.
Thanks for the answers. I’ve found my own work around for a simple background color (the magic of compositing).