perspective correction for texture in jPCT-AE

Started by nm123, October 21, 2010, 05:09:50 PM

Previous topic - Next topic

nm123

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...

EgonOlsen

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:


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.


Slava.t

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.

EgonOlsen

#4
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.