Carna Version 3.3.3
Loading...
Searching...
No Matches
Classes | Typedefs
Carna::presets Namespace Reference

Contains ready-to-use components that are assembled only using the core framework components. More...

Classes

class  CameraNavigationControl
 Implements base::CameraControl, rotates the camera around itself and allows completely free camera movement. More...
 
class  CameraShowcaseControl
 Implements base::CameraControl, rotates the camera around its parent node. The camera movement is bounded to the rail from its parent to its current location. More...
 
class  CompositionStage
 Defines rendering stage that combines two other renderings either by putting them next to each other or through row-wise interleaving. More...
 
class  CuttingPlanesStage
 Renders cutting planes of volume geometries in the scene. More...
 
class  DRRStage
 Renders digital radiograph reconstructs of volume geometries in the scene. More...
 
class  DVRStage
 Performs direct volume renderings of the volume geometries in the scene. More...
 
class  MaskRenderingStage
 Renders 3D masks. More...
 
class  MeshColorCodingStage
 Implements a simple interface for mapping frame coordinates to base::Mesh objects. More...
 
class  MIPLayer
 Defines an intensity range and the way it is visualized by a maximum intensity projection. More...
 
class  MIPStage
 Renders maximum intensity projections of volume geometries in the scene. More...
 
class  OccludedRenderingStage
 Renders geometry that is actually depth-occluded. The occluded geometry is rendered with reduced opacity on-top of the geometry that it is occluded by. More...
 
class  OrthogonalControl
 Controls orthogonal projection matrices, that induce box-shaped visible volume, and base::Camera objects that use such projections. More...
 
class  ParallaxStage
 Produces stereoscopic renderings. More...
 
class  PerspectiveControl
 Controls projection matrices that induce frustum-shaped visible volume. More...
 
class  TransparentRenderingStage
 Implements rendering stage that renders transparent meshes. More...
 
class  VolumeRenderingStage
 Defines abstract base class for rendering stages that render volume geometries in the scene. More...
 

Typedefs

typedef base::MeshRenderingStage< base::Renderable::VideoResourcesOrder< base::MeshRenderingStageBase::ROLE_DEFAULT_MATERIAL > > OpaqueRenderingStage
 Implements rendering stage that renders opaque meshes.
 

Detailed Description

Contains ready-to-use components that are assembled only using the core framework components.

Typedef Documentation

◆ OpaqueRenderingStage

Implements rendering stage that renders opaque meshes.

The OpaqueRenderingStage constructor takes a geometry type parameter:

opaque = new presets::OpaqueRenderingStage( GEOMETRY_TYPE_OPAQUE );
renderer->appendStage( opaque );
base::MeshRenderingStage< base::Renderable::VideoResourcesOrder< base::MeshRenderingStageBase::ROLE_DEFAULT_MATERIAL > > OpaqueRenderingStage
Implements rendering stage that renders opaque meshes.

The concept of geometry types is explained here.

Note
In the rendering process this stage will usually be inserted before such stages that render transparent geometry, like TransparentRenderingStage and VolumeRenderingStage.

The following example code configures the scene s.t. it produces the rendering presented further below:

base::Material& redMaterial = base::Material::create( "unshaded" );
base::Material& greenMaterial = base::Material::create( "unshaded" );
redMaterial .setParameter( "color", base::math::Vector4f( 1, 0, 0, 1 ) );
greenMaterial.setParameter( "color", base::math::Vector4f( 0, 1, 0, 1 ) );
base::Geometry* const box1 = new base::Geometry( GEOMETRY_TYPE_OPAQUE );
base::Geometry* const box2 = new base::Geometry( GEOMETRY_TYPE_OPAQUE );
box1->putFeature( presets::OpaqueRenderingStage::ROLE_DEFAULT_MESH, boxMesh );
box2->putFeature( presets::OpaqueRenderingStage::ROLE_DEFAULT_MESH, boxMesh );
box1->putFeature( presets::OpaqueRenderingStage::ROLE_DEFAULT_MATERIAL, redMaterial );
box2->putFeature( presets::OpaqueRenderingStage::ROLE_DEFAULT_MATERIAL, greenMaterial );
boxMesh.release();
redMaterial.release();
greenMaterial.release();
scene->root->attachChild( box1 );
scene->root->attachChild( box2 );
box1->localTransform = base::math::translation4f( -10, -10, -40 );
box2->localTransform = base::math::translation4f( +10, +10, +40 );
void release()
Denotes that this object is no longer required and may be deleted as soon as it is valid to delete it...
Defines scene graph leafs. Instances of this class represent visible geometry that can be rendered....
Definition Geometry.h:60
void putFeature(unsigned int role, GeometryFeature &feature)
Adds the feature to this geometry node using role in . The concept of geometry features and roles is ...
Represents MeshBase object whose lifetime is managed by instances of this class. This is a format-ind...
Definition ManagedMesh.h:57
Specifies the shader and it's configuration that are to be used for rendering a Geometry node with a ...
Definition Material.h:175
void setParameter(const std::string &name, const ParameterType &value)
Definition Material.h:306
static Material & create(const std::string &shaderName)
Instantiates. Call release when you do not need the object any longer.
static ManagedMesh< VertexType, uint8_t > & createBox(float width, float height, float depth)
Creates box with width, height and depth. The box is centered in .
math::Matrix4f localTransform
Defines the location, rotation and scale of this spatial in relation to it's parent....
Definition Spatial.h:132
Eigen::Matrix< float, 4, 1 > Vector4f
Defines vector.
Definition math.h:195
Matrix4f translation4f(float x, float y, float z)
Returns matrix that translates homogeneous coordinates.
Definition math.h:271

The concept of materials, meshes and other geometry feature is explained here.

exemplary rendering of two box meshes from code above
Author
Leonid Kostrykin
Date
21.2.15 - 6.3.15

Definition at line 61 of file OpaqueRenderingStage.h.