Tuesday, July 18, 2017

opengl - How to decide how many textures to break an object into?


So I am making a couple spacecraft in my game. And I want them to look sharp and as photorealistic as possible.


How can I decide if a certain craft should be broken into multiple meshes to each have its own texture based on its size?


Is there a rule? Like if you are using 4096 size textures. Obviously a bicycle could be a single mesh with 1 texture.


But what about a small sports car? An SUV? A dumptruck?



Answer



Think about the texel density you want: how many unique texels of texture per meter of surface?


You can work out a minimum texel density by taking a typical view of your object in your game, and measuring its pixel size on your target display, divided by the in-world size of the (part of the) object you're looking at.


Multiply that density by the total size of the object to get a ballpark of how many texels you need to texture the whole thing uniquely at that density.



If you have areas that can re-use the same parts of the texture, you can exclude them from the calculation.


Now that you have a rough idea of how many texels you need, check whether it fits into a common texture size like 2048 or 4096. If you need larger than that, you'll likely want to break it up into multiple textures (or multiple entries in an array texture), since some devices don't support larger textures.


If the number of textures looks too high for your application, then you can look into alternatives to uniquely texturing your whole object at that texel density, like layering in fine detail or tiling detail maps over lower-res textures for the broader strokes.


No comments:

Post a Comment

Simple past, Present perfect Past perfect

Can you tell me which form of the following sentences is the correct one please? Imagine two friends discussing the gym... I was in a good s...