rendergather / osgocean

Automatically exported from code.google.com/p/osgocean
GNU Lesser General Public License v3.0
0 stars 0 forks source link

I am in a puzzle about the realization of osgOcean's 'Glare effect' #31

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hi Kim, 

I saw the code in 'OceanScen.cpp', that 5 cameras 
in 'osgOcean::OceanScen::_glarePasses' were used to render the glare 
effect. 

But I saw the realization code in "water.frag" is just as bellow: 
if(osgOcean_EnableGlare) 
{ 
float lum = luminance(lumColor); 
gl_FragData[1] = vec4(lum); 
} 
And it looks like that the cameras in 'osgOcean::OceanScen::_glarePasses' 
have not been used anywhere. Will tell me why? 

Thank you! 

Cheers, 
Tian

Original issue reported on code.google.com by tianxiao...@foxmail.com on 24 May 2010 at 7:15

GoogleCodeExporter commented 9 years ago
What you're seeing in water.frag is the write to the luminance buffer 
(gl_FragData[1]) 
this buffer is then passed through four pre render passes which streak blur the 
luminance buffer in two directions (two passes per direction). The fifth pass 
composites the blurred image on the screen creating the glare effect.

The cameras are used on line 758 of OceneScene.cpp

Original comment by kcb...@googlemail.com on 24 May 2010 at 7:21

GoogleCodeExporter commented 9 years ago
Thanks for your explain.
I understand that now.

Original comment by tianxiao...@foxmail.com on 25 May 2010 at 3:31