rendergather / osgocean

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

reflectionVisible calculation broken #27

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
The reflectionVisible calculation in OceanScene::preRenderCull is broken -
it doesn't take into account _enableReflections:

It should be:

-        bool reflectionVisible = cv.getEyePoint().z() <
_eyeHeightReflectionCutoff - getOceanSurfaceHeight();
+        bool reflectionVisible = _enableReflections &&
(cv.getEyePoint().z() < _eyeHeightReflectionCutoff - getOceanSurfaceHeight());

Original issue reported on code.google.com by felix.nawothnig on 7 May 2010 at 7:33

GoogleCodeExporter commented 9 years ago
Thanks Felix. Checked into the trunk.

Regards,

Kim.

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

GoogleCodeExporter commented 9 years ago
I see that you reverted the patch again - may I ask why? The problem I'm seeing 
is
that in the shader you do

  if(osgOcean_EnableReflections)
  {
    env_color = texture2DProj( osgOcean_ReflectionMap, distortGen(vVertex, N) );    
  }
  else
  {
    env_color = gl_LightSource[osgOcean_LightID].diffuse;   
  }

although you (correctly) skipped reflection culling in 
OceanScene::preRenderCull() -
which causes random noise from the reflection texture unit to appear on the 
surface
(I suppose this depends on the OpenGL implementation...).

Original comment by felix.nawothnig on 10 May 2010 at 11:10