Home Technical Talk

Texel Density w/ Detail Maps

polycounter lvl 11
Offline / Send Message
leechdemon polycounter lvl 11
We've recently decided to go from Tiling textures to Unwrapped Textures w/ Detail Maps to get more model-specific variation at a lower texture cost. The thing I can't get my head around though is how to ensure consistent Texel Density.

Currently, I've set an arbitrary Texel density based on an image size and a real-world size (1024px = 1m. It's GIGANTIC, I know, but the idea is that if it's consistent I can just batch downres them once we pick a final size). In Max, I set the mapping to the same real world size as the image (so, a 1024px image gets set as being 1m in the UVMap controls), and then I'm 100% positive that all my images have the same texel density.

With that setup, my current textures are basically my detail textures, and anything I'd add to them would be the actual texture. So currently, my problem is that I'd need to overlay a dirt or grunge texture, and then through Tiling in the material settings, scale the map so that it makes sense and varies the image correctly. Since my UV's correspond to a texel density already, there's no issue. But this is going to be a serious hassle moving forward, so, I'm probably going to end up unwrapping all the textures, and using the Detail textures as intended.

My question, then, is this: If your Unwrapped Texture is always in 0-1 UV texture space, and the texture itself is going to be lower res so that the detail texture handles the Texel Density, how do you know what to set your tiling to in order to ensure the correct density? For example, if your object is 0-1 UV and is 2 meters, the tiling must be X, but if your object is 0-1 UV and is 10 meters, the tiling would have to be Y. How do you know what to set your tiling to? Do you just eyeball it?

I'm sure this is way easier than I'm making it out to be; thanks in advance for your collective patience. >_<

Replies

  • jocose
    Offline / Send Message
    jocose polycounter lvl 11
    To get texel density don't you just do this:

    (MD * TD) / YTR = How many times you tile

    MD = 3D Mesh Dimensions (lets say its 2 meters)
    TD = Target Density (what your going for per meter, lets say 512)
    YTR = Your Textures Resolution (Lets say you have a 256x256 texture)

    Then you would just do this...

    2 * 512 / 256 = 4

    You would need to tile a 256 4 times on a 2 meter surface to get your target density if 512 texels per meter.

    Does that help?
  • Progg
  • leechdemon
    Offline / Send Message
    leechdemon polycounter lvl 11
    Progg: I'm using the math only inasmuch as keeping something consistent via numbers, rather than "looks good". I'm modeling a large number of assets to be reused in multiple scenes, and I don't want to get to my 100th object and have it look very different from my first one. Relying on numbers makes sure that if my 1st object is close to my standard, and my 100th object is close to my standard, then my 1st and 100th are close to each other. Transitive Relation... lol, gotta love math. ;^D

    Jocose: I suppose that makes sense; I'd basically be measuring each mesh and dividing the result by my fixed amount. So if it's relative to meters, the number of tiles becomes "How many meters is it?". Is that the way it's done? Seems like a heck of a lot of measuring, isn't it? Although, I guess you could argue that I'm doing all of that measuring already; by mapping to a specific scale, I'm avoiding the math by having everything be fixed values, and the variable is all in the mesh size; the way you mentioned, the mesh size is fixed and the variable is the number of tiles.

    I guess that works. Thanks!
  • jocose
    Offline / Send Message
    jocose polycounter lvl 11
    Progg wrote: »
    This is art, you aren't suppose to be doing math ! That does actually make a lot of sense though. I never looked at it like that.


    Hey dude, your building a building. You eyeball the entire thing its gonna fall down. That does mean a house can't be artistic :poly124:

    A LITTLE math never hurt anyone, this is just so basic I just do it sometimes and move on. Anymore more complicated than this though, you will probably be wasting your time, unless its shader code of course.
  • Progg
    Offline / Send Message
    Progg polycounter lvl 11
    jocose wrote: »
    Hey dude, your building a building. You eyeball the entire thing its gonna fall down. That does mean a house can't be artistic :poly124:

    A LITTLE math never hurt anyone, this is just so basic I just do it sometimes and move on. Anymore more complicated than this though, you will probably be wasting your time, unless its shader code of course.

    Guys! It was joke! People always said you would never need math. I wasn't dissing it! JOKE!!!!

    I use math on a daily basis in this field. I love it and its the only way to stay accurate. Sarcasm doesn't translate well over the internetz. :(
  • renderhjs
    Offline / Send Message
    renderhjs sublime tool
    leechdemon wrote: »
    Progg: I'm using the math only inasmuch as keeping something consistent via numbers, rather than "looks good". I'm modeling a large number of assets to be reused in multiple scenes, and I don't want to get to my 100th object and have it look very different from my first one. Relying on numbers makes sure that if my 1st object is close to my standard, and my 100th object is close to my standard, then my 1st and 100th are close to each other. Transitive Relation... lol, gotta love math. ;^D
    ...
    Maybe some tools can help, if you work with 3dsmax have a look at TexTools:
    http://renderhjs.net/textools/
    In particular the texel density tools which let you:
    • normalize
    • pick / measure ratio
    • apply ratio to objects
    All without destroying the initial UV layout as it scales it only up or down in a proportional manner. Here is a older video that explains how it is used:
    [ame]http://www.youtube.com/watch?v=pi40W3SC5gw[/ame]

    Just a few hours ago a new version was released so if your interested better get that latest one from here:
    http://boards.polycount.net/showpost.php?p=1127133&postcount=125
    as it is not yet updated on the site and scriptspot.
  • Autocon
    Offline / Send Message
    Autocon polycounter lvl 15
    Sounds like a lot of work when the good old eyeball approach works pretty well and saves so much more time.
  • warby
    Offline / Send Message
    warby polycounter lvl 18
    i think the whole "consistant pixel density on everything" way of thinking that is emerging more and more is absurd just do what ever looks right on a model to model bases :

    good model + good texture + good composition in the scene + good lighting > consistent pixel density
  • MoP
    Offline / Send Message
    MoP polycounter lvl 18
    ( good model + good texture + good composition in the scene + good lighting + consistent pixel density ) > ( good model + good texture + good composition in the scene + good lighting )

    ;)
  • Mark Dygert
    I agree with warby its the final result that matters not being mathematically perfect. As long as you use it as a rough guide and not a hard and fast rule then you should be ok. I do use some rough formulas to get things started and I make heavy use of MoP's normalize script but there's a fine line between obsessively and needlessly wasting texture space and getting the exact same look with less.

    People tend to focus on polys and spend a lot of time hacking out 20-30 of them but then skip right over texture optimization, tossing out giant sheets like they where mardi gras beads.

    It's when you relay on the rules to tell you what looks right and stop evaluating the aesthetics of the piece, that you get into trouble.
  • aphexx
    Offline / Send Message
    aphexx polycounter lvl 12
    hi leechdemon, i dont think that afterward downsizing brings good results for lower mapsizes. perhaps you want to try extra bakings witch lower res for you final choice.

    perhaps this is interesting for you. we do 3rd person role playing games, and in the current project we used renderhjs scriptidea for making an own script that automatically bakes different texel resolutions for different platforms or lod stages out of 3dsmax through xnormal. also its batch process enabled and can bake down the complete asset database with lower sizes if we see, that severe memory problems occour.
    we also use a 5 times higher texel size for items (usable and takeable objects) than for environment props.
    some environment props get a second uv channel for potential detail maps like grain or such. for that the detailmaps dont get that much seams and can respect line flows of wood grain i.e.

    conclusion of this post is: if you want a good starting point, use renderhjs`s tools! they are greatness in bytes!!! :D
Sign In or Register to comment.