ospray / anari-ospray

Translation layer from ANARI to OSPRay, ANARILibrary and ANARIDevice "ospray".
Apache License 2.0
17 stars 5 forks source link

List of ANARI features needed for the sci-vis application OVITO #18

Open stukowski opened 2 weeks ago

stukowski commented 2 weeks ago

We would like to use OSPRay in our sci-vis application OVITO via the ANARI interface. OVITO has been integrating ANARI for final frame rendering since version 3.10 and the soon to be released version 3.11 of OVITO will use it also for real-time rendering of the interactive viewports in the GUI. So far we ship only the VisRTX backend, being the only available ANARI implementation supporting all required features.

OSPRay has been integrated into OVITO for a long time via its native API (so far only for final frame rendering), but going forward it would be desirable to rely solely on the ANARI interface. In particular, this would immediately make it possible for us to use OSPRay in the interactive viewports too.

I have identified which ANARI features our application needs and which of them are already supported by anari-ospray today. I am posting this analysis here for information only, to document which parts of the ANARI specification are relevant for a typical sci-vis application like ours and what is still lacking. I hope you find this report useful, but feel free to close this issue at any time, even if anari-ospray does not yet support all required capabilities.

If needed, I can provide more details. Or reach out to me directly (e.g. via www.ovito.org). In any case, we are very grateful for the development of OSPRay.

ANARI_KHR_DEVICE_SYNCHRONIZATION:

OVITO performs multi-threaded world construction and frame rendering with ANARI, in particular for multiple viewport windows in the GUI. Different viewports can share parts of the same 3d scene. Ideally, the ANARI device should support concurrent creation of ANARI objects (instances, geometries, lights, etc.) without extra application-side synchronization requirements.

ANARI_KHR_FRAME_COMPLETION_CALLBACK:

As a GUI application, OVITO relies on the callback-based notification mechanism to react to frame completion in a timely manner. Progress reporting is accomplished by polling the frame's renderProgress property in regular time intervals.

ANARI_MATERIAL matte:

OVITO uses only the matte material so far. However, anari-ospray doesn't seem to support alphaMode=blend at the moment if I'm not mistaken. Semi-transparent objects appear fully opaque. Sooner or later we are going to switch to the PBR material in any case.

ANARI_SAMPLER image1D:

OVITO uses this sampler to implement pseudo-color mapping. For that, it sets the inTransform, inOffset, filter, and image parameters. The sampler's inAttribute is set to "color", as OVITO provides the input values as per-vertex single-channel colors. Here is a reference image for comparison and the current output produced by anari-ospray, which seems to ignore inTransform and inOffset, unfortunately:

pseudocolor_mapping_reference pseudocolor_mapping_ospray

ANARI_SAMPLER transform:

OVITO mainly uses this sampler to convert per-vertex transparency values to alpha opacity values (a=1-t). The per-vertex transparency values are stored in attribute0 and the sampler is assigned to the opacity channel of the matte material.

ANARI_VISRTX_INSTANCE_ATTRIBUTES & ANARI_VISRTX_INSTANCE_TRANSFORM_ARRAY:

OVITO uses these experimental extensions to efficiently render large numbers (>10M) of non-spherical particles (e.g., cubes, ellipsoids, other mesh-based glyphs), each with a different color and transformation matrix.

ANARI_VISRTX_TRIANGLE_BACK_FACE_CULLING:

OVITO uses this experimental extension to render two-sided meshes, which are represented by pairs of triangles with opposite winding orders in our application. The opposite sides of a surface manifold can have different (local) face colors, for example: twosided_mesh

Denoising

Our native OSPRay integration in OVITO uses the denoising post-processing filter. It would be nice if the ANARI interface would allow to use it too.

Frame channels:

So far OVITO uses OpenGL offscreen rendering to implement object picking in the interactive viewports, but going forward we would like to use ANARI for this. Thus, OVITO will need support for the following auxiliary frame channels:

johguenther commented 2 weeks ago

Thank you for this exhaustive list and feedback, very valuable. Some items are easier and will come rather quick (e.g. completion callback, sampler1D, ID channels, matte material), others will need some more planning.