本文整理汇总了C++中LightPtr::get方法的典型用法代码示例。如果您正苦于以下问题:C++ LightPtr::get方法的具体用法?C++ LightPtr::get怎么用?C++ LightPtr::get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LightPtr
的用法示例。
在下文中一共展示了LightPtr::get方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: render
void render( const RenderInput& renderInput,
RenderOutput& renderOutput )
{
reshape( renderInput.windowSize );
_engine->preRender();
_engine->getCamera()->set(
renderInput.position, renderInput.target, renderInput.up );
#if(BRAYNS_USE_DEFLECT || BRAYNS_USE_REST)
if( !_extensionPluginFactory )
_intializeExtensionPluginFactory( );
_extensionPluginFactory->execute( );
#endif
ScenePtr scene = _engine->getScene();
CameraPtr camera = _engine->getCamera();
FrameBufferPtr frameBuffer = _engine->getFrameBuffer();
const Vector2i& frameSize = frameBuffer->getSize();
if( _parametersManager->getRenderingParameters().getSunOnCamera() )
{
LightPtr sunLight = scene->getLight( 0 );
DirectionalLight* sun =
dynamic_cast< DirectionalLight* > ( sunLight.get() );
if( sun )
{
sun->setDirection( camera->getTarget() - camera->getPosition() );
scene->commitLights();
}
}
camera->commit();
_render( );
uint8_t* colorBuffer = frameBuffer->getColorBuffer( );
size_t size =
frameSize.x( ) * frameSize.y( ) * frameBuffer->getColorDepth( );
renderOutput.colorBuffer.assign( colorBuffer, colorBuffer + size );
float* depthBuffer = frameBuffer->getDepthBuffer( );
size = frameSize.x( ) * frameSize.y( );
renderOutput.depthBuffer.assign( depthBuffer, depthBuffer + size );
_engine->postRender();
}