www.jpct.net

jPCT-AE - a 3d engine for Android => Support => Topic started by: Yelen on September 17, 2013, 01:22:19 pm

Title: Depth bug?
Post by: Yelen on September 17, 2013, 01:22:19 pm
Im making a game where you manipulate a skateboard. When I rotate the skateboard sometimes some objects are not behind different objects. How to properly display my skateboard?
(http://i.imgur.com/UJ9gnFr.png)
Title: Re: Depth bug?
Post by: EgonOlsen on September 17, 2013, 02:13:16 pm
Are both objects transparent?
Title: Re: Depth bug?
Post by: Yelen on September 18, 2013, 12:49:40 pm
Heres the apk. It seems that the depth buffer is turned off. The object rendering queue is sorted by the distance between the center of the object and the camera.
https://www.dropbox.com/s/3gqe2dwknhfxilf/Skategame.apk

>Are both objects transparent?
I dont think so. The textures are loaded by
Code: [Select]
texture = new Texture(BitmapHelper.rescale(
BitmapHelper.convert(res.getDrawable(R.drawable.uv_wheel)),
512, 512), true);
I didn't write my own project but I modified the hello World app.

(http://i.imgur.com/Tvb8faT.png)
Title: Re: Depth bug?
Post by: EgonOlsen on September 18, 2013, 02:13:40 pm
If the depth buffer is off, it's something with your way to create the gl context. jPCT-AE doesn't create the context by itself, it's up to the app to provide a proper one. However, it's still worth a try to do a setTransparency(-1) on all objects. If they are in 3ds format, the loader will load the transparency setting from the file and some exporters add a value here where none should be.