void update( const FrameData& frameData ) { initTransferFunction( frameData.getRenderSettings().getTransferFunction( )); _nSamplesPerRay = frameData.getVRParameters().getSamplesPerRay(); _computedSamplesPerRay = _nSamplesPerRay; _nSamplesPerPixel = frameData.getVRParameters().getSamplesPerPixel(); }
RayCastRenderer::RayCastRenderer( const GLEWContext* glewContext, const uint32_t samples, const uint32_t componentCount, const GLenum gpuDataType, const GLint internalFormat ) : Renderer( componentCount, gpuDataType, internalFormat ) , nSamples_( samples ) , transferFunctionTexture_( 0 ) { if( !glewContext ) LBTHROW( std::runtime_error( "No GLEW context given" + where( __FILE__, __LINE__ ))); TransferFunction1D< unsigned char > transferFunction; initTransferFunction( transferFunction ); shadersPtr_.reset( new GLSLShaders ); // TODO: Add the shaders from resource directory const int error = shadersPtr_->loadShaders( ShaderData( vertRayCast_glsl, fragRayCast_glsl )); if( error != GL_NO_ERROR ) LBTHROW( std::runtime_error( "Can't load glsl shaders: " + eq::glError( error ) + where( __FILE__, __LINE__ ))); framebufferTempTexturePtr_.reset( new eq::util::Texture( GL_TEXTURE_RECTANGLE_ARB, glewContext )); }
Impl( const uint32_t samplesPerRay, const uint32_t samplesPerPixel, const VolumeInformation& volInfo ) : _framebufferTexture( GL_TEXTURE_RECTANGLE_ARB, glewGetContext( )) , _nSamplesPerRay( samplesPerRay ) , _nSamplesPerPixel( samplesPerPixel ) , _computedSamplesPerRay( samplesPerRay ) , _volInfo( volInfo ) , _transferFunctionTexture( 0 ) { TransferFunction1D transferFunction; initTransferFunction( transferFunction ); // TODO: Add the shaders from resource directory const int error = _shaders.loadShaders( ShaderData( vertRayCast_glsl, fragRayCast_glsl )); if( error != GL_NO_ERROR ) LBTHROW( std::runtime_error( "Can't load glsl shaders: " + eq::glError( error ) + where( __FILE__, __LINE__ ))); }