Sign in to follow this  
mrWodoo

Texture size

Recommended Posts

mrWodoo    100
What should be the size of the texture to have the best quality for the face of the cube with vertices

[code] {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 },
[/code]

Share this post


Link to post
Share on other sites
braincell    115
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.

Share this post


Link to post
Share on other sites
Brother Bob    10344
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.

Share this post


Link to post
Share on other sites
mrWodoo    100
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)

Share this post


Link to post
Share on other sites
Brother Bob    10344
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.

Share this post


Link to post
Share on other sites
mrWodoo    100
[quote name='Brother Bob' timestamp='1306849925' post='4817872']
Just make sure the texture is set to repeat and not to clamp the coordinates to the edge of the texture.
[/quote]

How to do that?

Share this post


Link to post
Share on other sites
Artes    102
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.

Share this post


Link to post
Share on other sites
Radikalizm    4807
[quote name='artes' timestamp='1307285686' post='4819758']
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.


[/quote]

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

Share this post


Link to post
Share on other sites
Tachikoma    575
[quote]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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this