Texel density / Pixel Ratio - You have to read this

Discussion in 'Techniques | Inspirational' started by luchian, Nov 18, 2016.

  1. luchian

    luchian Administrator Staff Member

    Joined:
    Jun 3, 2014
    Messages:
    1,908
    Likes Received:
    690
    Willy Wale and Mr Whippy like this.
  2. Mr Whippy

    Mr Whippy Active Member

    Joined:
    Jan 18, 2016
    Messages:
    175
    Likes Received:
    126
    In Racer, Ruud added a gpu texture override (not sure if his idea, or a usual thing to do) that replaced all textures with a dds with mips that had numbers change and colour changes down the mips.

    Using this in game you could see which plots were receiving mopped versions of a texture and what level.

    So if say your walls at the roadside perpetually said 2, you knew that they were never showing the top texture size (say 1024px) and may as well be the 512px mip.
    Ok if you got up close it might be less nice, but most of the time you're saving 75% vram for no visual loss in quality.


    Pixel density is probably more useful for fps where you move around lots.

    For AC I'd go with mip level. If you're seeing 1 from a distance away, double the res, if you're rarely seeing lower than 2, halve it, etc.

    Fast and rough rules but probably more valid for the racing type needs.

    That said 'photomode' throws a spanner in the works, but who optimises for photos in a racing game? I'd rather be racing :)
     
  3. luchian

    luchian Administrator Staff Member

    Joined:
    Jun 3, 2014
    Messages:
    1,908
    Likes Received:
    690
    Intresting idea. I like an engineer-ish approach when taking decisions :).
    However (speaking for myself), in AC it would be pitty to sacrifice detail, unless you have performance issues.
    I know that when racing you don't actually notice a lot of stuff, but sometimes, I love taking screenshots also :D. Because it just looks so damn nice.

    Coming back to the idea, overriding textures is very easy in AC, so definitely to keep in mind in final stages of creation.

    ..sent from my phone.
     
  4. Mr Whippy

    Mr Whippy Active Member

    Joined:
    Jan 18, 2016
    Messages:
    175
    Likes Received:
    126
    Yeah that approach is more a guide too.
    If you get say '2' driving down the road, but pull over at the sides and see 1, then fine.
    But if you have to go nose to wall with a barrier beyond some grass to get a 1 then you could argue it's a waste.

    It's always nice to have extra pixels there, but it's absolutely useless if you never see them because the gpu always uses mips.


    It's more difficult now as 4K gaming has arrived. 2048px just fills the vertical screen.
    But 4x more vram needed for textures you still may not fully appreciate but can technically see.


    I suppose it stilljust comes back down to, does it look good? If yes great, if no keep going :)
     
    luchian likes this.
  5. Willy Wale

    Willy Wale Member

    Joined:
    Jan 12, 2017
    Messages:
    96
    Likes Received:
    96
    Location:
    UK
    I liked this idea (sounded like a good experiment) so made a test.



    The texture is 1024x1024 then mapped to the geometry 2mx2m so that each coloured square is approximately 1mx1m and 512x512 at the highest Miplevel.

    The thing that (pleasantly) surprised me most was how smoothly the levels transition and that one object can have several mips simultaneously (see the end of the video for clearest image). Not sure if this is because the wall is made of 1mx1m faces and each face is treated separately.
     
    luchian and Pixelchaser like this.
  6. Pixelchaser

    Pixelchaser Well-Known Member

    Joined:
    Jan 4, 2015
    Messages:
    1,303
    Likes Received:
    865
    great test Willy Wale !, you should make a test, 1 object on left and same on right. not using tiled textures though. proving using too much res on 1 side is bad and be able to compare it at same time.

    there must be a suitable ideal figure for "pixels per metre" etc for all this.
     
    Last edited: Mar 31, 2017
    Willy Wale likes this.
  7. Willy Wale

    Willy Wale Member

    Joined:
    Jan 12, 2017
    Messages:
    96
    Likes Received:
    96
    Location:
    UK
    Good idea @Pixelchaser I was considering redoing the UV mapping with a 512x512 texture to see if it made a difference but a cube either side of the 'road' with different resolutions would do the trick.
     
    Pixelchaser likes this.
  8. Pixelchaser

    Pixelchaser Well-Known Member

    Joined:
    Jan 4, 2015
    Messages:
    1,303
    Likes Received:
    865
    so many considerations.... id treat this as pixels per metre explicitly. so id make a 1 metre billboard on left and right. left uses 64 x 64 and on right maybe 1024 x 1024 and work out what is the best.

    also try just 4 mipmaps, I had heard this number being banded about where the engine creates them if they are not present on the texture. I mean if we use just 2 mips does the engine make the rest of them or not. because if it does not, then that leaves us having to design not only the density of pixels but things might be impovable by using less mips.... actually that might be impossible to visually detect now I think about it, depending on what stage mipmap the engine deals with,(if it is the first mip then that's great, we can see it go from say blue to red and back to blue ... maybe... get what I mean ?:lol: or does it continue on from what is present and it would be blue to red and red continues (because the engine filled in the blanks)
     
    Willy Wale likes this.
  9. Willy Wale

    Willy Wale Member

    Joined:
    Jan 12, 2017
    Messages:
    96
    Likes Received:
    96
    Location:
    UK
    About the mips. I used GIMP to make the DDS which made about 12 levels. I adjusted the colours of the top 8 to be unique but in the test the level 6 one was the smallest the engine chose to use. The other interesting thing was the mips are live in the editor, as you change position the mips update so I could go back and check if level 7 would be selected from twice as far away.
     
  10. Pixelchaser

    Pixelchaser Well-Known Member

    Joined:
    Jan 4, 2015
    Messages:
    1,303
    Likes Received:
    865
    ok, so at present engine maybe uses max 6 pending a check for 7, I think its safe to assume it will make 6 if texture isn't mipmapped.
     
  11. Willy Wale

    Willy Wale Member

    Joined:
    Jan 12, 2017
    Messages:
    96
    Likes Received:
    96
    Location:
    UK
    Could also place the same texture on adjacent objects one with a pre-mipped texture, one with only the top level and compare in game
     
    Pixelchaser likes this.
  12. Pixelchaser

    Pixelchaser Well-Known Member

    Joined:
    Jan 4, 2015
    Messages:
    1,303
    Likes Received:
    865
    indeed, for a while I have not been assigning any mips, just letting engine do its thing. seeing if one was better than the other would be advantageous because it adds so much to file size when I add mips due to some of my techniques. the only issue is you can tell where it changes in the engine mipped version, or if it changes.
     
    Last edited: Mar 31, 2017
  13. Willy Wale

    Willy Wale Member

    Joined:
    Jan 12, 2017
    Messages:
    96
    Likes Received:
    96
    Location:
    UK
    A month ago I didn't know what a mipmap was :lol:
    Best way to learn is by doing though. I'll see what I can do later tonight to include some of the ideas above.
     
    luchian and Pixelchaser like this.
  14. Pixelchaser

    Pixelchaser Well-Known Member

    Joined:
    Jan 4, 2015
    Messages:
    1,303
    Likes Received:
    865
    doing good there !. this is valuable knowledge.
     
    luchian and Willy Wale like this.
  15. Willy Wale

    Willy Wale Member

    Joined:
    Jan 12, 2017
    Messages:
    96
    Likes Received:
    96
    Location:
    UK
    I've been having lots of fun with the GIMP plugin for DDS...

    The main texture and the mips are in layers (as you might expect). It only outputs the layers that are visible, which also makes sense. But, the size of the output DDS is set by whichever layer is selected at the time of pressing export.

    So even if your top level is 1024x1024, if you have clicked the sixth layer the output will be 32x32.

    Might be a useful feature but kept me guessing for a very long time.

    Anyway I can't see the difference between a GIMP generated DDS (texture and 5 mips, total 6 layers) and an engine generated texture. Not to say it's not there but I can't see it. For the billboards the engine uses the same mip level when you are a long way away, you only lose out when very close to the object.

    Video to follow when I can get the sun behind the spawn point to evenly illuminate the billboards.
     
    luchian and Pixelchaser like this.
  16. Pixelchaser

    Pixelchaser Well-Known Member

    Joined:
    Jan 4, 2015
    Messages:
    1,303
    Likes Received:
    865
    point all normals up on the object to make the light all the same. on that topic ive heard of a script, normal theif, it steals normal from the terrain. useful for AC !
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice