Texture size

Started by
9 comments, last by Artes 12 years, 10 months ago
What should be the size of the texture to have the best quality for the face of the cube with vertices

{1.0f,-1.0f,5.0f, 0.0f, 1.0f},
{3.0f,-1.0f,5.0f, 1.0f, 1.0f },
{1.0f, 1.0f,5.0f, 0.0f, 0.0f, },
{3.0f, 1.0f,5.0f, 1.0f, 0.0f },
Advertisement
4096x4096

It depends on how close you need to be, and what's on that cube. If youre 100 units away, it doesn't matter if its 32x32 or 1024x1024. I'm not sure I understand your question.
The quality of a texture does not depend on the values of the vertices, but the size when projected on the screen.

Best quality is (arguably) achieved at exact aligned one-to-one mapping between screen pixels and texture pixels. Then you have exact control of what the final sampled texture colors are, and the quality is exactly that of the original texture. Misaligned texel/pixels samples, or upscaled/downscaled sampling, arguably results in lower (or at best, equal) quality than the original texture.
Thanks, i have another question, how can i multiply texture on one face? (I have small texture and i don't want to scale it)

(Direct3D/X)
Just increase your texture coordinates to how many times you want to repeat the texture. Just make sure the texture is set to repeat and not to clamp the coordinates to the edge of the texture.

Just make sure the texture is set to repeat and not to clamp the coordinates to the edge of the texture.


How to do that?
Seems like SetSamplerState defines how textures are sampled. The D3DSAMP_ADDRESS looks relevant.
How much does texture size affect the speed of the program? I guess you'll say that a lot of big textures will make the rendering take longer time. Though I just wonder how much I should think about this. I mean, if I'm to render about 200 textures, does it matter significantly if they are 512*512 or 1024*1024? Is this something to worry about or should I just not care until a problem of lag arises?

Also I wonder if in OpenGl it is a very good idea to put the textures in a display list, or if it is not necessary.


How much does texture size affect the speed of the program? I guess you'll say that a lot of big textures will make the rendering take longer time. Though I just wonder how much I should think about this. I mean, if I'm to render about 200 textures, does it matter significantly if they are 512*512 or 1024*1024? Is this something to worry about or should I just not care until a problem of lag arises?

Also I wonder if in OpenGl it is a very good idea to put the textures in a display list, or if it is not necessary.




It's more an issue of memory bandwidth and memory use I suppose, interacting with graphics memory is not exactly the fastest operation possible, but on modern hardware this shouldn't raise too many issues
Just don't go and make 4096x4096 textures for small and meaningless objects in your scene for example, be sure to use common sense about the quality of the components in your scene vs how important those components actually are

I gets all your texture budgets!

I mean, if I'm to render about 200 textures, does it matter significantly if they are 512*512 or 1024*1024? [/quote]
It probably does matter, depending on the graphics card. Binding to lots of different textures per frame, particularly large ones, can incur memory cache-miss penalties. However this depends on a number of factors, such as:

* Whether the texture uses mipmaps;
* What mip level the texture is being rendered at;
* The use of texture compression;
* Whether you are multi-texturing;
* Portion of the texture mapped on the geometry;
* Size of the textured primitive rendered on the screen;

...and so on.

Don't stress too much about it. I say code away. Just keep profiling time to time, and minimise texture state changes as much as you can, but not at the expense of code maintainability.
Latest project: Sideways Racing on the iPad

This topic is closed to new replies.

Advertisement