[Solved] simpleWater PostProcessor renders entire scene (no Frustrum of objects)

Hi coredevs!



I found a bug(as i assume) with frustrum and post processors. If I run a postrocessor(simpleWater for example) and I if see entire scene on the screen, so there will be no frustrum after my scene will be visible on a screen.



I have a bug with the SimpleWater PostProcessor.

But i have no bug with @tone0neg’s SSAO(filter) and this Cartoon filter(PostProcessor):

http://hub.jmonkeyengine.org/groups/user-code-projects/forum/topic/mikumikudance-viewer/





Sorry for my bad explanation. Possibly, my video will show this better:

http://www.youtube.com/watch?v=1OKLKYwQd4Q&feature=youtu.be





Thanks.
2 Likes

@t0neg0d , @nehon , @normen can you check this issue?



Possibly some buffers are not cleared.



My scene has 240 000 triangles.

If I don’t see any objects I have ~750 triangle count. If i will see entire scene (240000 * 2 (post effect)) and then rotate the camera to empty space again , so there will be always 240 000 triangle count. Even if i dont see any object.

No bumping please.

@mifth: Is the problem also present with the Post Water filter?

I cannot see anything that would cause this issue in code. These filters use the same rendering path, just a different camera setup.

@Momoko_Fan said:
@mifth: Is the problem also present with the Post Water filter?
I cannot see anything that would cause this issue in code. These filters use the same rendering path, just a different camera setup.



Ok, i found the rotation where i have an issue:
http://www.youtube.com/watch?v=9RYS4fC4Vrk&feature=youtu.be



I have 948 Triangles on one side and 2998 Triangles from other side of rotation. Is this an issue?

Just paste this code to TestSimpleWater.java to get the same scene:
[java]
for (int i=0; i<100; i++) {
Geometry geo = geom.clone(false);
geo.move(2f*i+1f, 0, 0);
sceneNode.attachChild(geo);
}
[/java]

The difference is only one object. The frustum culling is an approximation anyway so it may add objects that are not actually visible …

Ok, i get you.

Thanks!

I am guessing that extra object was seen on the stats but not in the simple water passes because we are using the Camera.setClipPlane() method. It alters the projection matrix such that objects outside of the plane are not rendered, but the planes of the camera that are used for frustum culling are not modified, therefore, frustum culling is incorrect when the camera clip plane is used.



@nehon: Please take note of this

1 Like

It seems i found some work for @nehon :slight_smile: .

Ok i found the issue, that’s actually some culling issue due to bad camera planeState initialization.



I’ll commit a patch soon.

this should be fixed thanks for the test case

Could you please test?

2 Likes
@nehon said:
this should be fixed thanks for the test case
Could you please test?


Wow! So fast! I'll check tomorrow with nightly builds.
@nehon said:
this should be fixed thanks for the test case
Could you please test?


YOU FIXED THIS ISSUE!!!!!!!!!!!!!!!!!!!!!!!! YAHOOOO!!!!!!!!!!!!!!!!!!! THANKS A LOT TO ALL OF YOU!!!

heheh, good.

That was a nice catch, this issue was here unoticed since a long time

1 Like