Author Topic: multiple coordinates for texture stages?  (Read 476 times)

Offline MichaelJPCT

  • long
  • ***
  • Posts: 140
    • View Profile
multiple coordinates for texture stages?
« on: August 12, 2016, 10:32:27 am »
i created a heightmap terrain using Object3D(pos,normal,uv,index,textureID) method.
if i want the the terrain to have at least 2 layers of texture tile - one large tile(repeat 4x4) & one smaller tile of noise(repeat 128x128). in what way should i set it up?
should i use shader?

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11777
    • View Profile
    • http://www.jpct.net
Re: multiple coordinates for texture stages?
« Reply #1 on: August 12, 2016, 05:48:07 pm »
No, you don't have to. You can set new texture coordinates for each polygon by using the PolygonManager. You could read the coordinates of the first layer, multiply them by some value and assign then to the second. That way, you'll get a scaled texture on the second layer. You have to look into TextureInfo as well, because that's what you need to implement this.

Offline MichaelJPCT

  • long
  • ***
  • Posts: 140
    • View Profile
Re: multiple coordinates for texture stages?
« Reply #2 on: August 13, 2016, 05:46:51 am »
thanks. i've read about PolygonManager now.
i would like to know, after manipulating polygons, is the Object3D still compiled (rendered by GL as a batch)? what i concern about is the rendering performance.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11777
    • View Profile
    • http://www.jpct.net
Re: multiple coordinates for texture stages?
« Reply #3 on: August 13, 2016, 10:05:50 am »
You should do it before compiling it in this case.

Offline MichaelJPCT

  • long
  • ***
  • Posts: 140
    • View Profile
Re: multiple coordinates for texture stages?
« Reply #4 on: August 14, 2016, 08:58:02 am »
great, it works correctly.