RenderKit / ospray

An Open, Scalable, Portable, Ray Tracing Based Rendering Engine for High-Fidelity Visualization

Home Page:http://ospray.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Custom material support

NadirRoGue opened this issue · comments

Hello,

I am trying to implement custom materials for OSPRay, however, I noticed that SciVis renderer does not use the getBSDF or getTransparency functions of the Material interface, but rather just casts the material to OBJ and then uses its member variables.

This would mean that a custom material would be ignored on this renderer. Is there any approach I might have ignored to implement a custom material, or is there any plans in the future to support this?

For context, I want to create a material that uses abs(dot(view, normal)) as an alpha parameter to interpolate between full white opaque and full transparent to have a "ghost" shading on transparent surfaces, which will allow to highlight the edges.

Kind regards.

I know this doesn't solve the issue for you, but most of the materials found in the official documentation (https://www.ospray.org/documentation.html#materials) are only supported by the PathTracer renderer. In fact, looking at the documentation, the OBJ material may be the only material that SciVis supports (which would be consistent with casting the material to OBJ).

Rather than a custom material, you may be able to implement a custom, procedural Texture and use it in the opacity channel of the OBJ material using "map_d".

Thank you! Thats actually a pretty good solution!

@chegarty3 Thanks for the suggestion, however there is a limiting factor and is that the texture functions do not receive ray information (which I need to implement the shading type that I need).

Indeed, currently custom materials (i.e., anything else than OBJ) only works in the path tracer, which is unfortunate and we like to change that "some day".

What you like to achieve may be easier done patching the SciVis (and pathtracer) renderer directly.

Thanks for the heads up!