Karma mipmap textures memory usage optimisation

   4480   8   7
User Avatar
Member
30 posts
Joined: Feb. 2021
Offline
Hello,

we are dealing with a vast environment scene, loading a large number of 4k udims chokes the karma render. by using mips we thought we could optimise the io traffic and avoid unnecessary texture data processing. Currently we are using rat files and generally the render is very slow, the memory usage is over 150G. note that the geometry itself is not impacting very much on the memory usage, possibly the displacement is effecting it in part. Any suggestion about how to optimise a karma render from a texture strategy prospective is appreciated.


Moreover, I have a few questions about mipmaps used in karma for debugging purposes, and just to make sure we are using them correctly:

  • how do I display the level info of a rat file? tried to use iinfo command but it does not show it.
  • is any advantage to use mipmaps exrs rather than rat files?
  • can i force the mipmap levels in solaris/karma? the texture node does not seem having a mip level attribute
  • how can I visually debug mipmaps that are applied in the in the render scene? is it possible to output a mip aov in the render?
  • by loading the texture in mplay, does it show individually the mipmap levels?


Cheers,
R.
User Avatar
Staff
2641 posts
Joined: July 2005
Offline
Looking at render stats should help figure out where memory is being used up. With verbosity, the log should show how much memory was used by .rat files and by primvars (including displacement memory). Displacement memory should be better in H19.5.

- .rat files are always MIP Mapped. I don't think there are any tools to extract a specific MIP level.
- imaketxcan be used to make mipmapped .exr or .rat files (or even .tif files). The advantage of .exr is that there are a lot of other tools that can be used (for example houdini ships with hoiiotool- the OIIO Swiss-army knife utility). The disadvantage of mipmapped .exr files is that they are 16 bit float images, so you can't create an 8-bit texture for example.
- karma uses the screen space of the surface to determine the mip levels automatically. The shading quality can be adjusted using the shading quality multiplier in the render settings.
- For debugging mip maps, it's probably best to use .exr files since it's easy to create a map that has different diagnostics on each MIP level
- loading a .rat file in mplay will only display the largest MIP level.
User Avatar
Member
30 posts
Joined: Feb. 2021
Offline
Thanks for the help, these are very useful information.

for some reason I can not get detailed information rendering through pdg and deadline, do you have any tip?

R.
User Avatar
Member
30 posts
Joined: Feb. 2021
Offline
Hello,

I have further question, could large textures influence the io, increasing the network traffic and memory usage in significant way regardless the mipmap level they are using during the rendering?. would be a better strategy make sure the texture size does not exceed the real need of the render scene or it does not really matter if we are using mipmap textures? with mipmaps in Karma will the texture lookup request only the mipmap level necessary for the render for even given sample without trying to load the entire texture?

Cheers
R.
User Avatar
Staff
2641 posts
Joined: July 2005
Offline
Having tiled mipmapped files means that the renderer only loads the portions of the texture that are required for rendering. So this saves on I/O.

Even if you have a 21K x 21K texture (https://visibleearth.nasa.gov/images/73909/december-blue-marble-next-generation-w-topography-and-bathymetry), if it's tiled and mip-mapped, the renderer will only load the portions of the image it needs to render. If you used the .png or .jpg as a texture, then the entire image would have to be read by the renderer.
User Avatar
Member
30 posts
Joined: Feb. 2021
Offline
Cheers Mark
User Avatar
Member
4 posts
Joined: March 2022
Offline
Hello,

I'm bumping this post because i'm also interested about the workflow for ->

can i force the mipmap levels in solaris/karma? the texture node does not seem having a mip level attribute

There is a karma_width attribute on mtlx image node.
It's look like it decrease the quality of the texture.
When using a debug mip mapped exr, i can see the difference in the tiles loaded when increasing the karma_width.

I wanted to check if it was the correct workflow ?

Karma width attribute can be accessed with an editproperties node.

Cheers!
User Avatar
Staff
2641 posts
Joined: July 2005
Offline
In the daily build of H20.5, you should see a recipe (Karma Texture Controls) on the Mtlx Image node that adds the karma specific properties to the node.

This is probably a lot easier than using the edit properties node.
User Avatar
Member
4 posts
Joined: March 2022
Offline
Thanks Mark !

I'm also sharing the reply I've got from the support as it may help others finding this post.

Using recipe to add karma-specific controls to Mtlx Image nodes will add "Texture Width" parameter, which is the preferred way.
There's also "Mtlx Image Width" property (in material properties node under the Shading tab) to apply to the whole object instead of per-image.
Although render geometry settings LOP or karma render properties LOP don't expose it in their UI but it's also possible to apply to multiple objects or globally via edit properties LOP ("karma:object:mtlx_imagewidth")
  • Quick Links