Search Unity

  1. Get all the Unite Berlin 2018 news on the blog.
    Dismiss Notice
  2. Unity 2018.2 has arrived! Read about it here.
    Dismiss Notice
  3. Improve your Unity skills with a certified instructor in a private, interactive classroom. Learn more.
    Dismiss Notice
  4. ARCore is out of developer preview! Read about it here.
    Dismiss Notice
  5. Magic Leap’s Lumin SDK Technical Preview for Unity lets you get started creating content for Magic Leap One™. Find more information on our blog!
    Dismiss Notice
  6. 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:
    223
    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:
    4,521
    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:
    223
    @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:
    223
    @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:
    4,521
    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:
    223
    @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:
    223
    @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:
    4,521
    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.