Author Topic: add/reduce texture stages at runtime?  (Read 1718 times)

Offline MichaelJPCT

  • float
  • ****
  • Posts: 264
    • View Profile
add/reduce texture stages at runtime?
« on: May 19, 2017, 06:20:06 am »
i have a terrain with 3 tex stages, each with different UV scaling. it was created with textureInfo/polygonManager technique.
i found tex stages affect render speed - the more stages the slower, on a powerVR 544 gpu.
i wonder if i could reduce/add a tex stage(a noise tex in my case) depending on camera distance.
is there a way to do so?

Offline AeroShark333

  • float
  • ****
  • Posts: 319
    • View Profile
Re: add/reduce texture stages at runtime?
« Reply #1 on: May 20, 2017, 10:25:51 am »
I think you could write something that generates noise in the fragment shader (which you can make dependant on the camera distance).

http://byteblacksmith.com/improvements-to-the-canonical-one-liner-glsl-rand-for-opengl-es-2-0/
I tried this one myself and it works fine on most devices (not all devices output the same though...)

Offline MichaelJPCT

  • float
  • ****
  • Posts: 264
    • View Profile
Re: add/reduce texture stages at runtime?
« Reply #2 on: May 21, 2017, 06:46:55 am »
i think using shader is a good way, thanks.