Author Topic: perspective correction for texture in jPCT-AE  (Read 3756 times)

Offline nm123

  • byte
  • *
  • Posts: 9
    • View Profile
perspective correction for texture in jPCT-AE
« 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…

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: perspective correction for texture in jPCT-AE
« Reply #1 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.

Offline nm123

  • byte
  • *
  • Posts: 9
    • View Profile
Re: perspective correction for texture in jPCT-AE
« Reply #2 on: October 24, 2010, 02:23:57 am »
Thanks! that does help...

Offline Slava.t

  • byte
  • *
  • Posts: 1
    • View Profile
Re: perspective correction for texture in jPCT-AE
« Reply #3 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.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: perspective correction for texture in jPCT-AE
« Reply #4 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.
« Last Edit: July 19, 2011, 04:46:12 pm by EgonOlsen »