22#ifndef vtkOSPRayRendererNode_h
23#define vtkOSPRayRendererNode_h
28#include "vtkRenderingRayTracingModule.h"
32#ifdef VTKOSPRAY_ENABLE_DENOISER
33#include <OpenImageDenoise/oidn.hpp>
42class vtkOSPRayRendererNodeInternals;
56 void Build(
bool prepass)
override;
71 virtual void WriteLayer(
unsigned char* buffer,
float* zbuffer,
int buffx,
int buffy,
int layer);
296 virtual void*
GetBuffer() {
return this->Buffer.data(); }
396 bool UseBackplate{
true };
405#ifdef VTKOSPRAY_ENABLE_DENOISER
406 oidn::DeviceRef DenoiserDevice;
407 oidn::FilterRef DenoiserFilter;
409 bool DenoiserDirty{
true };
a simple class to control print indentation
represent and manipulate 4x4 transformation matrices
temporal cache ospray structures to speed flipbooks
a collection of materials for vtk apps to draw from
links vtkRenderers to OSPRay
static void SetMaxFrames(int, vtkRenderer *renderer)
When present on renderer, controls the number of ospray render calls for each refresh.
static void SetVolumeAnisotropy(double, vtkRenderer *renderer)
Convenience method to set/get VOLUME_ANISOTROPY on a vtkRenderer.
static double GetVarianceThreshold(vtkRenderer *renderer)
Convenience method to set/get VARIANCE_THRESHOLD on a vtkRenderer.
static void SetRendererType(std::string name, vtkRenderer *renderer)
Set the OSPRay renderer type to use (e.g.
static vtkOSPRayRendererNode * GetRendererNode(vtkViewNode *)
Convenience method to get and downcast renderable.
std::vector< osp::vec3f > NormalBuffer
std::vector< float > Buffer
RTW::Backend * GetBackend()
static void SetAmbientSamples(int, vtkRenderer *renderer)
Convenience method to set/get AMBIENT_SAMPLES on a vtkRenderer.
virtual float * GetZBuffer()
Get the last rendered ZBuffer.
static int GetRouletteDepth(vtkRenderer *renderer)
Convenience method to set/get ROULETTE_DEPTH on a vtkRenderer.
void Build(bool prepass) override
Builds myself.
static vtkInformationDoubleKey * MIN_CONTRIBUTION()
When present on renderer, sample contributions below this value will be neglected to speedup renderin...
static void SetCompositeOnGL(int, vtkRenderer *renderer)
Convenience method to set/get COMPOSITE_ON_GL on a vtkRenderer.
static vtkInformationDoubleKey * VOLUME_ANISOTROPY()
When present on renderer, affects path traced rendering phase function.
static vtkInformationDoubleKey * MAX_CONTRIBUTION()
When present on renderer, samples are clamped to this value before they are accumulated into the fram...
~vtkOSPRayRendererNode() override
virtual int GetColorBufferTextureGL()
OSPRenderer GetORenderer()
Methods for other nodes to access.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
static vtkInformationIntegerKey * SAMPLES_PER_PIXEL()
When present on renderer, controls the number of primary rays shot per pixel default is 1.
std::vector< OSPVolumetricModel > VolumetricModels
std::vector< OSPInstance > Instances
static int GetAmbientSamples(vtkRenderer *renderer)
Convenience method to set/get AMBIENT_SAMPLES on a vtkRenderer.
static void SetMaterialLibrary(vtkOSPRayMaterialLibrary *, vtkRenderer *renderer)
Convenience method to set/get Material library on a renderer.
static void SetVarianceThreshold(double, vtkRenderer *renderer)
Convenience method to set/get VARIANCE_THRESHOLD on a vtkRenderer.
static int GetEnableDenoiser(vtkRenderer *renderer)
Enable denoising (if supported).
static void SetEastPole(double *, vtkRenderer *renderer)
Convenience method to set/get EAST_POLE on a vtkRenderer.
static vtkInformationObjectBaseKey * MATERIAL_LIBRARY()
Material Library attached to the renderer.
static void SetMaxContribution(double, vtkRenderer *renderer)
Convenience method to set/get MAX_CONTRIBUTION on a vtkRenderer.
static void SetMaxDepth(int, vtkRenderer *renderer)
Convenience method to set/get MAX_DEPTH on a vtkRenderer.
static double GetMaxContribution(vtkRenderer *renderer)
Convenience method to set/get MAX_CONTRIBUTION on a vtkRenderer.
vtkOSPRayRendererNodeInternals * Internal
static int GetTimeCacheSize(vtkRenderer *renderer)
Convenience method to set/get TIME_CACHE_SIZE on a vtkRenderer.
static void SetMinContribution(double, vtkRenderer *renderer)
Convenience method to set/get MIN_CONTRIBUTION on a vtkRenderer.
static int GetMaxFrames(vtkRenderer *renderer)
When present on renderer, controls the number of ospray render calls for each refresh.
std::vector< float > ODepthBuffer
static int GetMaxDepth(vtkRenderer *renderer)
Convenience method to set/get MAX_DEPTH on a vtkRenderer.
static vtkInformationIntegerKey * BACKGROUND_MODE()
Control use of the path tracer backplate and environmental background.
static vtkInformationIntegerKey * ROULETTE_DEPTH()
When present on renderer, controls the ray recursion depth at which to start Russian roulette termina...
static BackgroundMode GetBackgroundMode(vtkRenderer *renderer)
Control use of the path tracer backplate and environmental background.
static double GetViewTime(vtkRenderer *renderer)
Convenience method to set/get VIEW_TIME on a vtkRenderer.
static double * GetEastPole(vtkRenderer *renderer)
Convenience method to set/get EAST_POLE on a vtkRenderer.
std::vector< OSPLight > Lights
static vtkInformationIntegerKey * MAX_DEPTH()
When present on renderer, controls the maximum ray recursion depth default is 20.
static std::string GetRendererType(vtkRenderer *renderer)
Set the OSPRay renderer type to use (e.g.
static vtkInformationIntegerKey * TIME_CACHE_SIZE()
Temporal cache size.
vtkOSPRayCache< vtkOSPRayCacheItemObject > * Cache
static void SetDenoiserThreshold(int, vtkRenderer *renderer)
Convenience method to set/get DENOISER_THRESHOLD on a vtkRenderer.
std::vector< float > ZBuffer
virtual void WriteLayer(unsigned char *buffer, float *zbuffer, int buffx, int buffy, int layer)
Put my results into the correct place in the provided pixel buffer.
virtual void * GetBuffer()
Get the last rendered ColorBuffer.
static double GetMinContribution(vtkRenderer *renderer)
Convenience method to set/get MIN_CONTRIBUTION on a vtkRenderer.
std::set< OSPWorld > CacheContents
virtual int GetDepthBufferTextureGL()
static vtkInformationDoubleKey * VARIANCE_THRESHOLD()
When present on renderer, controls the threshold for adaptive accumulation default is 0....
static vtkInformationIntegerKey * COMPOSITE_ON_GL()
used to make the renderer add ospray's content onto GL rendered content on the window
std::vector< osp::vec3f > AlbedoBuffer
void AddLight(OSPLight light)
void Render(bool prepass) override
Traverse graph in ospray's preferred order and render.
static vtkOSPRayMaterialLibrary * GetMaterialLibrary(vtkRenderer *renderer)
Convenience method to set/get Material library on a renderer.
vtkMTimeType AccumulateTime
static int GetSamplesPerPixel(vtkRenderer *renderer)
Convenience method to set/get SAMPLES_PER_PIXEL on a vtkRenderer.
static vtkInformationIntegerKey * AMBIENT_SAMPLES()
When present on renderer, controls the number of ambient occlusion samples shot per hit.
std::vector< osp::vec4f > ColorBuffer
static vtkInformationIntegerKey * ENABLE_DENOISER()
Enable denoising (if supported).
static void SetNorthPole(double *, vtkRenderer *renderer)
Convenience method to set/get NORTH_POLE on a vtkRenderer.
static double * GetNorthPole(vtkRenderer *renderer)
Convenience method to set/get NORTH_POLE on a vtkRenderer.
static void SetRouletteDepth(int, vtkRenderer *renderer)
Convenience method to set/get ROULETTE_DEPTH on a vtkRenderer.
static int GetCompositeOnGL(vtkRenderer *renderer)
Convenience method to set/get COMPOSITE_ON_GL on a vtkRenderer.
void Traverse(int operation) override
static vtkOSPRayRendererNode * New()
static void SetViewTime(double, vtkRenderer *renderer)
Convenience method to set/get VIEW_TIME on a vtkRenderer.
void Invalidate(bool prepass) override
Invalidates cached rendering data.
static void SetSamplesPerPixel(int, vtkRenderer *renderer)
Convenience method to set/get SAMPLES_PER_PIXEL on a vtkRenderer.
static double GetVolumeAnisotropy(vtkRenderer *renderer)
Convenience method to set/get VOLUME_ANISOTROPY on a vtkRenderer.
std::vector< osp::vec4f > DenoisedBuffer
static vtkInformationDoubleVectorKey * NORTH_POLE()
World space direction of north pole for gradient and texture background.
void Denoise()
Denoise the colors stored in ColorBuffer and put into Buffer.
std::vector< OSPGeometricModel > GeometricModels
static vtkInformationIntegerKey * MAX_FRAMES()
When present on renderer, controls the number of ospray render calls for each refresh.
static vtkInformationDoubleVectorKey * EAST_POLE()
World space direction of east pole for texture background.
static void SetEnableDenoiser(int, vtkRenderer *renderer)
Convenience method to set/get ENABLE_DENOISER on a vtkRenderer.
static vtkInformationIntegerKey * DENOISER_THRESHOLD()
Accumulation threshold when above which denoising kicks in.
static int GetDenoiserThreshold(vtkRenderer *renderer)
Convenience method to set/get DENOISER_THRESHOLD on a vtkRenderer.
static void SetTimeCacheSize(int, vtkRenderer *renderer)
Convenience method to set/get TIME_CACHE_SIZE on a vtkRenderer.
static vtkInformationStringKey * RENDERER_TYPE()
Set the OSPRay renderer type to use (e.g.
vtkMatrix4x4 * AccumulateMatrix
vtkRenderer * GetRenderer()
static vtkInformationDoubleKey * VIEW_TIME()
Requested time to show in a renderer and to lookup in a temporal cache.
static void SetBackgroundMode(BackgroundMode, vtkRenderer *renderer)
Control use of the path tracer backplate and environmental background.
vtkViewNode specialized for vtkRenderers
abstract specification for renderers
a node within a VTK scene graph
vtkTypeUInt32 vtkMTimeType