Loading Your Own Mipmaps

Hey all -

For those of you who are part of the fbook group - sorry for the cross-post.

I was curious if there’s a way to provide your own mipmaps to a GLSL MAT. Specifically, I have a pre-filtered cube map (i.e. a mipmapped cube map, where each level has been filtered in a very specific way) that I want to read from in my shader.

[additional details that may or may not matter] I’m using CMFT studio to build an irradiance map for real-time indirect lighting. I can export a .dds version of the final cubemap, which (as I understand it) “bakes” the all of the mipmap levels into one texture. However, Touch doesn’t seem to be able to load this. As an alternative, I can export each mipmap level as it’s own cubemap texture (.hdr or .tga). But again, I don’t know how to reference this “batch” of textures inside the GLSL MAT as a single texture.

I know Touch will automatically generate mipmaps for you if you selected mipmap linear filtering in the sampler settings. But not exactly what I’m looking for… Any help would be appreciated. Thank you!

We support loading pre-baked mipmaps in 2D .dds files, but not cubemaps yet. Can you post your file here and I’ll see how quickly it is to add support?

Sure - there’s nothing really .toe specific here, but I’ve included all of the mipmaps inside of the ‘textures’ folder.
mipmaps.zip (1.12 MB)

Sorry I meant the .dds file that contains everything combined.

Here it is drive.google.com/open?id=0B9Jkm … FZPM3MxMms

The reason this file isn’t loading is because it’s missing mipmap levels. Ii only has 5 while the resolution requires 9 to reduce the image all the way down.
So if you can fill in the other levels (even with black) then it should load fine.
I’ll look into removing this restriction.

Great thanks for the help Malcolm! Got it loaded.

I know I am coming back to an old post, but curious what program/utility you used to generate the dds?
I’ve been trying to find something that works via cmd line but haven’t so far.