Large size model can't be displayed properly

Started by nm123, November 18, 2010, 03:20:47 PM

Previous topic - Next topic

nm123

I try to load large size models with  jPCT-AE in android emulator, for example to show a plane:

plane = Primitives.getPlane(2, 1000000);

and set Config.farPlane = 100000000. The plane can't be shown in whole. When the camera move/turn, some broken color blocks(the plane's texture color) are flashing everywhere on the screen. ???...

What can I do in the code to get the LARGE size model displayed properly without above problem?!

Thanks in advance...

raft


EgonOlsen

This is an insanely large plane. You'll most likely run into accuracy issues with that, which are imposed by the gpu itself. There's just one solution: Don't do it. If you want a large plane, split it.

nm123

Thanks for the replies and advise. Just a question:  how many polygons in the plane for following:

plane = Primitives.getPlane(1, 100000);

suppose not many, right?

EgonOlsen

Two. But that's not the point. They are not polygons, they are monsters...much too large.

nm123

I agree it's somehow insane :D. But it's useful in the case of making a large ground with edges close to the far horizontial line as much as possible so that from the view of camera the edges can't be seen (nearly).

And the large plane doesn't have many polygons for performance reason.

I saw in some 3d libs this can be done, so suppose JPCT-AE can do it too. :)

EgonOlsen

There's no magic involved in rendering a large plane, no secret switch or magic code or something. If you create it, render it and it looks wrong, it just doesn't work...at least on your platform. There's no way around this except not to do it. Just cover the edges in fog...

As said, mobile gpus lack accuracy, which is most likely the reason for this.

nm123

Oh well, if don't use this super large ground, how can I make the effect that an airplane or walker can not see the ground boundaries and can never come close to the boundary edges? Use a relatively large ground model won't help because the airplane/walker can eventually move close and reach to the edges, in that case fog won't help... I would like the airplane/walker can go any directions and there are no walls to block its way.

Your ideas/tips will be much appreciated!

EgonOlsen

You may try to create an infinite plane by code..."just" detect in which direction the player is facing and transform a fixed set of sub-plane objects so that they form the plane before him. If you are moving too far away from the origin, you might have to shift the whole world though, or otherwise you'll run into accuracy problems again.

Have a look at my game Alien Runner. It uses the same approach in a simplified form for the race track. You could race to infinity on that thing you the game would let you...it just takes the part that leaves the screen and attaches it again at the far end, which results in an infinite track.

nm123

Thanks for the suggestions... Where can I get the source code for the Alien Runner game?