Jump to content
  • Advertisement
Sign in to follow this  
jeff8j

OpenGL Really Big Textures?

This topic is 2180 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I have some advanced models one in particular has a 14mb png texture which opengl does not like but being the only thing showing can handle the model just fine and I think can handle it with textures just not 1 big one.

I am far from a 3d modeler so have no clue about the best way to do this but I would assume there is a way to break the giant texture into smaller gpu friendly textures how can I do this? I use blender for tinkering although im up for anything.

Also is there a library that can do this on the fly?

Share this post


Link to post
Share on other sites
Advertisement
simple downsampling is not suitable? breaking texture into multiple pieces can be hard depending on how UV are mapped to the model. If you have only a terrain that's fine and simple, more complex models will make things harder if not impossible. You can split the texture into 4 textures and remap UV to 1 to 4 different sets of UVs. That will need a shader and 4 textures used at the same time. So input of the vertex is always a UV set (you don't need to change UV). But instead of using 1 texture unit you use 4 textures units (each one with 1/4 of the original image)

-------->U
0......0.5....1
. ...............
0.5...0.5....1
................
1......1.......1
V

When UV is in the first quad you scale it by 2 and use first texture newU= 2*U; newV=V*2;
when UV is in the second quad newU = U*2 -1; newV = V*2;
When UV is in the third quad newU=U*2; newV = V*2-1;
When UV is in the fourth quad newU=U*2-1; newV = V*2-1;

quads assumed in this order

1 2
3 4

Share this post


Link to post
Share on other sites
Hi DemonRad

Downsampling will work but im looking to get really good detail out of the object and downsampling to something like 1024x1024 will quickly deteriorate quality as its a big model. I do think that I will give it a try though just too see.

Hmm I dont think breaking it down manually is an option as its a mesh/model not something easier like terrain and its lots triangles so far out of my knowledge.

Theres no way something like blender or 3d studio max can take a max texture size and then break it up accordingly? It makes no difference how its broken up to me I just want to show it and fly through the model I dont need animation or anything.

Share this post


Link to post
Share on other sites
I have some advanced models one in particular has a 14mb png texture which opengl does not like but being the only thing showing can handle the model just fine and I think can handle it with textures just not 1 big one.[/quote]
What is the texture size? What does opengl does not like it mean? Are you using DXT compression?

Share this post


Link to post
Share on other sites
Hi jeff8j, do try to be as specific as possible about errors. The nature of the error affects what solutions people will offer. Is there a code error? The object appears black? The texture looks distorted? If there is a visual artefact, a screenshot of how it looks in your game vs in the modelling program may help.

Share this post


Link to post
Share on other sites
The texture is 12,000 by 12,000 right now and not using dxt just a raw rgba texture.

At the moment I broke everything I was trying to change from the old fixed pipeline to using shaders and made a horrible mess.

Does anyone have a drop in class for assimp with devil and opengl?

Share this post


Link to post
Share on other sites
You have a texture that is 12000x12000? ..........sigh

Kill whoever built it. max texture size is 8192x8192 unless it got bumped up even more that I dont know of. But that doesnt matter, no texture for an object needs to be that big.

Downsampling will work but im looking to get really good detail out of the object[/quote]
I've seen plenty of detail out of 2048 textures, most of the time not needed 4096 textures. I would post a pic because that doesnt make any sense. Unless you plan to in game hold a microscope and zoom it in 10x.

If for say a gigantic spaceship, then this should have been built with multiple uv textures/uv coordinate sets. So each section would be a separate model/texture. If you need tiny detail, multiply a tiled black and white detail map and blend that with the other lower res textures. Or do the same: tile a detail normal map over the object.

Share this post


Link to post
Share on other sites
Lol I would be surprised if my card could even do 8192x8192.

Ill post a pic as soon as I get it going again.

Its only used for specific scenes that will pan across the outside of the ship where the game itself takes place inside so no performance concern because at max were talking the ship and a few other smaller things in the scene at once. Im for the sections was hoping for an easy way to achieve them with software rather than me messing with the model.

Share this post


Link to post
Share on other sites
Chop your image up into square sections that are 2048x2048 with the end sections only carrying whatever is left.
Take the uv coords 0 to 1, and mutliply them by 12,000. Then convert them to 0 to 1 for each section. Do some math and convert pixel coordinate x = 2048, y = 2048 = 1,1 for tile 0,0. x= (2048 + 1024), y = (2048 + 512) = .5,.25 for the texture tile 1,1

Share this post


Link to post
Share on other sites
8192x8192 is REALLY large. Even modern games don't typically exceed 2048x2048, and most get by on MUCH less (shadowmaps, for instance, are often 512x512). I have seen demos (e.g. NVIDIA's human head) that produce very very high quality results with 4096x4096, and that had a lot of sampling.

The only excuse I can think of for a texture that large is raw medical or scientific survey measurements. And even that should be reduced before going on a screen. You don't have 12000x12000 pixels on a monitor, so it's just plain pointless to have that much data.

-G

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!