Commit 9cfa64e9 authored by Michele Bosi's avatar Michele Bosi

VolumeEnableMask -> StandardMask, DefaultMask -> VividMask

parent ec2538cb
......@@ -375,7 +375,7 @@ public:
#endif
mVividRendering->sceneManager()->tree()->addActor( act );
act->setEnableMask( vl::VividRenderer::DefaultEnableMask );
act->setEnableMask( vl::VividRenderer::VividEnableMask );
}
}
......@@ -416,7 +416,7 @@ public:
fx->shader()->getPointSize()->set( 20 );
Actor* points_act = mVividRendering->sceneManager()->tree()->addActor( points.get(), fx.get(), NULL );
#if 1
points_act->setEnableMask( vl::VividRenderer::DefaultEnableMask );
points_act->setEnableMask( vl::VividRenderer::VividEnableMask );
fx->shader()->getUniform( "vl_Vivid.enableLighting" )->setUniformI( 0 );
fx->shader()->getUniform( "vl_Vivid.enablePointSprite" )->setUniformI( 1 );
fx->shader()->gocUniform( "vl_Vivid.enableTextureMapping" )->setUniformI( 1 );
......@@ -424,7 +424,7 @@ public:
ref<vl::Texture> texture = fx->shader()->getTextureSampler( vl::VividRendering::UserTexture )->texture();
texture->createTexture2D( img.get(), vl::TF_UNKNOWN, false, false );
#else
points_act->setEnableMask( vl::VividRenderer::VolumeEnableMask );
points_act->setEnableMask( vl::VividRenderer::StandardEnableMask );
fx->shader()->enable( vl::EN_POINT_SMOOTH );
fx->shader()->enable( vl::EN_BLEND );
fx->shader()->disable( vl::EN_LIGHTING );
......@@ -476,7 +476,7 @@ public:
ref<Geometry> box_outline = vl::makeBox( volume_box );
box_outline->computeNormals();
Actor* vol_box = mVividRendering->sceneManager()->tree()->addActor( box_outline.get(), fx_box.get(), mVividRendering->vividVolume()->volumeTransform() );
vol_box->setEnableMask( vl::VividRenderer::DefaultEnableMask );
vol_box->setEnableMask( vl::VividRenderer::VividEnableMask );
vol_box->setObjectName( "Volume Box" );
#endif
......@@ -487,7 +487,7 @@ public:
fx = vl::VividRendering::makeVividEffect();
Actor* quad_act = mVividRendering->sceneManager()->tree()->addActor( quad.get(), fx.get(), NULL );
quad->setObjectName( "QUAD" );
quad_act->setEnableMask( vl::VividRenderer::DefaultEnableMask );
quad_act->setEnableMask( vl::VividRenderer::VividEnableMask );
fx->shader()->getUniform("vl_Vivid.enableTextureMapping")->setUniformI( 1 );
fx->shader()->getUniform("vl_Vivid.enableLighting")->setUniformI( 0 );
// When texture mapping is enabled texture is modulated by vertex color
......
......@@ -245,7 +245,7 @@ namespace vl
geom_adj->setNormalArray( geom->normalArray() );
int total_triangles = 0;
for( size_t idc = 0; idc < geom->drawCalls().size(); ++idc ) {
for( int idc = 0; idc < geom->drawCalls().size(); ++idc ) {
int triangle_count = 0;
const DrawCall* dc = geom->drawCalls()[ idc ].get();
int indices = dc->countIndices();
......
......@@ -67,7 +67,7 @@ VividRenderer::VividRenderer(VividRendering* vivid_rendering)
mVividRendering = vivid_rendering;
setEnableMask( DefaultEnableMask );
setEnableMask( VividEnableMask );
// Depth peeling settings
mNumPasses = 4;
......@@ -630,12 +630,12 @@ void VividRenderer::renderFrontToBackPeeling(const RenderQueue* render_queue, Ca
VL_CHECK_OGL();
}
//-------------------------------------------------------------------------------------------------
void VividRenderer::renderVolumes(const RenderQueue* render_queue, Camera* camera, real frame_clock) {
setEnableMask( VolumeEnableMask );
void VividRenderer::renderStandard(const RenderQueue* render_queue, Camera* camera, real frame_clock) {
setEnableMask( StandardEnableMask );
Renderer::renderRaw( render_queue, camera, frame_clock );
setEnableMask( DefaultEnableMask );
setEnableMask( VividEnableMask );
}
//-------------------------------------------------------------------------------------------------
void VividRenderer::render2DOutlines(const RenderQueue* render_queue, Camera* camera, real frame_clock) {
......@@ -1047,7 +1047,7 @@ const RenderQueue* VividRenderer::render(const RenderQueue* render_queue, Camera
// Render Volumes
VL_CHECK( this->framebuffer()->openglContext()->isCleanState( true ) );
renderVolumes( render_queue, camera, frame_clock );
renderStandard( render_queue, camera, frame_clock );
return render_queue;
}
......
......@@ -52,8 +52,10 @@ namespace vl
VL_INSTRUMENT_CLASS(vl::VividRenderer, Renderer)
public:
static const int DefaultEnableMask = 1;
static const int VolumeEnableMask = 2;
// This will use the Vivid depth peeling rendering path
static const int VividEnableMask = 1;
// This will use the standard VL Renderer rendering path. Used for volumes, text, etc.
static const int StandardEnableMask = 2;
public:
VividRenderer(VividRendering* vivid_rendering);
......@@ -86,7 +88,8 @@ namespace vl
void renderQueue(const RenderQueue* in_render_queue, vl::GLSLProgram* cur_glsl, Camera* camera, real frame_clock, bool depth_peeling_on=true, bool outline_on = false);
void renderBackgroundImage( Camera* camera );
void render2DOutlines( const RenderQueue* in_render_queue, Camera* camera, real frame_clock );
void renderVolumes( const RenderQueue* in_render_queue, Camera* camera, real frame_clock );
// Used to render volumes, text and all Actors that we want to render using the standard VL rendering
void renderStandard( const RenderQueue* in_render_queue, Camera* camera, real frame_clock );
void lazyInitialize();
void deleteGLBuffers();
......
......@@ -126,7 +126,7 @@ VividVolume::VividVolume(VividRendering* vivid_rendering)
mVolumeGLSLProgram->attachShader( new GLSLFragmentShader("/vivid/glsl/volume/raycast.fs") );
mVolumeGLSLProgram->linkProgram();
mVolumeActor->setEnableMask( VividRenderer::VolumeEnableMask );
mVolumeActor->setEnableMask( VividRenderer::StandardEnableMask );
mVolumeActor->setObjectName( "Volume Actor" );
bindActor( mVolumeActor.get() );
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment