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
bc5996bb
Commit
bc5996bb
authored
4 years ago
by
Mathias Paulin
Browse files
Options
Downloads
Patches
Plain Diff
Allow to configure the NodeBasedRenderer after from any functor.
parent
94cb1c80
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/libRender/RadiumNBR/NodeBasedRenderer.cpp
+8
-2
8 additions, 2 deletions
src/libRender/RadiumNBR/NodeBasedRenderer.cpp
src/libRender/RadiumNBR/NodeBasedRenderer.hpp
+12
-2
12 additions, 2 deletions
src/libRender/RadiumNBR/NodeBasedRenderer.hpp
with
20 additions
and
4 deletions
src/libRender/RadiumNBR/NodeBasedRenderer.cpp
+
8
−
2
View file @
bc5996bb
...
...
@@ -22,12 +22,16 @@ using namespace Ra::Engine::Rendering;
namespace
RadiumNBR
{
using
namespace
gl
;
static
int
NodeBasedRendererMagic
=
0xFF0F00F0
;
int
NodeBasedRendererMagic
=
0xFF0F00F0
;
static
const
GLenum
buffers
[]
=
{
GL_COLOR_ATTACHMENT0
};
NodeBasedRenderer
::
NodeBasedRenderer
()
:
Renderer
()
{}
NodeBasedRenderer
::
NodeBasedRenderer
(
std
::
function
<
void
(
NodeBasedRenderer
*
,
int
,
int
)
>
configurator
)
:
Renderer
(),
m_configurator
{
std
::
move
(
configurator
)}
{}
NodeBasedRenderer
::~
NodeBasedRenderer
()
=
default
;
bool
NodeBasedRenderer
::
buildRenderTechnique
(
RenderObject
*
ro
)
const
{
...
...
@@ -106,6 +110,8 @@ void NodeBasedRenderer::initializeInternal() {
initBuffers
();
for
(
const
auto
&
t
:
m_sharedTextures
)
{
m_secondaryTextures
.
insert
(
{
t
.
first
,
t
.
second
.
get
()
}
);
}
if
(
m_configurator
)
{
m_configurator
(
this
,
m_width
,
m_height
);
}
}
void
NodeBasedRenderer
::
resizeInternal
()
{
...
...
@@ -266,7 +272,7 @@ void NodeBasedRenderer::postProcessInternal( const ViewingParameters& /* renderD
// Todo : verify if the ro partition is the good one and that the passes use the right part.
void
NodeBasedRenderer
::
updateStepInternal
(
const
ViewingParameters
&
renderData
)
{
m_allRenderObjects
.
clear
();
for
(
auto
it
=
m_fancyRenderObjects
.
begin
();
it
!=
m_fancyRenderObjects
.
end
();
)
for
(
auto
it
=
m_fancyRenderObjects
.
begin
();
it
!=
m_fancyRenderObjects
.
end
();
++
it
)
{
m_allRenderObjects
.
push_back
(
*
it
);
}
...
...
This diff is collapsed.
Click to expand it.
src/libRender/RadiumNBR/NodeBasedRenderer.hpp
+
12
−
2
View file @
bc5996bb
...
...
@@ -2,6 +2,7 @@
#include
<RadiumNBR/NodeBasedRendererMacro.hpp>
#include
<RadiumNBR/RenderPass.hpp>
#include
<Core/Resources/Resources.hpp>
#include
<Engine/Rendering/Renderer.hpp>
namespace
globjects
{
...
...
@@ -10,10 +11,13 @@ class Framebuffer;
namespace
RadiumNBR
{
/// Todo, put this somewhere else. This is needed to locate resources by cclient applications
extern
int
NodeBasedRendererMagic
;
/** Node based for the Radium Engine
* This Renderer is fully configurable, either dynammically or programatically.
* It implements the Ra::Engine::Rendering/Renderer interface and can
d
be configured by adding
* as many RadiumNBR::RenderPass
rendering passes
.
* It implements the Ra::Engine::Rendering/Renderer interface and can be configured by adding
* as many RadiumNBR::RenderPass
as needed
.
*
* It defines two textures that migh be shared between passes :
* - a depth buffer attachable texture
...
...
@@ -29,6 +33,8 @@ class NodeBasedRenderer_LIBRARY_API NodeBasedRenderer : public Ra::Engine::Rende
public:
NodeBasedRenderer
();
NodeBasedRenderer
(
std
::
function
<
void
(
NodeBasedRenderer
*
,
int
,
int
)
>
configurator
);
~
NodeBasedRenderer
()
override
;
[[
nodiscard
]]
std
::
string
getRendererName
()
const
override
{
return
"Configurable Renderer"
;
}
...
...
@@ -61,6 +67,7 @@ class NodeBasedRenderer_LIBRARY_API NodeBasedRenderer : public Ra::Engine::Rende
virtual
void
initShaders
();
virtual
void
initBuffers
();
public
:
inline
std
::
map
<
std
::
string
,
std
::
shared_ptr
<
Ra
::
Engine
::
Data
::
Texture
>>
&
sharedTextures
()
{
return
m_sharedTextures
;
}
...
...
@@ -100,6 +107,9 @@ class NodeBasedRenderer_LIBRARY_API NodeBasedRenderer : public Ra::Engine::Rende
/// The default pass
int
m_defaultPass
{
-
1
};
/// The configurator functor to use
std
::
function
<
void
(
NodeBasedRenderer
*
,
int
,
int
)
>
m_configurator
;
};
}
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