Home Technical Talk

Texel density and units in depth

polycounter lvl 12
Offline / Send Message
HAWK12HT polycounter lvl 12
Hi all, trying to improve my understanding of texel density I come across this article  https://80.lv/articles/textel-density-tutorial/  

Textools method and manual scale method is what I am having dificulty with as you can see in image below. I even made texture with TD spec in Photoshop.
*4 meter wall in background has 1024 resolution texture tiled 4 times as per tutorial. 0 - 1 space is full with UV of this wall (plane) too.
*3 meter wall (UV island in pic below) when set correctly with textool or manually to match TD its scale is way off from 0-1 space. Also (second attempt) since its 3m in height I also applied tilling to it x3 as per tutorial and it covers the entire 0-1 space with perfect TD. It would be perfect if I want to overlap faces on tilling texture but I want unique details on mesh thus required to fit in 0-1 space with 10.24td. 
*Now what I dont understand is matching the TD that is on 4 m wall or 1m wall, like the manual method shown in tutorial.

Also I make modular assets with UDK approach 256x512 , 128x64 etc and uniform scale them down to 1, reason being to keep Unity scale and file factor to 1 and in meters. So 256/100 becomes 2.56m wall height etc, I do it this way because in 3ds max working with generic 2.56 units with system units set to meters is very small. I know I can do different settings and play with units more but I doubt it will help understand this issue of TD, at least this method works 100 percent for Unity scale (Unity default cube is exact match with cube made this way inside 3ds max with 100x100x100, scaled down to 1 reset xform)
 

Replies

  • poopipe
    Offline / Send Message
    poopipe grand marshal polycounter
    If it doesn't fit in the texture space and you want to maintain texel density you either need a bigger texture,  overlapping UVs or to do something clever with a Shader.

    Also, if it's not a stupid question, why don't you work in centimetres and save yourself doing the conversion? 
  • HAWK12HT
    Offline / Send Message
    HAWK12HT polycounter lvl 12
    Tried different unit scale with same results so what did I miss I am pretty sure I am missing something in that TD tutorial.

    poopipe said:
    If it doesn't fit in the texture space and you want to maintain texel density you either need a bigger texture,  overlapping UVs or to do something clever with a Shader.

    Also, if it's not a stupid question, why don't you work in centimetres and save yourself doing the conversion? 
    Hmm than how its done in tutorial, manual method. That is what I am trying to achieve in first place.

    As for your question nope not supid at all, you can work with centimetres too but for me its just an old habit coming from UDK days where I use grid snaps with texture atlas and generic units/ system units to meters. This way I can quickly export to both UE without scaling or Unity with scale down.
  • Noth
    Offline / Send Message
    Noth polycounter lvl 14
    I guess you could use UDIMs or just get a bigger texture like poopipe says
  • radiancef0rge
    Offline / Send Message
    radiancef0rge ngon master
    Noth said:
    I guess you could use UDIMs or just get a bigger texture like poopipe says
    stop saying this, udim is not appropriate for games workflows. 
  • poopipe
    Offline / Send Message
    poopipe grand marshal polycounter
    You could use udims in a game,  you just need Shader and tech support - there's nothing inherently inappropriate about them at all. 

    If I'm understanding you right you want unique details but you also want to hit texel density on a given sized texture?

    If so, you need to overlap UVs. 
    Break the UVs up into areas that can tile, be reused, mirrored etc. And ram them into the available space - then do your bakes etc. 

    It's that or use a bigger texture


  • YannickStoot
    Offline / Send Message
    YannickStoot polycounter lvl 3
    It´s a bit of a side note but I usually import models first by dragging it into the assets folder, Then change in material import settings to off and scale size to whatever it  needs to be to line up in Unity. And for all future imports I import it outside of Unity by dragging & replacing it into the Windows Explorer. This way I don´t need to edit all the settings of the model and have the model just "update" in the viewport.
  • throttlekitty
    poopipe said:
    You could use udims in a game,  you just need Shader and tech support - there's nothing inherently inappropriate about them at all. 

    If I'm understanding you right you want unique details but you also want to hit texel density on a given sized texture?

    If so, you need to overlap UVs. 
    Break the UVs up into areas that can tile, be reused, mirrored etc. And ram them into the available space - then do your bakes etc. 

    It's that or use a bigger texture


    I think the intent is to steer people away from UDIM if it's not necessary, and it rarely is. Someone getting the idea that using 6 4k maps for a simple wood shack in a realtime game is acceptable isn't very helpful.
  • Mark Dygert
    Go go tiling textures!
  • HAWK12HT
    Offline / Send Message
    HAWK12HT polycounter lvl 12
    UDIMs on mobile oh god no...

    Ok perhaps I explained my issue in a wrong way, I even made a tutorial while ago too that pretty much keeps nice td for all the assets.
    Also its generally eyeballing your checker texture to have nice even ratio on assets / environments modules, we can add that three stages too as shown in the 80lvl tutorial (foreground, background, player area etc).

    What I am not understanding from that tutorial is how in the world you can have 1024 res  per meter and have it fit into 0-1 space, note in my example shown above its a 3x3 meter room so its a very small space that should fit in 0-1 space without overlapping the wall UVs. We have examples of whole environments being done with 1x1024 texture atlas for games (while being super crisp) so you can see its creating a conflict of information.

    https://www.youtube.com/watch?v=Gxdjc2a7Toc&t=24s
  • poopipe
    Offline / Send Message
    poopipe grand marshal polycounter


    I think the intent is to steer people away from UDIM if it's not necessary, and it rarely is. Someone getting the idea that using 6 4k maps for a simple wood shack in a realtime game is acceptable isn't very helpful.
    I guess that's a fair point


    WRT to the room.  
    Why do you need to keep it in 0-1 space?  normally that's not what you do. 
  • HAWK12HT
    Offline / Send Message
    HAWK12HT polycounter lvl 12
    @poopipe what you mean dont keep it in 0-1 space?  If its tileable texture makes sense but when you are doing work in substance / or doing custom texture in any paint app you need to have your uvs laid out in 0-1 space no?


  • poopipe
    Offline / Send Message
    poopipe grand marshal polycounter


    In this case the artist is clearly not aiming for a specific texel density (either that or got very lucky)  - they simply wanted consistent density as high as they could get at a given texture size. This is fine for standalone assets but not fine for assets that sit with others.


    if you need unique UVs you have to either sacrifice texel density or use a bigger texture
    If you need to hit texel density you have to tile/share UVs or use a bigger texture
    If you need to have a specific texture size you either sacrifice texel density or tile/share UVs






  • Mark Dygert


    It's similar to the Good-Fast-Cheap, pick two, paradigm. There is no magic trick to get everything, it's a matter of striking a balance with the resources that you have as best as you can.
  • HAWK12HT
    Offline / Send Message
    HAWK12HT polycounter lvl 12
    poopipe said:


    In this case the artist is clearly not aiming for a specific texel density (either that or got very lucky)  - they simply wanted consistent density as high as they could get at a given texture size. This is fine for standalone assets but not fine for assets that sit with others.


    if you need unique UVs you have to either sacrifice texel density or use a bigger texture
    If you need to hit texel density you have to tile/share UVs or use a bigger texture
    If you need to have a specific texture size you either sacrifice texel density or tile/share UVs






    Thank you @poopipe and @Mark Dygert  appreciate the help.

    Right so I get this result with all wall parts of room overlapping (3x3m room height, width, length) it also matches perfectly with the 1x1m plane on right side. I had to tile wall texture 3 times too so that 1meter of wall get 10.24td. Now what I am struggling to understand with this approach is how in the world you make full lavish environments when just a small 3 meter room took over all your texture space with just 10.24td. That paradigm is killing me now cause I am used to making modular environments using texture atlas being made first and then you cut the parts of texture and make a model from it, like this http://www.thiagoklafke.com/modularenvironments.html . I hope it make sense.

    Again thanks fellas.











  • poopipe
    Offline / Send Message
    poopipe grand marshal polycounter
    You use multiple materials. Some might be multi directional tiles, others will be trims etc.

    The materials will usually support some sort of vertex painted blending so you can dirty bits up uniquely. 

    It's possible you're underestimating the number of materials used in a modern game environment.  It's not unusual for it to number in the hundreds. 
  • HAWK12HT
    Offline / Send Message
    HAWK12HT polycounter lvl 12

    poopipe said:

    It's possible you're underestimating the number of materials used in a modern game environment.  It's not unusual for it to number in the hundreds. 
    Aha now that is something that make sense, yea I try to keep my material count to as low as possible for optimization but havent seen info on modern day material count (ubisoft, naughty dog, blizzard etc) most we see are modular assets with texture atlas haha.
  • Mark Dygert
    One thing that helps is creating master materials and then instancing that material. It works similar to instancing things like trees or plants except with most engines you can set up parameters and plug in different maps and values. 

    https://www.youtube.com/watch?v=tZsEzOCETBM
  • poopipe
    Offline / Send Message
    poopipe grand marshal polycounter
    These days engines will use material batching, texture arrays, mesh instancing and so on to minimise the number of primitives drawn - it's not necessarily a matter of one per mesh per material.
    With systems like that in place you can start to concern yourself more with memory usage, flexibility and ease of authoring.

    It's engine dependent of course, which means you have to know what your target engine can do (which means reading) 
  • HAWK12HT
    Offline / Send Message
    HAWK12HT polycounter lvl 12
    Apart from engine dependent its target platform dependency too like mobile. Onto discovering new things in our tiny little art world, thank you fellas.
  • HAWK12HT
    Offline / Send Message
    HAWK12HT polycounter lvl 12
    so going over lots of videos on TD and reading up on Polycount threads with "TD" as search I am even more confused now lol. Also I asked Warren Marshall too on this issue of mine and according to him if TD goes outside of 0-1 space for a unique item, I am in the world of hurt cause in that case I ll have to either mirror or break the object into sections etc. Example in my case embosing a lion face on wall which has UV shell out of 0-1 space to match TD. :/
    Also what if you set texture resolution in Photoshop to 10.24 pixels/centimeter on 1024x1024 document.
  • HAWK12HT
    Offline / Send Message
    HAWK12HT polycounter lvl 12
    Left to right 32 64 128 256 512 1024 2048 4096 pixels per 100cm or 1M. Is giving even 1k TD per 1m a norm in modern games? cause with this you are running out of 0-1 space super fast and then how will you fit unique details, example a embosed detail on 10x10M wall.




    "He who asks a question is a fool for five minutes; he who does not ask a question remains a fool forever." (in my defense as I am going nuts over this whole TD best for me is if I stick with Texture Atlas approach the good old way lol. Its a chinese proverb I love and was shared by my uni lecturer)
  • HAWK12HT
    Offline / Send Message
    HAWK12HT polycounter lvl 12
    http://polycount.com/discussion/comment/2541283#Comment_2541283

    sharing this link as it has usefull info on same subject.
  • poopipe
    Offline / Send Message
    poopipe grand marshal polycounter
    WRT  environment art, 1024 per metre is about as high as you'll see on current consoles if you're talking about simple shaders and assuming human scale.

    Any lower than 512 per metre starts to look pretty ropey for fps games but you can mitigate against it by using detail maps or just simpler, cleaner surfaces  etc.

    3pp games are usually a lot more forgiving so you'll see lower densities there. 

    Basically the ideal is for texels to match pixels at your closest viewing distance,  you'll be very lucky to get a memory budget that allows that but if you do a few sums you can work out what the ideal is and start arguing the toss with programmers in an informed way. 
  • HAWK12HT
    Offline / Send Message
    HAWK12HT polycounter lvl 12
    Yeah those  I understood just fine and have been using even TD based on distance certain object will be viewed from. What I am struggling to grasp still the idea of 10.24 or 1024td per meter, it works great if you are using tiling textures but the moment you have unique item it becomes a nightmare as its UVs wont fit in 0-1 space and you ll have to break the mesh into several pieces / mirror etc to meet the desired TD. 
  • HAWK12HT
    Offline / Send Message
    HAWK12HT polycounter lvl 12
    "Games often use power of 2 pixel ratio. 2px per cm. 4 px etc... modern games can be up to 6px per cm. If you want to guess what texture size you should use. Unwrap your model and select the biggest shell and use uv deluxe or equivalent to scale the shell. Pay attention that the size of the shell depends on the size of the object but also the texture size in the uv editor. 4 px per cm on a target 1024 isnt gonna be the same than 4 px per cm on a 2048. Tex = textured pixel. Texel density is how much pixel from the texture you squeeze onto your model. In games we set target pixel ratio per centimeters." 
  • HAWK12HT
    Offline / Send Message
    HAWK12HT polycounter lvl 12



    Just doing some breakdown of TD including trim parts, notice how you can break trim sheet 1024 into 4 or as many as you like with power of 2. In my example I have 512-256-128-128 from top to bottom. 
  • HAWK12HT
  • Mirbobo
    I think you are thinking too much into it. I generally have a simple plane  with checker or similar material applied so I can compare my unique prop texel density to that. And remember that you most likely will not always keep 100% same texel density around your models, there will be small differences.

    And if the difference is drastic. Say I have a statue that's 10m tall, I would most likely use multiple layered materials that combine unique baked maps as well as tiling maps + possible detail maps to nail that required texel density. Then It becomes more of planning out the correct materials needed than worrying about the UVs. Or if you are creating tables/drawers etc. you might have a baked atlas texture set for different details, keyholes, hinges etc. and then use face weighting/baked map for the actual wooden parts combined with a tiling texture.

    I feel that the usual single texture set and material workflow still works for relatively simple everyday objects but for anything bigger/more complex I'd start planning different materials and reusability, especially if you want to hit that 1024/m texel density.
  • HAWK12HT
    Offline / Send Message
    HAWK12HT polycounter lvl 12
    Thank you @Mirbobo , you are absolutely right I am thinking about it too much despite the fact that I mostly keep my td consistent and prefer texture atlas approach as you mentioned. I was having a hard time figuring out 10.24px/cm or 1024/m td for unique items that will be out of 0-1 space however after reading your reply and fresh early morning start I realize hey I can increase my texture resolution and fit that unique item in 0-1 space and it will more or less match the TD (eye ball) with other items in enviro. (I hope I am right lol)
  • HAWK12HT
Sign In or Register to comment.