Search Unity

  1. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  2. Improved Prefab workflow (includes Nested Prefabs!), 2D isometric Tilemap and more! Get the 2018.3 Beta now.
    Dismiss Notice
  3. Want more efficiency in your development work? Sign up to receive weekly tech and creative know-how from Unity experts.
    Dismiss Notice
  4. Participate with students all over the world and build projects to teach people. Join now!
    Dismiss Notice
  5. Build games and experiences that can load instantly and without install. Explore the Project Tiny Preview today!
    Dismiss Notice
  6. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice
  7. Want to see the most recent patch releases? Take a peek at the patch release page.
    Dismiss Notice

Kaiser Mip Map filtering for Texture array?

Discussion in 'General Graphics' started by deverolirc, Jul 11, 2018.

  1. deverolirc

    deverolirc

    Joined:
    Jan 19, 2014
    Posts:
    263
    Does anyone know how to make mipmaps use kaiser filtering on an existing texture array? The kaiser filtering is only available on the texture importer which texture arrays do not use. I am not a programmer so I would not know how to write some crazy custom importer... Is there any easy solution to this?

    Thanks in advance!
     
  2. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    5,285
    Where are you getting the textures you're filling the array with? Usually you're importing individual textures in the normal way, then constructing the texture array from those assets. If that's the case, you just need to select Kaiser filtering on those assets, and the copied mip will have it applied.
     
  3. deverolirc

    deverolirc

    Joined:
    Jan 19, 2014
    Posts:
    263
    @bgolus
    The array is being generated via Jason Booths Micro Splat terrain shader. I had a previous custom terrain shader but wanted to go with arrays, one of the things that really helped the crispness of the textures was kaiser mip maps.
    I contacted Jason about this he was quite busy but he mentioned it was only exposed in the texture importer some custom system.
    I am not at the office right now however the method you mentioned sounds promising, if I’m not mistaken they were already set to kaiser but I did not seem to be when they were in the array, does it regen the mip maps possibly?

    Thanks!
     
  4. deverolirc

    deverolirc

    Joined:
    Jan 19, 2014
    Posts:
    263
    @bgolus I mentioned this to Jason, he said the following..
    No, because I don’t just copy the nips, I rather blit the textures to new buffers and reconstruct any missing channels, then generate the mips with unity’s built in function, which doesn’t expose the filter options.
     
  5. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    5,285
    Ah, yes. I seem to remember for MegaSplat he had the option to supply the textures already in the correct layout which would have solved this. But yes, textures generated from script generate the mip maps via the default GPU utilities (which is to say, only via pixel averaging). Jason would have to write his own kaiser downsampling shader and generate the mips one by one, or export the texture to disk, import, and copy back (which is possible, but a path fraught with pain). Jason isn't likely to do that unless he gets a lot of requests for it, he's a staunch believer in the path of good enough. I believe his solution was to use a minor amount of mip biasing.
     
  6. deverolirc

    deverolirc

    Joined:
    Jan 19, 2014
    Posts:
    263
    @bgolus Ahh, that is to bad. Will probably just continue with my own shader then.

    Thanks for the help!
     
  7. deverolirc

    deverolirc

    Joined:
    Jan 19, 2014
    Posts:
    263
    @bgolus Oh, speaking of mip biasing, do you think it would be a large performance hit using a -1 mip bias on 4 terrain textures for newer Apple devices? It really sharpens the terrain up nicely.
     
  8. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    5,285
    It'll certainly be a performance hit, but I couldn't quantify it with my knowledge. I don't focus on mobile much. To be fair I'm not sure I could quantify the performance impact on desktop or console either, I just know on mobile it'll be more than those platforms as the bandwidth is reduced.
     
    deverolirc likes this.