Author Topic: change textures coordinates  (Read 4757 times)

Offline Gatobot14

  • int
  • **
  • Posts: 64
    • View Profile
change textures coordinates
« on: January 23, 2016, 02:49:35 pm »
Its posible for an animated object (bones object) to use setTextureMatrix???

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: change textures coordinates
« Reply #1 on: January 23, 2016, 02:54:20 pm »
Yes, why shouldn't it?

Offline Gatobot14

  • int
  • **
  • Posts: 64
    • View Profile
Re: change textures coordinates
« Reply #2 on: January 24, 2016, 01:13:19 am »
Docs says that works better on compiled objects and i dont know if bones objects are compiled, and after reading this ,
its good practice to use compiled objects? what are the benefits, or limitations?? i only call build

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: change textures coordinates
« Reply #3 on: January 24, 2016, 10:56:24 am »
The wiki has a section on compiled objects. Basically, it's a good idea to use them, because they are much faster in most cases. If using them on animated objects, you have to make sure to compile them in dynamic mode and for Bones, you have to call touch() on an animated object after applying an animation, because otherwise, it won't recognize the change.
jPCT-AE always uses compiled objects BTW.

Offline Gatobot14

  • int
  • **
  • Posts: 64
    • View Profile
Re: change textures coordinates
« Reply #4 on: January 25, 2016, 02:58:29 pm »
Ok now setTexturesMatrix only work in stage 0, i have my textures in one texture atlas, if i need to set another texture layer in my object, how can i move textures coordinates for the second layer?

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: change textures coordinates
« Reply #5 on: January 25, 2016, 04:25:23 pm »
If you don't specify anything else, the texture coordinates for the second stage will be the same the ones for the first if you assign a TextureInfo instance with 2 stages.

Offline Gatobot14

  • int
  • **
  • Posts: 64
    • View Profile
Re: change textures coordinates
« Reply #6 on: January 25, 2016, 10:28:02 pm »
But i will be able to move the coordinates for the second layer? Suppose i dont want the second layer be in same position like the first, example: in a texture atlas i have my first texture in first tile and my second texture in the fourth tile, is this possible?

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: change textures coordinates
« Reply #7 on: January 25, 2016, 10:37:16 pm »
...not sure what you mean exactly...!?

Offline Gatobot14

  • int
  • **
  • Posts: 64
    • View Profile
Re: change textures coordinates
« Reply #8 on: January 27, 2016, 03:45:36 am »
if setTextureMatrix changes coordinates for first layer, how can i change coordinates for second layer?

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: change textures coordinates
« Reply #9 on: January 27, 2016, 07:27:06 am »
By default, you can't. You would have to use your own custom shader to do that.

Offline Gatobot14

  • int
  • **
  • Posts: 64
    • View Profile
Re: change textures coordinates
« Reply #10 on: January 29, 2016, 05:36:16 am »
perfect thanks for your patience jeje ::)

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: change textures coordinates
« Reply #11 on: May 24, 2016, 08:58:44 pm »
 ??? Which game?