Microsoft KB Archive/159025

= Microsoft Knowledge Base =

How 2D Texture Pictures Are Treated at Render Time
Last reviewed: November 27, 1996

Article ID: Q159025

The information in this article applies to:


 * Softimage 3D for IRIX, versions 3.0, 3.5, 3.51

SUMMARY
PIC files are optimized in Softimage 3D in two ways:

  SI Render The paths are looked up and merged if the names are the same and the cropping is the same. Otherwise they are considered different pictures. This means if you use 100 textures using the same image, but each texture crops the picture in different ways, the cropped portion of the picture will be loaded 100 times.   Mental Ray The paths are looked up and merged if the paths are the same regardless of cropping. The pictures are then separated into two groups: sequence static and changing. For the "sequence static" type, the texture references the same picture throughout a sequence. The picture is sent over the network once which saves loading time. With the "changing" type, the picture must be loaded on a per-frame basis. 

You can use the imf_copy application to convert a .pic file to a .map file (an expanded version of the PIC file). Initially, it appears to take up more space, but if a .map file is selected and used as a texture for mental ray, mental ray recognizes the file and maps it in memory rather than loading it. This is called 'memory mapping.'

When loading a picture in memory, mental ray expands its contents and this memory becomes 'swappable.' Memory mapping is a method used by operating systems such as IRIX and Windows NT, where the file itself is used for the swap. Additional loading is not necessary. The only information that is required, is the file name. When a 'page' of memory is needed from the picture, it is loaded directly from the file and the picture file is then expanded (for example, 'raw'). When the page memory is needed for something else, the page is discarded from memory and reused elsewhere. In a non- mapping mode, that page of memory would be swapped to disk, thus wasting time. This means that picture files are READ-ONLY with memory mapping. If you have a shader that writes back to the image buffer, then you are writing back to the file. This is not the case when the file is loaded and then swapped because you are modifying the swapped copy that is eventually discarded when the process ends.