Skip to content
Snippets Groups Projects
Commit c605a8ef authored by Mathias Paulin's avatar Mathias Paulin :speech_balloon:
Browse files

Update to Radium master 01212021

parent 34deb1f5
No related branches found
No related tags found
No related merge requests found
......@@ -85,8 +85,14 @@ void NodeBasedRenderer::initializeInternal() {
}
void NodeBasedRenderer::initPasses() {
auto resourcesPath = Ra::Core::Resources::ResourcesLocator(
reinterpret_cast<void*>( &NodeBasedRendererMagic ), "/Resources/RadiumNBR/", "../" );
auto resourcesCheck = Ra::Core::Resources::getResourcesPath(
reinterpret_cast<void*>( &NodeBasedRendererMagic ), { "Resources/RadiumNBR" } );
if ( !resourcesCheck )
{
LOG( Ra::Core::Utils::logERROR ) << "Unable to find resources for NodeBasedRenderer!";
return;
}
auto resourcesPath{ *resourcesCheck };
auto depthTexture = m_sharedTextures.find( "Depth ( AdvRndr )" );
auto colorTexture = m_sharedTextures.find( "Linear RGB ( AdvRndr )" );
......@@ -113,7 +119,7 @@ void NodeBasedRenderer::initPasses() {
// Add the shared depth texture
m_zPrePass->setOutput( *depthTexture );
// configure acces to shader files
m_zPrePass->setResourcesDir( resourcesPath.getBasePath() );
m_zPrePass->setResourcesDir( resourcesPath );
m_zPrePass->initializePass( m_width, m_height, m_shaderMgr );
for ( auto&& t : m_zPrePass->getOutputImages() )
{
......@@ -130,7 +136,7 @@ void NodeBasedRenderer::initPasses() {
std::make_unique<SphereSampler>( m_aoSamplingMethod, m_aoSamplingPoints );
m_aoPass = std::make_shared<AccessibilityBufferPass>(
&m_allRenderObjects, NodeBasedRendererPasses::ACCESSIBILITY_PASS );
m_aoPass->setResourcesDir( resourcesPath.getBasePath() );
m_aoPass->setResourcesDir( resourcesPath );
m_aoPass->setSampler( std::move( sphereSampler ) );
// Connect to the preceeding pass
auto posTexture = m_sharedTextures.find( "GeomPrePass::PosInWorld" );
......@@ -152,7 +158,7 @@ void NodeBasedRenderer::initPasses() {
{
m_emissivityPass = std::make_shared<EmissivityPass>(
&m_allRenderObjects, NodeBasedRendererPasses::EMISSIVITY_PASS );
m_emissivityPass->setResourcesDir( resourcesPath.getBasePath() );
m_emissivityPass->setResourcesDir( resourcesPath );
m_emissivityPass->setInputs( *depthTexture, *ambientOcclusionTexture );
m_emissivityPass->setOutput( *colorTexture );
m_emissivityPass->setBackground( getBackgroundColor() );
......@@ -166,7 +172,7 @@ void NodeBasedRenderer::initPasses() {
{
m_envlightPass = std::make_shared<EnvLightPass>(
&m_allRenderObjects, NodeBasedRendererPasses::ENVMAP_LIGHTING_OPAQUE_PASS );
m_envlightPass->setResourcesDir( resourcesPath.getBasePath() );
m_envlightPass->setResourcesDir( resourcesPath );
m_envlightPass->setInputs( *depthTexture, *ambientOcclusionTexture );
m_envlightPass->setOutput( *colorTexture );
m_envlightPass->initializePass( m_width, m_height, m_shaderMgr );
......@@ -178,7 +184,7 @@ void NodeBasedRenderer::initPasses() {
{
m_locallightPass = std::make_shared<LocalLightPass>(
&m_allRenderObjects, NodeBasedRendererPasses::LIGHTING_OPAQUE_PASS );
m_locallightPass->setResourcesDir( resourcesPath.getBasePath() );
m_locallightPass->setResourcesDir( resourcesPath );
m_locallightPass->setInputs( *depthTexture, *ambientOcclusionTexture );
m_locallightPass->setOutput( *colorTexture );
m_locallightPass->setLightManager( m_lightmanagers[0] );
......@@ -190,7 +196,7 @@ void NodeBasedRenderer::initPasses() {
{
m_transparencyPass = std::make_shared<TransparencyPass>(
&m_transparentRenderObjects, NodeBasedRendererPasses::LIGHTING_TRANSPARENT_PASS );
m_transparencyPass->setResourcesDir( resourcesPath.getBasePath() );
m_transparencyPass->setResourcesDir( resourcesPath );
m_transparencyPass->setInputs( *depthTexture, *ambientOcclusionTexture );
m_transparencyPass->setOutput( *colorTexture );
m_transparencyPass->setLightManager( m_lightmanagers[0] );
......@@ -203,7 +209,7 @@ void NodeBasedRenderer::initPasses() {
{
m_volumelightPass = std::make_shared<VolumeLightingPass>(
&m_volumetricRenderObjects, NodeBasedRendererPasses::LIGHTING_VOLUME_PASS );
m_volumelightPass->setResourcesDir( resourcesPath.getBasePath() );
m_volumelightPass->setResourcesDir( resourcesPath );
m_volumelightPass->setInputs( *depthTexture, *colorTexture );
m_volumelightPass->setOutput( *colorTexture );
m_volumelightPass->setLightManager( m_lightmanagers[0] );
......@@ -232,7 +238,7 @@ void NodeBasedRenderer::initPasses() {
void NodeBasedRenderer::initShaders() {
// uses several resources from the Radium engine
std::string resourcesRootDir = { Ra::Core::Resources::getRadiumResourcesDir() + "Shaders/" };
auto resourcesRootDir{ RadiumEngine::getInstance()->getResourcesDir() + "Shaders/" };
m_shaderMgr->addShaderProgram( { { "Hdr2Ldr" },
resourcesRootDir + "2DShaders/Basic2D.vert.glsl",
resourcesRootDir + "2DShaders/Hdr2Ldr.frag.glsl" } );
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment