Changing Near plane leads to weird "reproject" results

Started by atreyu64, March 14, 2016, 12:23:18 AM

Previous topic - Next topic

atreyu64

Ok thanks a lot !
I don't use any shadows so it should be ok.

Cheers,

Sylvain

atreyu64

Sorry to bother you again, but it seems like setting Config.glIgnoreNearPlane to false does not work properly on Android.

Have you ever noticed anything wrong with it ?

EgonOlsen

I'm not aware of any problems. I'll look into it. What does 'not properly' mean in this context?

EgonOlsen

I had a look and did some tests with it...I can't find an issue. It looks fine to me. Can you describe your problem in a little more detail? Do you have a test case?

atreyu64

Well actually it's like if glIgnoreNearPlane was not taken into account, but sometimes the display is ok, only when I don't call the renderScene method, which happens here  when "displayNeedsUpdate" is set to false :


if(displayNeedsUpdate) {
cameraChanged();
displayNeedsUpdate = false;

world.renderScene(fb);
world2.renderScene(fb);
}

world.draw(fb);
world2.draw(fb);

blitting();

fb.display();


I'm doing this to avoid rendering again the scene when nothing has changed in the scene.
If I try to call renderScene evry time, it is like glIgnoreNearPlane was ignored.

EgonOlsen

If anything, I would have expected it to be the other way round. If you omit the renderScene()-call, the draw()-call actually triggers some additional calculations that had to be done per frame but are usually done in renderScene(). These calculations were done too early to take a modified plane into account. However, I'm not sure why this should explain the behaviour that you are describing.
Anyway, I've updated the beta-jar of jPCT-AE. Please give it a try and see if that helps. If it doesn't (or makes things worse), can you please provide me with a test case?

atreyu64

Ok I'll give it a try tonight, thanks a lot Helge.

So what you're saying is that I should move the renderScene calls out of the "if" block ? Like this :


if(displayNeedsUpdate) {
cameraChanged();
displayNeedsUpdate = false;
}

world.renderScene(fb);
world2.renderScene(fb);

world.draw(fb);
world2.draw(fb);

blitting();

fb.display();

EgonOlsen

Not necessarily. But from your description, it worked when you omit them but not if you are actually calling them...which puzzles me. Anyway, please give the modified jar a try and see if that helps. If not, try to move them out of this block and see if that helps. If that doesn't help either, I need a test case.

atreyu64

The new beta jar did not change anything, that said I have found the solution.
Actually I use a skybox, and I was calling the skybox.render() method after world.renderScene().
After switching this call order, everything works fine.

Thanks again and sorry for bothering you, cheers !

EgonOlsen

No problem. The order in the draw()-method was wrong anyway. Even if it wasn't a problem in your case, it's better to have it fixed.