Commit fe23d240 authored by Michele Bosi's avatar Michele Bosi

Lazy Vivid volume GLSL initialization.

parent 65defae2
......@@ -120,11 +120,6 @@ VividVolume::VividVolume(VividRendering* vivid_rendering)
mVolumeActor = new Actor;
mVolumeFX = new Effect;
mVolumeTransform = new Transform;
mVolumeGLSLProgram = mVolumeFX->shader()->gocGLSLProgram();
mVolumeGLSLProgram->attachShader( new GLSLVertexShader("/vivid/glsl/volume/raycast.vs") );
mVolumeGLSLProgram->attachShader( new GLSLFragmentShader("/vivid/glsl/volume/raycast.fs") );
mVolumeGLSLProgram->linkProgram();
mVolumeActor->setEnableMask( Vivid::StandardEnableMask );
mVolumeActor->setObjectName( "Volume Actor" );
......@@ -283,6 +278,13 @@ void VividVolume::setBox( const AABB& box )
}
//-----------------------------------------------------------------------------
void VividVolume::setupVolume( Image* img, const AABB& bounds, Image* transfer_func) {
if ( ! mVolumeGLSLProgram ) {
mVolumeGLSLProgram = mVolumeFX->shader()->gocGLSLProgram();
mVolumeGLSLProgram->attachShader( new GLSLVertexShader("/vivid/glsl/volume/raycast.vs") );
mVolumeGLSLProgram->attachShader( new GLSLFragmentShader("/vivid/glsl/volume/raycast.fs") );
mVolumeGLSLProgram->linkProgram();
}
setBox( bounds );
// Texture #0: volume data
......
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