Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
OpenWalnut
OpenWalnut Core
Commits
c4ebcb7d
Commit
c4ebcb7d
authored
Jun 13, 2012
by
Sebastian Eichelbaum
Browse files
[CHANGE] some minor changes and doc improvements
parent
eaaf7b32
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
9 deletions
+14
-9
src/core/graphicsEngine/postprocessing/WGEPostprocessorLineAO.cpp
.../graphicsEngine/postprocessing/WGEPostprocessorLineAO.cpp
+12
-9
src/core/graphicsEngine/shaders/shaders/WGEPostprocessor-fragment.glsl
...hicsEngine/shaders/shaders/WGEPostprocessor-fragment.glsl
+2
-0
No files found.
src/core/graphicsEngine/postprocessing/WGEPostprocessorLineAO.cpp
View file @
c4ebcb7d
...
...
@@ -26,6 +26,8 @@
#include "../shaders/WGEPropertyUniform.h"
#include "../shaders/WGEShaderPropertyDefine.h"
#include "WGEPostprocessorGauss.h"
#include "WGEPostprocessorMergeOp.h"
#include "WGEPostprocessorLineAO.h"
...
...
@@ -68,6 +70,9 @@ WGEPostprocessorLineAO::WGEPostprocessorLineAO( osg::ref_ptr< WGEOffscreenRender
lineaoDensityWeight
->
setMin
(
0.001
);
lineaoDensityWeight
->
setMax
(
2.0
);
// NOTE: The paper proposes to use a gaussian pyramid of the depth and normal maps. We skip this step. Skipping this causes the AO to look
// more crispy and more detailed at local scope.
// use the standard postprocessor uber-shader
WGEShader
::
RefPtr
s
=
new
WGEShader
(
"WGEPostprocessor"
);
s
->
setDefine
(
"WGE_POSTPROCESSOR_LINEAO"
);
...
...
@@ -81,24 +86,22 @@ WGEPostprocessorLineAO::WGEPostprocessorLineAO( osg::ref_ptr< WGEOffscreenRender
new
WGEShaderPropertyDefine
<
WPropInt
>
(
"WGE_POSTPROCESSOR_LINEAO_SAMPLES"
,
lineaoSamples
)
)
);
// create the LineAO rendering pass
osg
::
ref_ptr
<
WGEOffscreenTexturePass
>
p
ass
=
offscreen
->
addTextureProcessingPass
(
s
,
"LineAO"
);
p
ass
->
getOrCreateStateSet
()
->
addUniform
(
new
WGEPropertyUniform
<
WPropDouble
>
(
"u_lineaoDensityWeight"
,
lineaoDensityWeight
)
);
p
ass
->
getOrCreateStateSet
()
->
addUniform
(
new
WGEPropertyUniform
<
WPropDouble
>
(
"u_lineaoTotalStrength"
,
lineaoTotalStrength
)
);
p
ass
->
getOrCreateStateSet
()
->
addUniform
(
new
WGEPropertyUniform
<
WPropDouble
>
(
"u_lineaoRadiusSS"
,
lineaoRadiusSS
)
);
osg
::
ref_ptr
<
WGEOffscreenTexturePass
>
lineAOP
ass
=
offscreen
->
addTextureProcessingPass
(
s
,
"LineAO"
);
lineAOP
ass
->
getOrCreateStateSet
()
->
addUniform
(
new
WGEPropertyUniform
<
WPropDouble
>
(
"u_lineaoDensityWeight"
,
lineaoDensityWeight
)
);
lineAOP
ass
->
getOrCreateStateSet
()
->
addUniform
(
new
WGEPropertyUniform
<
WPropDouble
>
(
"u_lineaoTotalStrength"
,
lineaoTotalStrength
)
);
lineAOP
ass
->
getOrCreateStateSet
()
->
addUniform
(
new
WGEPropertyUniform
<
WPropDouble
>
(
"u_lineaoRadiusSS"
,
lineaoRadiusSS
)
);
// attach color0 output
m_resultTextures
.
push_back
(
p
ass
->
attach
(
osg
::
Camera
::
COLOR_BUFFER0
,
GL_RGB
)
);
m_resultTextures
.
push_back
(
lineAOP
ass
->
attach
(
osg
::
Camera
::
COLOR_BUFFER0
,
GL_RGB
)
);
// provide the Gbuffer input
size_t
gBufUnitOffset
=
gbuffer
.
bind
(
p
ass
);
size_t
gBufUnitOffset
=
gbuffer
.
bind
(
lineAOP
ass
);
// this effect needs some additional noise texture:
const
size_t
size
=
64
;
osg
::
ref_ptr
<
WGETexture2D
>
randTex
=
wge
::
genWhiteNoiseTexture
(
size
,
size
,
3
);
p
ass
->
bind
(
randTex
,
gBufUnitOffset
);
lineAOP
ass
->
bind
(
randTex
,
gBufUnitOffset
);
}
WGEPostprocessorLineAO
::~
WGEPostprocessorLineAO
()
...
...
src/core/graphicsEngine/shaders/shaders/WGEPostprocessor-fragment.glsl
View file @
c4ebcb7d
...
...
@@ -295,6 +295,8 @@ float getSSAO()
//
// - This implementation matches the paper in most cases. We made some additional improvements and
// simplifications here. This simply is due to the time-lag between first submission and final acceptance.
// - The paper proposes to use a gaussed version of the depth and normal maps. We skip this step here. This way,
// the images look more crispy and provide more _local_ detail.
//
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment