Author Topic: why set texture with 128*128 png is ok,but 128*256 it is none?  (Read 524 times)

Offline Uncle Ray

  • int
  • **
  • Posts: 81
    • View Profile
why set texture with 128*128 png is ok,but 128*256 it is none?
« on: October 08, 2014, 05:08:17 am »
SOLVED THX EGO
with the Objetc3D ,i used the same png for set texture,when it's resolution 128*128,everything is ok.
but when it's resolution is 128*256,the object3D was displayed nothing but black.

whether the texture must be 128*128,256*256.....?
« Last Edit: October 20, 2014, 02:51:00 pm by Uncle Ray »

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11748
    • View Profile
    • http://www.jpct.net
Re: why set texture with 128*128 png is ok,but 128*256 it is none?
« Reply #1 on: October 08, 2014, 08:08:31 am »
OpenGL ES 2.0? In that case, it's "normal" behaviour. That's why the log should output a warning message if you are using such a texture. IIRC, this is caused by a loophole in the ES 2.0 specs, which somehow doesn't define the expected result for such textures, so the GPU vendor is free to handle this case in every way he likes and that includes black squares. The result when using such textures in not predictable. Sometimes it works, sometimes it doesn't. Judging from my experience, it seems to work for 256*128 more than it does for 128*256. But to be sure, just use square textures instead.
« Last Edit: October 08, 2014, 08:18:58 am by EgonOlsen »

Offline Uncle Ray

  • int
  • **
  • Posts: 81
    • View Profile
Re: why set texture with 128*128 png is ok,but 128*256 it is none?
« Reply #2 on: October 08, 2014, 08:20:44 am »
yes,it is opengl es 2.0,i got it,just square,thx ego.