www.jpct.net

jPCT-AE - a 3d engine for Android => Support => Topic started by: MichaelJPCT on May 19, 2017, 06:20:06 am

Title: add/reduce texture stages at runtime?
Post by: MichaelJPCT 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?
Title: Re: add/reduce texture stages at runtime?
Post by: AeroShark333 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...)
Title: Re: add/reduce texture stages at runtime?
Post by: MichaelJPCT on May 21, 2017, 06:46:55 am
i think using shader is a good way, thanks.