Hard Light Productions Forums
Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: Odyssey on October 31, 2003, 11:15:40 am
-
It is my understanding that HT&L doesn't like large numbers of texture maps, as used by many standard FS2 ships.
It's a fairly simple process to bake all those textures together in lightwave, and as far as I know, nobody has done it yet.
So, would it be a good idea for me to go ahead and start making all FS2 ships into 1 (or 2+) 1024x1024 maps?
-
Go right ahead. It would probably help us out later.:)
-
Right-o. One thing though - other people would need to test them as I turned them out, since my video card can only manage 256x256 textures ^_^
-
what is "HT&L" ?
Raven Shield quotes it in the minimum specs, but I don't know what it is !
-
I'm not quite sure what the rules are for HT&L textures , the downside with 'Baking' textures is that I think it will include any shading on the Ship, which may look a bit odd when the 'shaded' side faces a star or the like,
I know Bobb posted something about a limit to the number of textures, but I think that is only supported by HT&L, so any further textures will be done software.
Maybe one of the SCP guys can clear this up a bit?
Flipside :D
Also, I can't see baking working for tile textures :(
-
AFIAK there is no maximum number of textures per object. Either that, or it's something fairly unreachable, like 64 or something.
HOWEVER, and this is a big however, the smaller number of textures per object, the better. If each ship only had one or two different textures, you would definately see a substantial performance increase.
Hardware TnL affords a performance increase mostly due to the way things are sent to the GPU. Basically this means that we do this (in pseudo code):
For each model:
Find all vertices with texture A
Group those together
Prepare them with the CPU
Send them to the GPU
Find all vertices with texture B
etc...
Now, out of those steps, the most time consuming and expensive is to prepare them with the CPU. Once we send them to the GPU, it does it's job very quickly. Therefore, we want to make the number of times preparing the batches as small as possible, and the only way to do this is to use less textures. Then we can send tons and tons of vertices to the GPU and let it chew on those for a while while we do other stuff.
The above explanation is not purely accurate, but in this case suffices.
The pratical upshot is that any recent graphics engine is limited in performance by the number of textures that it uses, because changing textures is expensive and inefficient for a number of reasons. The more vertices that can be sent to a card at a given time, the better.
-
Hmmmm... Well, in Freespace, nearly all of the fighters and all (I think) of the Capships use only one non-tiled texture, the rest are tiled, and baking an 8*8 grid of 256 x 256 textures into a single texture would actually lose resolution in game, so I'm not sure really what can be done :(
Also, wouldn't all the ships have to be rebuilt or edited in PCS with the correct texture references in place?
Flipside :D
-
I think baking into a few 1024x1024 textures would help immensly, even if it means a bit of a resolution drop.
-
I've never used baking on Lightwave, I'm going to try and find out a bit more about it, I hope I'm wrong, I really do, because anything that speeds up Freespace is obviously good, but I have a feeling there may be problems though...
1) Converting tiled textures will only increase the resolution of the one texture being tiled, and possibly decrease the quality. So it would take more Texture memory for less result.
2) All the POF files would have to be edited to make the references to textures point to the right files, the result may be worth the effort though.
If this does work out, remember to do them as 24Bit images now we have support ;)
Flipside :D
-
I don't quite see how I would do them as 24bit images when all I'm doing is combining originals ^_^
Resolution would not necessarily be lost, as I can simply chop up the UV map into, say four 1024x1024 blocks. I don't see the problem with converting tiled textures - I tried the whole baking process on a hippocrates just now, and it looked the same to me.
As for POF files being edited, well of course. My stage plan for each model thus far will be this:
- Get it into lightwave
- Bake the most detailed LOD of said model, chopping into what I feel are the necessary texture blocks to maintain resolution.
- Use lithunwrap to then convert that LOD into truespace format.
- Take the original converted model in truespace, delete said LOD, and replace it with new one.
- Use PCS to convert back to .pof, importing all other pof data from old model.
- Give it to someone with a better video card to test it looks the same.
If anyone sees any problem with that process, then feel free to pick it apart.
EDIT: Forgot subsidiary point:
- Get a new video card so I can actually see what I'm doing
EDIT2: Shading is not an issue when baking the model. I just turn off all the lights and set ambient light intensity to 100%. Or just tell the baker plugin not to care about lighting. Either way it does the job.
-
Alright, maybe talking out of my arse again here but will PCS let you do a global data import if you've been fiddling with the model i.e changing the texture names? I just added an additional text to a model and PCS crashed upon a global import. I assumed that this is becuase of the difference in the texture names... course if it isn't then I'd like to know what the problem is :)
-
I guess I'll have to find out. Not sure. If it doesn't, I've got loads of screens I can throw at it, so I'll just have PCS open on one computer with the old stuff, then copy it across to PCS on this computer manually. I've got 3 days coming up in which I have absolutely nothing to do, so I can handle it.
-
mmm I'm not sure too what speed gains you can obtain.. I mean, a tiled texture, a texture repeated many times, works only if it is alone, you can't unwrap and use repetitions at the same time (or you can but only in special cases).
Therefore, you will have to multiply a texture (a 256x 256 repeated 16 times generate a 1024x1024, if you don't want to loose quality) to match the original repetitions, and I'm not sure that the HT&L gains will match the huge overall texture's resolution increase
probably a mixed strategy, baking textures only when there are few repetions, could be the best one, and also use some good unwrapping strategies: for example, if a tiled texture is repeated only vertical or horizontally, but not in both directions, you can use some repetitions althought unwrapping
-
I think it ought to handle it okay. Even if there isn't that much of an overall increase, then at least it'd be one hell of a lot easier to modify ships to include logos, etc.
-
How do video cards render tiling textures anyway? Presumably they still have to place them and wrap them around polygons, so it can't exactly be a super-fast process...
-
Well, I think they are wrapped around the polygon as any other UV map, and then the engine uses a texture repeating function, I think it's a basic DirectX Facility. I may well be completely wrong, mind, so best to wait till someone who knows what they are talking about comes along ;)
Oh yes, one other little question, even with 3 days, what kind of super mega whopper processor have you got that could bake all the textures?? LOL I've been baking a Deimos for 45 mins now and it's not even moderately brown :(
Either way, good luck with the project, if I get the hang of this, I'll see if I can lend a hand in any way :)
Flipside :D
-
Er... K, obviously I have no idea what you lot are going on about with this whole baking thing (I'm hoping there's Shivan pie involved), but would it be possible to 'bake' all the non-tiled parts in to one map, leave the tiles as they currently are and then combine the whole lot?
Even if this approach would work, I see little point since the Deimos, for example, consists almost entrely of tiled textures. But then I assume you lot know more about this jiggery pokery than me :nod:
-
Originally posted by Flipside
Oh yes, one other little question, even with 3 days, what kind of super mega whopper processor have you got that could bake all the textures?? LOL I've been baking a Deimos for 45 mins now and it's not even moderately brown :(
A giant galactic super-oven. I bought it from a charity shop. It says on the label that it can bake anything up to a sathanas 'in 20 minutes'.
Pretty cool huh.
And DG, 'baking' is just basically taking the model and using a tool to render out the model into one flat image. If anything's tiled, you'll just see lots of it on the baked version. If I could find the baked texture for the hippocrates, I'd show it to you.
You can't really leave one bit tiled and one not. And I'm guessing that the only disadvantage to using one big texture is that it takes up more filesize - the video card still has to render the same amount of pixels, tiled or not. Something like that, anyway.
-
Hmmm... Got that Deimos thingy finished...I'll have to look up how to apply your freshly baked image back into the original model :)
Flipside :D
-
Originally posted by diamondgeezer
would it be possible to 'bake' all the non-tiled parts in to one map, leave the tiles as they currently are and then combine the whole lot?
this has been already done by :v::)
-
don't do this, it's a waste of time, the only ships that have more than one texture per subobject are capships and if you alter them to have all there textures on one map, it will look very very bad even if you use 4096^2 textures. there will be not be that big a boost in performence, in fact it's best that capships uses about three or four textures given that they have a generaly higher poly count
-
Originally posted by magatsu1
what is "HT&L" ?
Raven Shield quotes it in the minimum specs, but I don't know what it is !
Hardware Transformation & Lighting.
[q]From http://www.xbitlabs.com/articles/video/display/savage2k.html:
The process of generating a 3D scene from the supplied data (a 3D "world") is carried out by twofunctional units. The first functional unit is a "geometry engine", which transforms the 3Dcoordinates of the world into 2D coordinates for the monitor. This has to be done because themonitor on which the 3D world is to be viewed is a 2D device, which cannot directly accept 3Dcoordinates. The second functional unit is a "rasterization engine" which performs the task ofdrawing now the 2D world onto the screen. In addition to transforming 3D coordinates into 2Dcoordinates, the geometry engine can be used to generate lighting information for the world -storing information about light sources and calculating the amount of light each source castson any given point in the world.[/q]
-
odissey, if you want I have some of models for the Star wars conversion that may need this kind of work..
-
Originally posted by Flipside
Hmmm... Got that Deimos thingy finished...I'll have to look up how to apply your freshly baked image back into the original model :)
Flipside :D
Well, I'll just answer that straight off. In LightWave Modeller, create a UV Atlas map for the whole model, then use the Baker plugin to render the model onto that UV map. Assign one surface to the whole model. Then enter LW Layout, and apply the baked texture to the model using the UV Atlas map you created. Voila. That's how you go about it in Lightwave, anyway...
Bobboau, okay. I'll restrain myself ^_^
And KARMA, sure, discuss it in PM.
-
Originally posted by Odyssey
Well, I'll just answer that straight off. In LightWave Modeller, create a UV Atlas map for the whole model, then use the Baker plugin to render the model onto that UV map. Assign one surface to the whole model. Then enter LW Layout, and apply the baked texture to the model using the UV Atlas map you created. Voila. That's how you go about it in Lightwave, anyway...
Bobboau, okay. I'll restrain myself ^_^
And KARMA, sure, discuss it in PM.
Wonders if I can use this to make a poor mans LithUnwrap :)
-
you want to use a $3000 peice of software as a poor man's version of a freeware title? :wtf:
-
Lightwave can handle UV maps better than Lith anyway, using either Lith's method or any number of other ways... In other words, karajorma, could you explain? :)
-
Basically I already have Lightwave and I need to learn to UV map ships. I'm just asking if I can forget about Lith and just do everything I need to do with the bake option.
Bob : I said poor man's cause it sounded like the results wouldn't be as good as Lithunwrap's but it sounded far easier to learn how to do.
-
Does this strike anyone else as being pointless, or is it just me? After all, it's not like the stock FS2 ships are 20k poly 50 texture monsters or anything.
-
I imagine that the re-detailing of the FS2 models will come in due time. It'd be a massive improvement that anyone with the original game could instantly take advantage of by downloading.
-
Originally posted by KARMA
odissey, if you want I have some of models for the Star wars conversion that may need this kind of work..
Hey... Hey yeah! That Y-Wing might be playable sooner than expected :D