27 #include "../shaders/WGEPropertyUniform.h"
28 #include "../shaders/WGEShaderPropertyDefine.h"
29 #include "WGEPostprocessorGauss.h"
30 #include "WGEPostprocessorMergeOp.h"
32 #include "WGEPostprocessorLineAO.h"
36 "LineAO is a special ambient occlusion technique optimized for dense line and tube rendering." )
43 "LineAO is a special ambient occlusion technique optimized for dense line and tube rendering." )
46 WPropInt lineaoSamples =
m_properties->addProperty(
"Samples",
"The number of samples to take in screen-space. Higher values produce better "
47 "quality but can reduce FPS dramatically.", 32 );
48 lineaoSamples->setMin( 1 );
49 lineaoSamples->setMax( 128 );
51 WPropInt lineaoScalers =
m_properties->addProperty(
"Hemispheres",
"The number of hemispheres to sample around each pixel. Higher values "
52 "produce better quality but can reduce FPS dramatically.", 3 );
53 lineaoScalers->setMin( 1 );
54 lineaoScalers->setMax( 8 );
56 WPropDouble lineaoRadiusSS =
m_properties->addProperty(
"Radius",
"The radius around the pixel to sample for occluders in pixels.", 2.0 );
57 lineaoRadiusSS->setMin( 0.01 );
58 lineaoRadiusSS->setMax( 10.0 );
60 WPropDouble lineaoTotalStrength =
m_properties->addProperty(
"Total Strength",
"The strength of the effect. Higher values emphasize the effect.",
62 lineaoTotalStrength->setMin( 0.0 );
63 lineaoTotalStrength->setMax( 5.0 );
65 WPropDouble lineaoDensityWeight =
m_properties->addProperty(
"Density Weight",
"The strength of the occluder influence in relation to the "
66 "geometry density. The higher the value, the larger the "
67 "influence. Low values remove the drop-shadow effect. "
68 "This defines the influence of one occluder to the overall "
70 lineaoDensityWeight->setMin( 0.001 );
71 lineaoDensityWeight->setMax( 2.0 );
78 s->setDefine(
"WGE_POSTPROCESSOR_LINEAO" );
90 osg::ref_ptr< WGEOffscreenTexturePass > lineAOPass = offscreen->addTextureProcessingPass( s,
"LineAO" );
96 m_resultTextures.push_back( lineAOPass->attach( osg::Camera::COLOR_BUFFER0, GL_RGB ) );
99 size_t gBufUnitOffset = gbuffer.
bind( lineAOPass );
102 const size_t size = 64;
104 lineAOPass->bind( randTex, gBufUnitOffset );