• About us
  • Contact Us
  • Terms and Conditions
  • Forum
  • Materials
  • Shaders
  • Tools
  • Video
  • Learn
  • Gallery
My Mental Ray

Navigation

  • Main Page
  • Cookbook

MYMR WIKI Tools

  • Creating pages
  • Markup n styles
  • Page protection
  • Help

 

Toolbox

  • Upload file
  • Special pages
  • Printable version
  • Permanent link
Article    Discussion    View source    History   
Personal tools
  • Log in / create account

High resolution textures

From Wiki

Jump to: navigation , search

You are here: mental ray cookbook / high resolution textures

.map file format

For using very high resolution images as textures with limited memory, mental ray supports a special image file format: memory-mapped, tiled textures, file extension .map

mental ray can access these .map files in small pieces (or tiles), so it never has to load the entire image into memory. Additionally, .map files can be pre-filtered for fast anti-aliasing, which is important if you have a ultra-highres texture in the far distance, as many hundreds of pixels are collapsed into one screen pixel while rendering.

mental images provides a command line tool called imf_copy to convert images into .map format. This tool ships with XSI and Maya as well as the mr books, unfortunately not (yet) with 3ds Max. If you then run 'imf_copy -vpr infile outfile.map', it will create a tiled image with a filter pyramid. Note that the .map file will most likely become very large on disk.

Unfortunately, 3ds Max 2009 does not support .map files natively, but you can uncomment the mib_texture_lookup2 shader from base.mi and use that instead of a bitmap texture. It does not have the nice controls such as offset or tiling but at least it can load .map natively.

Here are some instructions by Dave from maxplugins.de:

  • First you need to edit your 'base.mi' and find the GUI settings for 'mib_texture_lookup2'. After making a backup copy of your 'base.mi', add a # in front of the word "hidden" like this:
gui "gui_mib_texture_lookup2" {
  control "Global" "Global" (
    # "hidden"
  )
}
  • Now open Max, and everywhere you would normally use a bitmap, you can use mib_texture_lookup2 and put your .map file in the texture slot. The factor setting is for tiling, so 1.0 is the standard setting.
  • The main drawback is that there is no way of duplicating the settings you normally have for a bitmap, such as UV offset, blur settings etc.
  • A different way of sneaking .map files into 3ds Max is by renaming them to something the 3ds Max bitmap loader accepts. During rendering, mental ray will recognize the correct format of the bitmap regardless of the extension used and therefore use the .map file without errors. You should turn off preview in the bitmap loader or you might get errors because 3ds Max cannot make sense of the data.

Note: For this to work you have to enable the mental ray Map Manager in the Rendering options. Alternatively, you can just use the normal bitmap loader of 3ds Max and load some dummy texture and then change the filename to your .map file using MAXScript.

.exr file format

Similar to the .map format, the opensource OpenEXR file format also allows to store pixels either as scan lines or as tiles. Tiled image files allow random-access to rectangular sub-regions of an image, and can therefore avoid having the entire image in memory. Additionally, multiple versions of a tiled image, each with a different resolution, can be stored in a single multiresolution OpenEXR file. These multiresolution images, often called "mipmaps" or "ripmaps", can be used as texture maps to accelerate filtering during texture lookup.

The freely available OpenEXR library download comes with a command line application called exrmaketiled that allows generating tiled and rip/mipmapped images from an .exr file. See the EXR documentation for more details.

mental ray fully supports tiled EXR, as well as tiled EXR with filter pyramids.

External links

  • mental ray .map Converter and Collector v1.1 by David Baker. This is a MAXScript to automatically convert all your images to .map format


--MartinB 13:56, 19 August 2007 (PDT)

Retrieved from "http://mymentalray.com/wiki/index.php/High_resolution_textures"
Copyright © 2008 My Mental Ray Community. All Rights Reserved.
No part of this website may be reproduced unless for personal use without prior written permission from The My Mental Ray Community.