SPH
Classes | Public Member Functions | List of all members
RayMarcher Class Reference

#include <RayTracer.h>

Inheritance diagram for RayMarcher:
IRaytracer IRenderer Polymorphic

Public Member Functions

 RayMarcher (SharedPtr< IScheduler > scheduler, const GuiSettings &settings)
 
 ~RayMarcher () override
 
virtual void initialize (const Storage &storage, const IColorizer &colorizer, const ICamera &camera) override
 Prepares the objects for rendering and updates its data. More...
 
virtual bool isInitialized () const override
 Checks if the renderer has been initialized. More...
 
- Public Member Functions inherited from IRaytracer
 IRaytracer (SharedPtr< IScheduler > scheduler, const GuiSettings &gui)
 
virtual void render (const RenderParams &params, Statistics &stats, IRenderOutput &output) const final
 Draws particles into the bitmap, given the data provided in initialize. More...
 
virtual void cancelRender () override
 Stops the rendering if it is currently in progress. More...
 
- Public Member Functions inherited from Polymorphic
virtual ~Polymorphic ()
 

Additional Inherited Members

- Protected Member Functions inherited from IRaytracer
Rgba getEnviroColor (const CameraRay &ray) const
 
- Protected Attributes inherited from IRaytracer
SharedPtr< ISchedulerscheduler
 
ThreadLocal< ThreadDatathreadData
 
std::atomic_bool shouldContinue
 

Detailed Description

Definition at line 16 of file RayTracer.h.

Constructor & Destructor Documentation

◆ RayMarcher()

NAMESPACE_SPH_BEGIN RayMarcher::RayMarcher ( SharedPtr< IScheduler scheduler,
const GuiSettings settings 
)

Definition at line 13 of file RayTracer.cpp.

◆ ~RayMarcher()

RayMarcher::~RayMarcher ( )
overridedefault

Member Function Documentation

◆ initialize()

void RayMarcher::initialize ( const Storage storage,
const IColorizer colorizer,
const ICamera camera 
)
overridevirtual

Prepares the objects for rendering and updates its data.

Called every time a parameter changes. Renderer should cache any data necessary for rendering of particles (particle positions, colors, etc.).

Parameters
storageStorage containing positions of particles, must match the particles in colorizer.
colorizerData-to-color conversion object for particles. Must be already initialized!
cameraCamera used for rendering.

Implements IRenderer.

Definition at line 26 of file RayTracer.cpp.

◆ isInitialized()

bool RayMarcher::isInitialized ( ) const
overridevirtual

Checks if the renderer has been initialized.

Implements IRenderer.

Definition at line 126 of file RayTracer.cpp.

Member Data Documentation

◆ brdf

AutoPtr<IBrdf> RayMarcher::brdf

BRDF used to get the surface reflectance.

Definition at line 35 of file RayTracer.h.

◆ colors

Array<Rgba> RayMarcher::colors

Particle colors.

Definition at line 71 of file RayTracer.h.

◆ dirToSun

Vector RayMarcher::dirToSun

Direction to sun; sun is assumed to be a point light source.

Definition at line 32 of file RayTracer.h.

◆ doEmission

bool RayMarcher::doEmission

If true, the colors are used for emission, otherwise for diffuse reflectance.

Definition at line 90 of file RayTracer.h.

◆ flags

Array<Size> RayMarcher::flags

Particle indices.

Definition at line 80 of file RayTracer.h.

◆ materialIDs

Array<Size> RayMarcher::materialIDs

Material ID for each particle.

Definition at line 83 of file RayTracer.h.

◆ r

Array<Vector> RayMarcher::r

Particle positions.

Definition at line 68 of file RayTracer.h.

◆ renderSpheres

bool RayMarcher::renderSpheres = true

Render surface of spheres instead of an isosurface.

Definition at line 41 of file RayTracer.h.

◆ shadows

bool RayMarcher::shadows = true

Cast shadows.

Definition at line 38 of file RayTracer.h.

◆ textures

Array<SharedPtr<Texture> > RayMarcher::textures

Textures of the rendered bodies. Can be empty. The textures are assigned to the bodies using their material IDs.

Definition at line 87 of file RayTracer.h.

◆ uvws

Array<Vector> RayMarcher::uvws

Mapping coordinates. May be empty.

Definition at line 74 of file RayTracer.h.

◆ v

Array<Float> RayMarcher::v

Particle volume (=mass/density)

Definition at line 77 of file RayTracer.h.


The documentation for this class was generated from the following files: