Jump to content
Sign in to follow this  
FishMan

[3D/2D] Setting up your Texel Density

Recommended Posts

Hello.

In this tutorial I would like to talk about texel density. 
If you will work some time in the commercial gaming companies, you will definitely meet this concept in their documentation.
And this is no accident, because it is really important aspect of asset production.
So what is texel density and why it so important?


What is texel density?

Before answering this question first of all it is necessary to define what is a texel...

 

From wikipedia:

Quote

A texel, texture element, or texture pixel is the fundamental unit of a texture map, used in computer graphics. Textures are represented by arrays of texels representing the texture space, just as other images are represented by arrays of pixels.

Texel simple language - it is a pixel of the texture. Even if these concepts are similar, but not identical, you can perceive texel the same as the pixel. And a texel density is the number of texels per unit of the squre virtual (game) space.

 

Why texel density is important?

It's simple. The higher a texel density, the more detailed the texture on the screen.

And the opposite: the less texture density, the more blurred the texture will be on the screen.

 

But that's not all...

Game scenes are usually composed of a plurality of objects. And because the games do teams consisting of several people, and because it is difficult to determine the size of your texture relative to other objects this may lead to the fact that each object in the scene will have varying degrees of detail. Here is an example from Internet:

texelexample011.jpg

As you can see on this picture walls and barrels are more crisp while the texture on the floor is very blurry.

 

That is why it is important that the texel density of the textures should be standardized at least for an environment assets.

 

But above all, it should be said that the texel density is not a mandatory rule. It can vary depending on your needs and possibilities, well at least if you know what you're doing.

You can vary texel density inside a single object to distribute texture space proportional to the number of details that you want to show.

For example if you doing the vehicle, you can double texel dencity on parts with high dencity of details like steel hawser, or for parts which player will be able to see very close (for example parts of the cabin) and you can decrese texel density for parts which is gonna be hard to reach for the player (such as the bottom) to save some texture space.

 

Here some examples:

FmpjpBXAanUgZpHj71oiJgJ5IXNG5wqWSs55iRdI

 

4G4gsGMbVg8u2AIwKfXTR5gO1reloPhK-PYNfzWx

 

And here what you gonna get if you if you do not pay enough attention to this issue:

TV31EhneRweRWb2B7bDJspKsamKyZgyg3kG8Nzp0

 

Should we use any software for this?

 

I have met a couple of ways on the internet about how to calculate it manually. 

But I will not bring this methods here, because it's hard to imagine a person who will do it manually every time.

 

Generally every game company (at least with whom I have worked) has its own piece of software (usually a script) that is measuring the texure density of UV shells that you are selecting.

But we are not game company and we need some free solutions for that. And we have some of them for different programs (3ds max, Maya etc.) in the Internet and they are free.

 

I will discuss about one solution for 3ds max (becasue it's harder to find).

It's called Advanced UV Normaliser. The problem is that from version 2.0 it's not free.

I also heard that TexTools can somehow adjust texel density but I've never tried because I don't like TexTools.

 

Anyway. I've got an old version of Advanced UV Normaliser which you can download here.

And here is an official site where you can buy lastest version of this script in case you need it.

 

How to run this script?

You can drag & drop it in max viewport. Or u can select it via Scripts>Run Script.

 

What's next?

First of all you must decide what value you will be using. And the problem is that it depends on your project.

But in today's games (at least in those that I work) I have seen the values of 400-512 pixel per meter (p/m) on average.

And if we talk about Unreal, in case of 512 p/m we have to use 2048x2048 texture for square 4x4 meters. That sounds reasonable if you ask me. Because in Unreal one floor is usually 3-4 meters height (link).

 

This mean that I suggest you to use for average texel rate any number between 400 and 512 (Not less than 400 and not higher than 512).

However it's you should decide, I did not insist.

 

Next you should set up your units (Unreal using centimeters). Here is a tutorial about how to set up centimeters in Max. Pay attention that you can leave "Generic Units" in "Units Setup" tab and only change system units to centimeters (And I suggest you to do that, because max works more handy in this case).

 

So how do we set texel density for crist sake?

 

Fist of all you should add Unwrap UVW modifier to your model and launch Advanced UV Normaliser.

Next you select any UV Shell for that you want to measure.

After that In Advanced UV Normaliser interface you select Custom (1.) and set a texture dimentions that you would like to use (2.) and then you press Get Texel Density, after that you will see the result in the Ratio Geom/Pixel section (4.) In our case its 4.1819 pixels per centimeter (400 p/m).

cO1LweGri6CDuSBmkhhePY20NBsFFMvnu2gFC_k4

 

If you don't like the number that you get, you can rescale your UV Shells or change texture dimentions untill you get something that you like.

 

And this is basically how you set up texel density.

 

Thats all, thanks for your attention.

 

Any questions?

 

Usefull links:

Maya: Texel Density (TD) tutorial

Texel Density for game art

UE4 - Texel Density

Share this post


Link to post
Share on other sites

n1 FishMan, very interesting.

 

I use Lightwave3D to build models and map the UV's. Once i've created the UVmap i can then go in and move things around and even re-size the mapped polly's within the UV space.

Would that amount to roughly the same thing? (if not actually calculated?)

Share this post


Link to post
Share on other sites

Um... Didn't get it...

Can you explain in detail what you mean?..

 

Quote

Once i've created the UVmap i can then go in and move things around and even re-size the mapped polly's within the UV space.

If you changing scale of the mesh, or scaling UV's, or adjusting the scale (or proportion) of your texture sheet you should of cource keep in mind that texel density has changed as well. As I said TD - is how many pixels on square centimeter on the surface of your model. When you change the scale of your model the world around and player (what is more important) remain the same. This mean if you made the model to be bigger, then you should do TD more dense. And the opposite: smaller model = should be less TD. This this is true only in case if you are need average TD. And when I said average I mean TD that used as a standard on your project (e.g. 512 pixels/meter). Of cource you can't change UVs and texures every time when you changing scale of some model (well at least by hand) but for average scale you should use an average density, so your enviroment has the same amount of details on every surface.

 

maya-Checker-Size-Tool.jpg

Edited by FishMan

Share this post


Link to post
Share on other sites

Hi FishMan,

 

what i meant was:

1. i build a model

2. create the UV of the model

3. have the UV in 2d viewport next to the model in a 3d viewport (split-screen)

4. i can now adjust the pollys in the UV space and see the pollys on the model in the 3d viewport

this allows me to "fit" the UV pollys into the UV space better, by scaling and moving them around.

this also allows me to rotate pollys to allign them with a texture.

 

basically what you are doing with the unwrapper, but inside Lightwave itself.

what it does not do is allow direct control of the Actual Dimensions of the UV pollys (that i know of) so its all done by-eye. so i can set things out Propotionally which i think generally works ok.

however, i am just starting to learn how to manipulate the UV's, mainly because i am getting wildly different scaling when applying materials/textures to my models in UE4.

part of the issue stems from Lightwave, like most porgrams, not being able to work in Centimeters, as it works to the ISO/METRIC standard of the Meter and i work at the Millimeter level using a 100mm snap as standard (although LW has an acuracy down to 5um). this scale issue means i have to "Size" up my models by 10,000% to achieve CM resolution for UE4. so i Size-up and then create the UV's, so i dont get any errors in UE4 from scaled UV's. after that i can adjust them so small, less visible bits can be shrunk (less res./lessTD) and larger or more visible/important bits can be scaled up (more res./higherTD) - just not accurately calculated, as you do.

 

having to do similar with the LightMapUV part of UE4: having to manually adjust the UV's in LW to allow much more space between pollys, for the UV1(lightmap ref.) channel. thinking of having a UV2 just for the textures and leaving the UV1's purely for reference for UE4 to build the LightmapUV's from, that way i can have a really dense Texture UV and a spaced, low res Lighting UV with no leaking lighting.

 

ill post a screenie when i get the chance ;)

 

 

.LJ

 

 

 

Share this post


Link to post
Share on other sites
9 hours ago, LaughingJack said:

part of the issue stems from Lightwave, like most porgrams, not being able to work in Centimeters, as it works to the ISO/METRIC standard of the Meter and i work at the Millimeter level using a 100mm snap as standard (although LW has an acuracy down to 5um). this scale issue means i have to "Size" up my models by 10,000% to achieve CM resolution for UE4. so i Size-up and then create the UV's, so i dont get any errors in UE4 from scaled UV's. after that i can adjust them so small, less visible bits can be shrunk (less res./lessTD) and larger or more visible/important bits can be scaled up (more res./higherTD) - just not accurately calculated, as you do.

Jesus Christ. xD 

 

Still didn't get, what is the question?

 

I'm not sure that we talking about the same things. As far as I understand you - you talking about making UVs overall, I was talking only about "Texel Density" stuff, it's not the same as scaling, rotating and etc. You are using scaling, rotating and whatever to reach good density, and this is not the same as making good UVs. Because good UV's still can have bad texel density, because TD (at least in this context) is an absolute value and this is important between several objects, not just inside a single object. And yes, you can do it by eye, using checker for example. I just talked about how to do it precise, so you can know how many pixels inside this particular UV shell.

Edited by FishMan

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  

×