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?
Really Big Textures?
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
-------->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
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.
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.
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?
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.
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?
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?
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.
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.
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.
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.
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
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
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
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
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement