Commit c6343422 authored by Michele Bosi's avatar Michele Bosi

Updated vivid test.

parent 372a704f
......@@ -375,7 +375,7 @@ public:
#endif
mVividRendering->sceneManager()->tree()->addActor( act );
act->setEnableMask( vl::VividRenderer::VividEnableMask );
act->setEnableMask( vl::Vivid::VividEnableMask );
}
}
......@@ -416,12 +416,12 @@ 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::VividEnableMask );
points_act->setEnableMask( vl::Vivid::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 );
ref<vl::Image> img = new Image("/images/sphere.png");
ref<vl::Texture> texture = fx->shader()->getTextureSampler( vl::VividRendering::UserTexture )->texture();
ref<vl::Texture> texture = fx->shader()->getTextureSampler( vl::Vivid::UserTexture )->texture();
texture->createTexture2D( img.get(), vl::TF_UNKNOWN, false, false );
#else
points_act->setEnableMask( vl::VividRenderer::StandardEnableMask );
......@@ -459,12 +459,12 @@ public:
#endif
// Volume
#if 0
vec3 volume_box_center = mVividRendering->sceneManager()->tree()->aabb().center();
AABB volume_box;
volume_box.setMinCorner( volume_box_center - vec3(100,50,50) );
volume_box.setMaxCorner( volume_box_center + vec3(100,50,50) );
printf("%f %f %f\n", volume_box.width(), volume_box.height(), volume_box.depth() );
#if 0
ref< Image > volume = vl::loadImage("/volume/BostonTeapot.dat");
mVividRendering->setupVolume( volume.get(), volume_box, NULL );
......@@ -476,27 +476,27 @@ 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::VividEnableMask );
vol_box->setEnableMask( vl::Vivid::VividEnableMask );
vol_box->setObjectName( "Volume Box" );
#endif
#if 0
#if 1
// texture mapped quad
ref<Image> vl_img = loadImage( "/tmp/liver/VL-Stencil.png" );
ref<Geometry> quad = vl::makeGrid( volume_box.center(), volume_box.width(), volume_box.depth(), 10, 10, true );
fx = vl::VividRendering::makeVividEffect();
Actor* quad_act = mVividRendering->sceneManager()->tree()->addActor( quad.get(), fx.get(), NULL );
quad->setObjectName( "QUAD" );
quad_act->setEnableMask( vl::VividRenderer::VividEnableMask );
quad_act->setEnableMask( vl::Vivid::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
quad->setColorArray( vl::white );
// These must be present as part of the default Vivid material
VL_CHECK( fx->shader()->getTextureSampler( vl::VividRendering::UserTexture ) )
VL_CHECK( fx->shader()->getTextureSampler( vl::VividRendering::UserTexture )->texture() )
VL_CHECK( fx->shader()->getUniform("vl_UserTexture")->getUniformI() == vl::VividRendering::UserTexture );
ref<vl::Texture> texture = fx->shader()->getTextureSampler( vl::VividRendering::UserTexture )->texture();
VL_CHECK( fx->shader()->getTextureSampler( vl::Vivid::UserTexture ) )
VL_CHECK( fx->shader()->getTextureSampler( vl::Vivid::UserTexture )->texture() )
VL_CHECK( fx->shader()->getUniform("vl_UserTexture")->getUniformI() == vl::Vivid::UserTexture );
ref<vl::Texture> texture = fx->shader()->getTextureSampler( vl::Vivid::UserTexture )->texture();
// Recreate new texture (TexParameter is not reset so we can keep the current defaults)
texture->createTexture2D( vl_img.get(), vl::TF_UNKNOWN, false, false );
#endif
......@@ -552,13 +552,13 @@ public:
}
break;
case '1':
mVividRendering->setRenderingMode(VividRendering::DepthPeeling);
mVividRendering->setRenderingMode(Vivid::DepthPeeling);
break;
case '2':
mVividRendering->setRenderingMode(VividRendering::FastRender);
mVividRendering->setRenderingMode(Vivid::FastRender);
break;
case '3':
mVividRendering->setRenderingMode(VividRendering::StencilRender);
mVividRendering->setRenderingMode(Vivid::StencilRender);
break;
case 's':
saveActor( this->mVividRendering->sceneManager()->tree()->actors()->at(0) );
......
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