www.jpct.net

jPCT-AE - a 3d engine for Android => Support => Topic started by: nm123 on October 21, 2010, 05:09:50 pm

Title: perspective correction for texture in jPCT-AE
Post by: nm123 on October 21, 2010, 05:09:50 pm
Hi, I loaded some 3ds models with textures into the android emulator. The textures display fine when the camera is in far distance, but when camera's getting close to the objects, the textures start to become destroyed/changing shape. Wondering is there perspective correction for texture in jPCT-AE? or I need to do something in the code to make the textures display normal? 

Much appreciate your answer…
Title: Re: perspective correction for texture in jPCT-AE
Post by: EgonOlsen on October 21, 2010, 08:16:37 pm
That's on purpose to increase frame rate on the emulator. It sucks anyway...it has bugs in some many areas and is dog slow...i don't consider the emulator's software renderer to be useful for development. However, if you really want to, you can add a single line of OpenGL code right after creating the FrameBuffer that should give you perspective correction:

Code: [Select]
gl10.glHint(GL10.GL_PERSPECTIVE_CORRECTION_HINT, GL10.GL_NICEST);

...with gl10 being the gl context. Usually, i don't encourage people to mix jPCT-AE with pure GL, but in this case, it shouldn't hurt.
Title: Re: perspective correction for texture in jPCT-AE
Post by: nm123 on October 24, 2010, 02:23:57 am
Thanks! that does help...
Title: Re: perspective correction for texture in jPCT-AE
Post by: Slava.t on July 19, 2011, 02:21:54 pm
I think this info should be included in the Wiki and/or as a comment in the HelloWorld example.

I've applied a checkered texture to the cube from the HelloWorld-AE project and found out that it is weirdly distorted.  It took me a couple of hours to find this thread and realize that it is not my mistake or jPCT bug.
Title: Re: perspective correction for texture in jPCT-AE
Post by: EgonOlsen on July 19, 2011, 04:32:33 pm
I see your point...however, i really don't want to encourage people to use the emulator...it just sucks and gives you a false impression of the actual results. And OpenGL ES 2.0 isn't supported at all.

Edit: I've added a short page to the wiki.