Home Unreal Engine

Texel density "standards" in UE4 ?

polycounter lvl 13
Offline / Send Message
< ASH > polycounter lvl 13
Hey guys,

I was researching about texel density for a personal project in UE4 and I though that might be interesting and useful to open a discussion about it here and share the information I gathered so far.
Hopefully through the discussion we can create a sort of reference thread/wiki page about this topic here on Polycount.

In the last two days I did a lot of research about the pixel and texel density and I bumped into several interesting forum threads, articles, tutorials and videos that can help about the topic. I list them below: please bear in mind that several resources were meant for UDK/UE3 and so they are not 1:1 up to date with the new UE4 settings and standards (however I still feel that might be interesting & useful).

- [UE4 forum] Standardizing Texture Density
- [UE4 forum] Texel Density
- [3Dtotal] Texel Density for game art
- [ISOTOX blog] Texture Texel-Density
- [Polycount] 64 pixel density per meter
- [Polycount] Questions about the texel density
- [Polycount] Consistent Texel density vs. Importance/Space efficiency?
- [Polycount] Optimal texture size?
- [Polycount] How often are 4096 textures used in next-gen gaming
- [Guillaume Provost article] Beautiful, Yet Friendly Part 2: Maximizing Efficiency
- [Guillaume Provost article] Beautiful, Yet Friendly Part 1: Stop Hitting the Bottleneck
- [Polycount] Can someone simplify Texel Density?
- [Polycount] Maya UV's Texel Density
- [Digital Tutors] Creating Professional Studio Game Assets for Production in 3ds Max and Unity
In this series (really well done in my opinion) the lessons that tackle texel density are # 05, 09, 10, 11, 12 and 13.
Texel Density: All you need to know (Leonardo Ienzi)

UV Plugins:
[Maya] Nightshade UV Editor
[Maya] UVDeluxe
[Maya] Ninja UV
[Maya] Texel Density Advisor
[3ds Max] TexTools
[3ds Max] Advanced UV Normalizer
[Modo] Texel Density Toolkit


Among the many resources I listed above I found particularly interesting 2 threads from the UE4 forums:
- [UE4 forum] Standardizing Texture Density In this one here TeriyakiStyle proposed to standardize the texture density measures for UT environment art.
- [UE4 forum] Texel Density In this one here CharlestonS attempted a conversion from the UDK/UE3 texel density standards to the new UE4 units setup standards.

Based on the information found in those 2 threads I wrote down for myself the following notes (cause I am little dumb with math and proportions) .
Note: bear in mind that the measure in cm have been rounded and are not exact (because have been converted from the feet measure): they simply helped me to have a rough idea about the measure (because I am not accustom to feet units).

[UDK/UE3]
In UDK/UE3 the scale was the double as it is in UE4.
- 1 unit = 1.95 cm
- 1 foot = ~30 cm = 16 units
- Texel Density: 8 pixels x unit

• 8 units = 0.5 foot = 15 cm = 64x64
• 16 units = 1 foot = 30 cm = 128x128
• 32 units = 2 feet = 61 cm = 256x256
• 64 units = 4 feet = 121 cm = 512x512
• 128 units = 8 feet = 243 cm = 1024x1024
• 256 units = 16 feet = 487 cm = 2048x2048
• 512 units = 32 feet = 975 cm = 4096x4096


[UE4]
In UE4 the scale is half as it was in UDK/UE3.
- 1 unit = 1 cm
- 1 foot = ~30 cm = 30 units
- Texel Density: 8 pixels x unit

• 8 units = 0.25 foot = 7,6 cm = 64x64
• 16 units = 0.5 foot = 15 cm = 128x128
• 32 units = 1 foot = 30 cm = 256x256
• 64 units = 2 feet = 61 cm = 512x512
• 128 units = 4 feet = 121 cm = 1024x1024
• 256 units = 8 feet = 243 cm = 2048x2048
• 512 units = 16 feet = 487 cm = 4096x4096

What do you think? Does this make sense to you?
Do you have any additional resources / thoughts to add ? (I guess that most experienced people have some).
I will try to keep the post up to date with any relevant information / resource / link posted below.

Damn it looks I have created a huge wall of text. :poly142:

Well, many thanks in advance.

Replies

  • sprunghunt
    Options
    Offline / Send Message
    sprunghunt polycounter
    Something to note is that Epic doesn't work this way. They don't use texel density when creating an object. What they do is create all of their textures at a single size (currently it seems to be 4096x4096) and then go through and set the LODgroups and LODbias to resize the textures for different platforms and appropriate size in scene. It's much more flexible to do this as you can adjust the LOD on the textures in code later if you want to increase or decrease texture memory.

    There used to be a texture density mode in UE3 that would show the relative texture density of objects - which was super useful - but they seem to have removed it.
  • < ASH >
    Options
    Offline / Send Message
    < ASH > polycounter lvl 13
    sprunghunt wrote: »
    Something to note is that Epic doesn't work this way. They don't use texel density when creating an object. What they do is create all of their textures at a single size (currently it seems to be 4096x4096) and then go through and set the LODgroups and LODbias to resize the textures for different platforms and appropriate size in scene. It's much more flexible to do this as you can adjust the LOD on the textures in code later if you want to increase or decrease texture memory.

    Hey sprunghunt thanks for the interesting insight. :)
    I think that these days is pretty common to create and author textures at least at 2048 (if not 4096) and then clamp them down in the editor to a more suitable resolution. So the "Epic workflow" you describe makes perfect sense and allow more flexibility in the long run. It would be interesting to understand which kind of "planning" Epic artists do before creating a texture (at least in term of texel/detail density).

    That said I feel that is useful to have a rough idea about "how to use" each texture and "how much space" each texture can/should cover and still looks good (especially compared to the other textures around it): just to have a reference idea and to plan ahead (a little) my textures.

    The thing that concerns me is the "best" source texture size: having to decide if to work at 2048 or at 4096. The question that I ask myself is: "it's really necessary to create a 4096 texture? Or a 2048 would be enough for its use?"
    I mean, having to create a 4096 or a 2048 implies a different workload: create a 4096 take more time, effort and resources that to create a 2048. So I would like to plan a little bit ahead (if possible) to avoid "wasting" work, time and texture space where is not needed. :)
    For example another interesting thread about this topic might be the following, Optimal texture size?, where Ryan Clark suggested to use the MipmapTest textures to estimate the best texture resolution to use.

    At the end of the day my main purpose is to find a more efficient way to work.
    So far I mostly worked eyeballing the result and asking myself: it looks correct? (as many people suggested in the threads I linked above).

    Does this make sense? Or I am worrying too much for nothing? :poly124:

    sprunghunt wrote: »
    There used to be a texture density mode in UE3 that would show the relative texture density of objects - which was super useful - but they seem to have removed it.
    I remeber that view mode in UDK: was quite useful.
    https://udn.epicgames.com/Three/ViewModes.html#Texture Density

    Unfortunately I didn't managed to find it either in UE4. :(


    EDIT: I tried to clarify a little bit better my thoughts on the "texture size". :)
  • MeshMagnet
    Options
    Offline / Send Message
    MeshMagnet polycounter lvl 9
    I asked this question sometime last year, the thread kinda blew up and got put into the wiki:

    http://www.polycount.com/forum/showthread.php?t=134911
  • < ASH >
    Options
    Offline / Send Message
    < ASH > polycounter lvl 13
    MeshMagnet wrote: »
    I asked this question sometime last year, the thread kinda blew up and got put into the wiki:

    http://www.polycount.com/forum/showthread.php?t=134911

    Hey MeshMagnet interesting thread: there are many interesting comments and considerations in there: :)

    Thanks for sharing it ! :)

    I will add that to the list above.

    Btw I realized that in my previous posts I haven't clarified that I am mostly doing environment (and props). Usually I never find myself using textures bigger than 2048: to be honest most of the times I stick to 1204 or 512 texture size. ;)
  • MeshMagnet
    Options
    Offline / Send Message
    MeshMagnet polycounter lvl 9
    < Ash > wrote: »
    Hey MeshMagnet interesting thread: there are many interesting comments and considerations in there: :)

    Thanks for sharing it ! :)

    I will add that to the list above.

    Btw I realized that in my previous posts I haven't clarified that I am mostly doing environment (and props). Usually I never find myself using textures bigger than 2048: to be honest most of the times I stick to 1204 or 512 texture size. ;)


    Glad to contribute. :)
  • sprunghunt
    Options
    Offline / Send Message
    sprunghunt polycounter
    < Ash > wrote: »
    Hey sprunghunt thanks for the interesting insight. :)
    I think that these days is pretty common to create and author textures at least at 2048 (if not 4096) and then clamp them down in the editor to a more suitable resolution. So the "Epic workflow" you describe makes perfect sense and allow more flexibility in the long run. It would be interesting to understand which kind of "planning" Epic artists do before creating a texture (at least in term of texel/detail density).

    That said I feel that is useful to have a rough idea about "how to use" each texture and "how much space" each texture can/should cover and still looks good (especially compared to the other textures around it): just to have a reference idea and to plan ahead (a little) my textures.

    The point is that this kind of planning is old fashioned. It assumes that the texture resolution on disk is going to be the same as the texture resolution on screen.

    This is not the case with a streaming system. The streaming system in unreal loads an objects bounding box and uses the relative texture size based off that. If you have a small object with a 4096 texture on it it'll just load mip levels until it's a 128x or whatever size the streaming system thinks is appropriate.

    You might get some gains by reducing the texture size but it's usually unlikely in my experience.

    have a look at this - especially the 'Optimizing and debugging texture streaming' section
    https://docs.unrealengine.com/latest/INT/Engine/Content/Types/Textures/Streaming/index.html

    what I'll often do is look through the listextures section for discrepancies between the in-game texture column and the maxresolution column.

    But in my experience this rarely produces much of an effect on memory. If you want to reduce texture memory then you need to cut back the number of textures being used - for example removing all the spec maps on environment assets is a trick I've used in the past to ship games. Making sure a scene isn't loading a bunch of unique textures also helps.
  • < ASH >
    Options
    Offline / Send Message
    < ASH > polycounter lvl 13
    sprunghunt wrote: »
    The point is that this kind of planning is old fashioned. It assumes that the texture resolution on disk is going to be the same as the texture resolution on screen.

    This is not the case with a streaming system. The streaming system in unreal loads an objects bounding box and uses the relative texture size based off that. If you have a small object with a 4096 texture on it it'll just load mip levels until it's a 128x or whatever size the streaming system thinks is appropriate.

    You might get some gains by reducing the texture size but it's usually unlikely in my experience.

    I see, many thanks for the explanation: now the whole topic make much more sense.
    Infact the overall "workload" to pre-plan with that level of detail was quite insane (but I thought that maybe would have still made sense).
    sprunghunt wrote: »
    have a look at this - especially the 'Optimizing and debugging texture streaming' section
    https://docs.unrealengine.com/latest/INT/Engine/Content/Types/Textures/Streaming/index.html

    The topic is really wide and complex but explained in a really compressible way. D
    I admit to be a lot less acknowledge on the topic of what I initially though. Thanks for the link. D
    sprunghunt wrote: »
    what I'll often do is look through the listextures section for discrepancies between the in-game texture column and the maxresolution column.

    But in my experience this rarely produces much of an effect on memory. If you want to reduce texture memory then you need to cut back the number of textures being used - for example removing all the spec maps on environment assets is a trick I've used in the past to ship games. Making sure a scene isn't loading a bunch of unique textures also helps.

    Thanks for the hints. I will bear them in mind

    Ofc cutting the number of unique textures (or getting rid of the unique textures) is always a good way of optimizing.
    At the last studio I have been working (we were using an in house engine, not Unreal unfortunately) we also use to "play" a lot with the texture resolution (we use to call them AIP) to ptimize a level. Basically if a level was running out of memory (or btw with poor performance) one of the most radical actions was to reduce the size of the textures (that's what I referred to when I was talking about clamping). Most of the times was clear that with a little bit more "planning ahead" (on texture # and texture size) the overall level could have played a lot smoother.
  • wapc
    Options
    Offline / Send Message
    wapc polycounter lvl 3
    Hi. I am still a bit confused of how I should author my textures. I want to do some simple walls first and the more conservative way would be to make them for example 256 uu / 256 cm and put a 2048 on them, right? This is all power of 2. Now in Unreal the grid snapping is 1, 5, 10, 50 and so on which is not. Does it mean that with texture streaming it doesn't really matter? Which dimensions are good for a wall piece then?
  • < ASH >
    Options
    Offline / Send Message
    < ASH > polycounter lvl 13
    Hey wapc, I know that is kind of difficult to wrap your head around the "texel density" topic.
    I'll try to make some additional sense, based on what I understood by the time (hoping that helps you). :)

    To have a consistent look from different textures in your environment/game is a good idea to set a common parameter to all your textures, called "texel density". Simply put is a value of the resolution per unit (meaning a set square space, 1cm, 50 cm, 100 cm ...etc) that you want all your textures to have, so that they a similar resolution when looked on the side of another (and so they look equally good).

    Before Unreal 4, with UDK, Unity 4 and other "old gen" game engines people used to do some complicated math using pixels and units (ie. 1 unit = 1.95 cm) to calculate texel density: these days most of the game engines tend to work with centimiters, so the math to do is much easier, because 1 cm = 1uu.

    It all depends about the resolution (pixels) per centimeter that you want to have. Based on that you decided a certain texel density.
    For example you want 100 cm (=1meter btw)  to be equal to a 256 pixels texture, then 100/256= 2.56 pixels per cm (that is the "texel density").
    I have to admit that after researching this topic the past year I realized that is more a common sense thing that a requirement/"must do" thing. However even if not everybody used it, it's also true that many studios tend to decide a desired texel density, so to have similar consistent textures throughout the project.

    To answer your questions:
    - From my experience texture streaming matters, so you want to be careful with your maximum texture size.
    - Typically for a wall tilable texture you tend to use 1024 or 2048 size (bigger that this is kind of rare for environment stuff), but bear in mind that doesn't exist a "correct size".
    In most of the game engines you can set a maximum size to each texture, so you tend to import each texture at the maximum resolution you "would like" to use (lets say for the wall 2048), but then you have to run performance test to see if your level runs smoothly enough with that texture at that resolution.
    If you find out that the resolution is too high you can always set the maximum size to 1024 (even though you imported a 2048 texture). That is exactly what sprunghunt said before:
    sprunghunt said:
    Something to note is that Epic doesn't work this way. They don't use texel density when creating an object. What they do is create all of their textures at a single size (currently it seems to be 4096x4096) and then go through and set the LODgroups and LODbias to resize the textures for different platforms and appropriate size in scene. It's much more flexible to do this as you can adjust the LOD on the textures in code later if you want to increase or decrease texture memory.

    - For authoring the texture, is common practice to work at double the size compared to your desired output size (so if your final texture will be a 1024, you want to author it at 2048): however it also depends on your system specs and on the free hard drive space you have, so in the brick wall example authoring 4096 texture to create a 2048 final texture can be exaggerated (for both system performance and hard disk space usage), so you might think to author your texture directly at 2048. 

    I am not an expert, all the above thing are based on my experience and my research. If I am incorrect about something please correct me (so I will learn something new). :)

    I hoped this helps. ;) 

  • wapc
    Options
    Offline / Send Message
    wapc polycounter lvl 3
    Hi ASH. Thanks for the reply. It definitely helped! It's still a bit strange to me that the default grid snapping in UE4 is not power of two because all textures are. According to that you would normally model your assets so that a 1024, 2048 etc. would roughly match the dimensions. If the textures would be a power of 5 it would make sense :smiley:  "Texture Steaming" sounds like there are more mip levels though.
  • < ASH >
    Options
    Offline / Send Message
    < ASH > polycounter lvl 13

    wapc said:
    Hi ASH. Thanks for the reply. It definitely helped! It's still a bit strange to me that the default grid snapping in UE4 is not power of two because all textures are. According to that you would normally model your assets so that a 1024, 2048 etc. would roughly match the dimensions. If the textures would be a power of 5 it would make sense :smiley: 
    Glad to be helpful. ;)
    Well according to me you are looking the whole thing from the "old" point of view: you should free your point of view from the old constraint between texture size and grid size. These days is not that important anymore, as long as you work in a consistent way, so to have the same texel density between all/most of your textures.

    Btw if you still want to mess around with the grid size, be aware that in Unreal Engine you can customize the grid size according to your needs.
    For example in the image below I added the 15 units snap to my Editor (because sometimes  this value is useful working with modular components).


    To add a custom snap setting:
    - In Unreal Engine navigate to Edit > Editor Preferences > Viewports > Grid Snapping
    - click on the white arrow on the bottom of the  "Grid Snapping" section (this will display additional options)
    - Expand the "Decimal Grid Sizes" and you will see the actual snapping values (the ones displayed in your Editor viewport)
    - Here you can add additional Snapping Values according to your needs, using the + button (or delete using the rubbish bin button): bear in mind that when you create a new snapping value will be but at the bottom of the stack, so you will have to reorder them manually (coping the values in the cells). :(

    Here you can see my Grid Snapping window where I added the custom 15 units snap: 


    wapc said:
    "Texture Steaming" sounds like there are more mip levels though.


    Let me elaborate on this: with "texture streaming" I mean the texture loading on the fly as you run the game.
    So for example, if you travel from a cave environment in a sewer environment tipically your level streaming will take care to load (a little before reaching the new "sewer" environment) the geometries and the textures.
    What the "texture streaming" does is to adjust on the fly which mip map* is loaded at any particular time according to the camera or player position compared to the various objects/textures.

    *In case you don't know what a mip map is: because of the "aliasing" doesn't make sense to display a large texture (like a 1024) when the texture is far away from the camera/player, so you tend to have different smaller sizes of the same textures, each one displayed according to the distance. Unreal Engine for example take care to automatically generate the mip maps for each textures for you: then you can tweak the switch distances (in a similar way you do for the geometry LODs). 


    EDIT: 
    Regarding the snap settings, in Unreal still exist the Pow 2 Grid Sizes settings (you can see the 2 sections in my image above), however I don't thing that many people still use them: if you are interested maybe give them a shot.
    Here you can read a couple of topics from Epic forum/answers:
    - Power of 2 Grid Scale
    Does the Grid support both power of 2 and base 10?
  • juggulator
    Options
    Offline / Send Message
    juggulator polycounter lvl 5
    I was struggling to understand what density resolution to apply and when. However I have essentially phased out unwrapping UV's in Maya ever since using 3D coat. It has made unwrapping UV's something that I actually look forward to as it empowers me with the ability to map out and unwrap UVs in a matter of seconds. Plus it supports specifying a resolution during import, although on my PC it has 4K and 8K disabled[ I do have 16g DDR3 Ram and EVGA GTX 670 FTW.] The texel distribution that 3D coat applies across islands is mind blowing though. Took me about the time it takes to watch the 2 youtube videos on UV mapping and now I'm on easy street.
  • < ASH >
    Options
    Offline / Send Message
    < ASH > polycounter lvl 13
    Hey juggulator, yeah 3DCoat is pretty good for UV unwrapping and it certainly applies an equal texel density to all the UV shells of your mesh.
    Back in the days I started using 3D Coat for both its great retopology and UV unwrapping tools and just afterwards I learned the painting tools (I still have to dig into the voxel sculpting thought).

    Btw if you are a Maya user I suggest you to give a shot at both Nightshade UV Editor and Texel Density Advisor : the first one is a complete UV texture editor window replacement (that include a texel density tool)  while the second one is just a texel density tool.
    If you still have doubts tackling texel density outside 3D Coat you might want to have a look at this guide about texel density made by Leonardo IezziAll You Need to Know about Texel Density. It's short and to the point and I am sure will helps you to better understand this topic.
    All these links are already in the very first post on top of the page, but i understand there are many there and you might have missed them. :)

  • juggulator
    Options
    Offline / Send Message
    juggulator polycounter lvl 5
    < ASH > said:
    Hey juggulator, yeah 3DCoat is pretty good for UV unwrapping and it certainly applies an equal texel density to all the UV shells of your mesh.
    Back in the days I started using 3D Coat for both its great retopology and UV unwrapping tools and just afterwards I learned the painting tools (I still have to dig into the voxel sculpting thought).

    Btw if you are a Maya user I suggest you to give a shot at both Nightshade UV Editor and Texel Density Advisor : the first one is a complete UV texture editor window replacement (that include a texel density tool)  while the second one is just a texel density tool.
    If you still have doubts tackling texel density outside 3D Coat you might want to have a look at this guide about texel density made by Leonardo Iezzi: All You Need to Know about Texel Density. It's short and to the point and I am sure will helps you to better understand this topic.
    All these links are already in the very first post on top of the page, but i understand there are many there and you might have missed them. :)


    I actually do have NSUV[Straighten Shells!!FTW]. I have shamefully moved further from it ever since discovering 3D coat. I but do miss my dear to heart nightshade suite of scripts. One of my primary factors for moving more and more to 3DC was that I just couldn't get the Textel density operation to work[that and/or I have no idea how to confirm if the steps I'm doing are correct. I'd enter a value and the UV shell just disappears. But I'm always researching how to conform my pipeline to the highest quality results and I'm now honestly feeling like  equal texel density across certain models isn't always going to be the best decision. My priority target is always real time/ game development so it's absolutely critical that I fully understand and can properly implement it. I'm going to see what the Texel Density Advisor can accomplish as it looks like it may be easier to set texel density using it.
Sign In or Register to comment.