Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
libRendering
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
STORM
repos
Radium
libRendering
Commits
c605a8ef
Commit
c605a8ef
authored
4 years ago
by
Mathias Paulin
Browse files
Options
Downloads
Patches
Plain Diff
Update to Radium master 01212021
parent
34deb1f5
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/libRender/RadiumNBR/NodeBasedRenderer.cpp
+16
-10
16 additions, 10 deletions
src/libRender/RadiumNBR/NodeBasedRenderer.cpp
with
16 additions
and
10 deletions
src/libRender/RadiumNBR/NodeBasedRenderer.cpp
+
16
−
10
View file @
c605a8ef
...
...
@@ -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
::
getRadium
ResourcesDir
()
+
"Shaders/"
};
auto
resourcesRootDir
{
Ra
diumEngine
::
getInstance
()
->
get
ResourcesDir
()
+
"Shaders/"
};
m_shaderMgr
->
addShaderProgram
(
{
{
"Hdr2Ldr"
},
resourcesRootDir
+
"2DShaders/Basic2D.vert.glsl"
,
resourcesRootDir
+
"2DShaders/Hdr2Ldr.frag.glsl"
}
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment