OSPRay features supported in vtkOSPRayRenderNode

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., aoSamples, shadowsEnabled, etc. The same applies for pathtracer-specific parameters.
  • Defining OSPRay materials via any method other than writing an appropriate json file and parsing via vtkOSPRayMaterialLibrary::ReadFile.

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:

  • aoSamples: vtkOSPRayRendererNode::SetAmbientSamples
  • shadowsEnabled: vtkRenderer::UseShadowsOn

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 vtkProperty.

1 Like

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:

  1. OSPRay supports a backplate defined as “texture image used as background, replacing visible lights in infinity”. That suggests two things:
  2. It’s definitely a texture and not a color.
  3. 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).