Sign in to follow this  
Tree Penguin

512x512 or 4x256x256?

Recommended Posts

Hi, what do you reccommend using, a large texture of 512 by 512 pixels, or dividing it in portions (only one of the 4 parts of the texture is displayed on a triangle) of 256 by 256 pixels? I'd like to know the speed difference between these cases: One VBO, VA or immeadiate mode primitive with a 512x512 pixel texture. OR Multiple VBOs VAs or glBegins/glEnds (4 or more) using mutiple but smaller textures. Would it make a difference at all? Thanks.

Share this post


Link to post
Share on other sites
Well, it depends entirely. What are you trying to do. Could you outline it a little for us?

Actually, I don't think there is much performance to gain in such "nitpicking." But I can tell you this: binding textures is regarded as an expensive operation in OpenGL, and should probably not be done more often than can be helped. Thus, I assume it is best to go for four textures saved in a 512x512 texture. Then you'll have to just modify the texture coordinates accordingly.

Your question about VBOs / Vertex arrays also depends on your implementation. Swapping vertex buffers is also not good to do more times than necessary.

These things might be negligble, though, and probably not have a noticeable impact on performance.

Share this post


Link to post
Share on other sites
Quote:
Original post by James Trotter
Thus, I assume it is best to go for four textures saved in a 512x512 texture.


I think he was talking about splitting a standard 512x512 texture into 4 256x256 ones, just for the hell of it.

The only time I've heard of this being done, is in (the original I think) Unreal, because only a few cards supported textures above 256x256 then.

Share this post


Link to post
Share on other sites
First case:
Lets say you are drawing a heightmap of 512x512 vertices using 4 parts of 256x256 vertices (because of culling alogrithms or whatever). The original texture is 512x512 but the parts only visualize 256x256 texels. So would it be faster to make a texture for each part, or just use the big one.

Second case:
You are drawing a heightmap containing 4 parts which each have their individual textures. Would it be faster to combine these textures into one larger texture and draw all the geometry at once instead of 4 steps?

According to what James Trotter said i guess the larger texture would be faster.

I don't know if it's nitpicking or not, i just wondered if large textures are slower even if the amount of texels drawn are the same.

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