Mipmapped textures and Karma

   4708   5   1
User Avatar
Member
4 posts
Joined:
Offline
Hi,

Does Karma expect textures to be mipmapped prior to rendering, or can it auto generate them on the fly? I see there is a "imaketx" tool that shipped with 18.5 . Do we need to use that exclusively, or will it accept .tx files generated with txmake/maketx?

Thanks,
Chris
User Avatar
Staff
2630 posts
Joined: July 2005
Offline
Karma works best with mip-mapped .exr or .rat files which can be created with imaketx. For tiled, mip-mapped .exr files, you can also use tools like maketx or txmake. Karma should also work with tiled, mip-mapped .tif textures.

If you have .png or .jpg files as textures, there are two modes that karma can use to process these. Both of these modes will use significantly more memory and probably take longer for time to first pixel. So tiled, mip-mapped textures are better.

The default mode is to use OpenImageIO for texturing. There are a lot of ways to control auto-mip generation, cache, tiling etc. (see https://openimageio.readthedocs.io/en/latest/imagecache.html [openimageio.readthedocs.io] and setting the OPENIMAGEIO_IMAGECACHE_OPTIONS environment variable).

The other mode is to use Houdini's internal texture filtering, which can be enabled by setting HOUDINI_ENABLE_EXR_TEXTURE=0.
User Avatar
Member
4 posts
Joined:
Offline
Great info, thank you Mark.

To clarify about using .pngs or .jpgs, are you saying Karma does not accept mipmapped .png files that have been processed beforehand? For example, could I run maketx on my .png texture and use the resulting .tx file with Karma?
User Avatar
Staff
2630 posts
Joined: July 2005
Offline
If you run imaketx on the source .png file and create a .tx file, the .tx file will not be stored as a .png file.
% maketx foo.png -o foo.tx
% iinfo foo.tx
File: ./foo.tx (TIFF format)
Resolution: 256 x 256
Data: 8 bit integer
Color Model: RGBA
...
And it will be tiled and mip-mapped (as a .tif file). And it will work well with Karma.
Edited by mark - Feb. 24, 2022 16:32:13
User Avatar
Member
8038 posts
Joined: Sept. 2011
Offline
mark
The default mode is to use OpenImageIO for texturing. There are a lot of ways to control auto-mip generation, cache, tiling etc. (see https://openimageio.readthedocs.io/en/latest/imagecache.html [openimageio.readthedocs.io] and setting the OPENIMAGEIO_IMAGECACHE_OPTIONS environment variable).

The other mode is to use Houdini's internal texture filtering, which can be enabled by setting HOUDINI_ENABLE_EXR_TEXTURE=0.

Have you noticed the filtering of textures with OCIO vs Houdini native seems more broad? To get the same texture sharpness, I find I have to set filter width to 0.5 when using OCIO filtering.
User Avatar
Member
1 posts
Joined: March 2015
Offline
I tried adding some variables as shown here to configure OpenImageIO texture cache options https://www.sidefx.com/docs/houdini/ref/env.html [www.sidefx.com]

I tried this example
OPENIMAGEIO_IMAGECACHE_OPTIONS=max_memory_MB=512.0,max_open_files=50

But after including it in my Houdini env file I get no result from rendering with Karma, cpu is definitely showing some action, but I have yet to reach first pixel on light scene after many minutes.
  • Quick Links