General > Feedback

multiple textures


Hi everyone

just asking what is the best approach,
suppose i have a terrain grid and each squares uses a different texture, what its best
1) having a lot of different texture files and setting them as needed
2) have one big texture and change the uv's

for now been using number 1, but not sure if this its the best

Using one or at least as few as possible is the better solution, because it reduces draw calls by a huge amount.

ok in jpct for desktop i started to use textureMatrix, but how muh is a few???
what is a reasonable number of used textures

The thing is that each change in texture means a state change for OpenGL. State changes are expensive, so you should try to avoid them anyway but in addition, polygons with a different state (i.e. texture in this case) can't be rendered in the same draw call. And draw calls are the most expensive things in OpenGL.
jPCT tries, both in compiled and hybrid mode, to minimize these by batching geometry based on the textures used, so it should be ok if a terrain uses 1-8 texture depending on the size of the terrain. But it's not a good idea to make it use 64 textures or something. As a rule of thumb, I suggest to merge textures where possible but don't go crazy on it. If it really helps your project or your art pipeline to leave some textures as individual, then do it.

ok , yeah in the end i think both ways have to be use but i have better understanding now


[0] Message Index

Go to full version