Open GoogleCodeExporter opened 9 years ago
Yes a similar issue has been flagged before. It's difficult to solve this
properly
with a static clip plane and a non planar surface. As you rightly point out
this
would only work for certain situations.
However, if you want to send in a clip plane tweak I'd be happy to include it.
Otherwise it'll have to wait until I get a moment.
If you need the maximum wave height you could add a variable to OceanTile to
store
the highest wave height and access the current tile. OceanTile computes the
average
height for each tile when it generates the vertices so it wouldn't be much work
to
store the highest/lowest waves at the point - they should be equally displaced
anyway
the average height of a tile of FFT ocean is approximately zero.
Original comment by kcb...@googlemail.com
on 12 May 2010 at 10:08
> It's difficult to solve this properly with a static clip plane and a non
> planar surface.
Given this some thought - I suppose one could do a (depth-only) pass of the
surface
before doing the reflection map?
Original comment by felix.nawothnig
on 13 May 2010 at 7:43
Can you expand on that?
Original comment by kcb...@googlemail.com
on 13 May 2010 at 7:51
Just thinking... the point of the reflection clipping is avoid rendering any
below-surface geometry - with a non-planar surface the obvious way to do that
is to
exclude below-water geometry using depth-testing.
Instead of using a clipping plane one could simply render the (mirrored) ocean
surface before doing the reflection map with color buffer output disabled (as
we are
only interested in the depth values).
Doing another pass of the surface geometry would obviously have some performance
impact but it shouldn't be that bad - we don't need the water fragment shader
for
this one and it's independent from the scene complexity (and that's my real
reason
for suggesting this - the osgOcean surface itself has virtually no cost in my
(real
world) application, the only thing that hurts me is the extra scene geometry
pass for
reflection...).
Original comment by felix.nawothnig
on 13 May 2010 at 2:39
After lots of trying - okay, I'm pretty sure it's not possible to do this with
just
GL depth testing (because the geometry I want to cull is on the wrong damn
side).
I'll now try rendering the reflected surface into a depth-map and perform an
(additional) manual depth test in the fragment shader... as I only need to do
this in
case the vertex happens to be between wave-bottom and wave-top the penalty still
shouldn't be that bad.
Original comment by felix.nawothnig
on 21 May 2010 at 4:55
It may cost a lot to confirm whether the point is between wave-bottom and
wave-top,
any good ideas?
Original comment by tianxiao...@foxmail.com
on 24 May 2010 at 2:51
Original issue reported on code.google.com by
felix.nawothnig
on 12 May 2010 at 9:37Attachments: