Game Development Community

Performance issue based on UVW mapping method?

by David Bedford · in Artist Corner · 05/17/2009 (1:43 pm) · 11 replies

Let's say I'm UVW mapping a tree. I was wondering whether how I UVW map it will affect my performance, here's some images of different ways of mapping a 6 sided cylinder, is one of these optimal for performance?

Here it's mapped with no faces overlapping and they all fit nice.
www.egmods.com/proj/performance/1t.jpg

Here the end bits and sides are overlapping and made as large as possible.
www.egmods.com/proj/performance/2t.jpg

And here the end bits and sides are overlapping, but then scaled way up where they texture looks like it would need to be tiled 9 times to make it work.
www.egmods.com/proj/performance/3uvw.jpg

In fact if you have bits beyond the blue box the texture will tile and it will appear to work fine.

Just wondering whether that last one would be an issue or not because it certainly looks nicer, but I haven't been able to find anything regarding performance issues depending upon how an object is UVW mapped.

Thanks a bunch in advance.

#1
05/17/2009 (2:48 pm)
Thats an interesting question.

I have never actually tested UV mapping methods to see if it effects performance. Logically i would think it do not matter. So, i opened an .DAE collada file to find out more. It seems texture mapping is done much like the poly list what make up the mesh shape. It is a set of numbers like "0 0 144 4 1 145 5 2 146" what is most probable 3 sets of X,Y,Z locations. That do not mean to imply the hardware views the data in the same way, but it is likely that it also only needs to know the texture coordinates.

So I can not see how UV mapping methods would effect performance.
#2
05/17/2009 (7:37 pm)
It is theoreticly possible from what I have been told to have UVWs affect performance slightly, but from what I can recall this had more to do with how many vertex indexes you had in the UVW data. Basicly think of the difference between a t-strip fanning of adjacent faces versus having each face explicietly mapped out to its own set of unique UVW coordinates.

In the above examples provided example 1 would be slightly more optimal than example 2 because of the fanning of the side faces. But since you are talking about a simple model you aren't likely going to see much of a difference.
#3
05/29/2009 (11:08 am)
Performance, when it comes to UV maps, is generally only considered by its efficiency. In other words, are you wasting pixels in your map. A good UV takes advantage of every pixel you can. This is more important than the unnoticeable and probably non existent performance effect.

Especially because you can use smaller texture map sizes if you pack it better because your going to get a better pixel to poly ratio. In other words, don't worry about the improbable effect on performance. Worry more about the look of your texture on your model and the efficiency of your UV's. They are much more important.
#4
05/29/2009 (2:47 pm)
In my third example with the mapping way outside the blue box, the texture will tile in game to make sure the whole model is covered. Is that an issue? Is more memory or processing power being taken up by displaying the texture multiple times, or is the effect negligible?
#5
05/29/2009 (3:08 pm)
If it looks good, it's better. You will get more pixels out of the repeated map, which would allow you to have a smaller texture. a 256x256 takes up a lot less memory than a 512x512. And this won't effect performance. The key is making something like that look good on a model. An experienced UVer will pick up tricks like repeating certain parts of a model horizontally and not repeating some parts within the map.

For instance: a street light pole. With this object, the pole is very long and the light part is very small in comparison. When UVing this object, it might be a good idea to make the UVed pole repeat vertically a few times, but horizontally only taking up a portion of the map. Then using the other portion of the map for a non repeated UV of the actual light part of the model...

So yes repeatable UV's are good, use them where you can to save the texture memory space and use smaller texture maps...
#6
05/29/2009 (10:26 pm)
Quote:
Is more memory or processing power being taken up by displaying the texture multiple times, or is the effect negligible?

There is no memory impact at all in this particular scenario, assuming the same texture size across all, but there is a tiny GPU hit when doing some filtering across a tiled seam. How much depends on the GPU/driver implementation, but it would be very, very rare for it to be enough to actually affect your performance in any perceivable way. It's definitely not something you want to worry about, at least not until you know that you're GPU-cycle limited and you've exhausted all other higher-level optimizations.
#7
06/03/2009 (9:21 am)
So if David's second example is acceptable, what about a more complex model? Could I use a multi/sub material, apply a UVW Unwrap to the model, then select the faces and edit the UVWs via the Gizmos or would this be a bad thing? So let's say I have a support girder in my model with a Material ID. Could I select the faces then apply the box or planer map to edit the UVWs?
#8
06/03/2009 (6:54 pm)
You can use multi subobject materials and edit UV's however you want. I will suggest that you collapse your modifier stack before export.

*Remember!!!>> Torque only has 1 uv channel.

// About 'materials per model'..generally speaking:
I remember reading that if a mesh within a model has multiple textures applied to it that the specific mesh will be rendered/re-drawn 1 time per texture that is applied. Hence, using multiple texture maps on a single mesh model wouldn't be ideal. If you have multiple textures on a model, you should think about separating those meshes respectively.
*Then again, that could have been changed since I read that a year ago, so let's wait for a confirmation -or- an "EB'S WRONG!!!".
#9
06/03/2009 (11:29 pm)
I all ways collapse the stacks before export. I can't trust the DTS exporter....

I made a quick model with what ever texture I had in my random textures folder to show how I work with UV Mapping. I'm wondering if is this is an ok way of texturing. I never had any format classes that touched this subject. Basically, for walls and the like, I'll apply a UVW Unwrap and use the plane to edit, move and scale the UVWs. Image is a link...

dementedstudio.com/archive/UVWorking_Thm.jpg
#10
06/04/2009 (1:37 am)
ah, the Extreeeeeme of UVmapping in max!!!! There has been a few discussions on this topic in these forums! Nothing worth reading, just uninformed bashing really.

Anyways, when you use any of max's uv modifiers, they are essentially giving you an easy way to change the uv coordinates as you know. So you can't do it wrong per say, with the torque exporting, *as long as you're collapsing. I am sure you are doing fine. However, I must chat with you about materialID's and using subobject materials. I find that they actually waste time as they require mouse movement and clicking in the modifier panel and setting the faces id#, then mapping it. I avoid the modifier panel as much as possible as it wastes my time scrolling and clicking.
Anyways, the point here is, it is easier for me to select polys and drop images onto them, repeat. UVW-unwrap the emesh/epoly or select polys and uvmap. (this is for game models creation only..nothing where I need Mental Ray for example)

In the end it is whatever works best for you..however, I just hate wasting time on not needed steps..everyone always thinks their way is the best and I am sure someone else has a better approach than mine.
However, when you're using the style of an arch-cad student...you get lost in hours of monotonous clicking.


All I am saying is...work smarter, not harder. ;)
#11
06/04/2009 (7:35 am)
Quote:Anyways, the point here is, it is easier for me to select polys and drop images onto them, repeat. UVW-unwrap the emesh/epoly or select polys and uvmap.

That would be faster. I'll have to try that. I've just become accustom to the Multi/Sub-Object and Material IDs. Reason being, I used to make Halo CE maps and this is how they have it set up.