XM Magdalena 3D print, GGeorgy (3D)
LC #42 Pipers Alley

View Full Version : Problem allocation of Memory with Disp map

12-13-2006, 01:03 AM
I am working on a zbush disp map that I had made. When ever I add the Disp map, set approx. editor up (or dont) The render doesnt come out. If I'm in Mental ray it times out and gives up, if I'm in a software render, maya freezes up and am forced to close it out.

My rig is win xp, 4 gigs of ram (3.25 showing), amd 4800 dual core, maya 7.0.

I dont know what to do. I have given up and just used it as a bump map instead. I would really like to get it displaced though. What kind of trouble shooting can I do for the Memory allocation. In the globals I have put it at 1800 for the memory use for the render. If you need me to copy the log file I will.

Can anyone help?

12-13-2006, 06:49 AM
What resolution/format is your displacement file?

Maya only really likes up to 4k resolution maps. Also in mental ray if your using a .tif there is half your problem. Convert your .tif to a .map file and see if that solves your problem.

12-13-2006, 09:19 PM
I believe i saved the disp map as a .bmp

The res is only 1024 or 2048 so no problems there. The final displacement from zbrush would be taking my model from 20k to 1.2 mil.

I know I should be converting maps to a map file but to tell you the truth... i dont know how. Does ZB or photoshop save as maps?

My main problem at this point though is the allocation of memory. Maybe I had the values to high in the approximation editor? I think the Min value was set at 2 and max at 7. Could this be the problem?

12-13-2006, 10:08 PM
If you go to the pixologic documentation (http://www.pixologic.com/zbrush/education/documentation/guides.php)page and download the maya - z pipeline guide, it will tell you everything you need to know about making displacments work from zbrush to mental-ray.

12-14-2006, 12:49 AM
Thanks wabash, but does it trouble shoot my problem or does it just tell me how to do a disp? I am familiar with setting up my shader for displacement but am having trouble with the allocated memory for the render.

Anyone have a solution for me?

I dont mind any suggestions at this point...

12-14-2006, 12:57 AM
are you the using multi-displace2 ( plugin for zbrush to generate your displacement maps? Then converting your .tif file to a .map using imf_copy?
This is the method I've been using. I have not run into problems (at least using 2k rez files w/ mental ray).

12-14-2006, 01:21 AM
Your Approximation editor settings are rather high. Here is a few things I think you should try. You need to trouble shoot your scene, so first of all drop your sub approximation settings. Maybie something to more like 0, 5. You'll find that your render will come out a lot quicker too. If that render is successful (I know it wont look pretty cause of the low settings) Then at least you have narrowed it down to it being your settings are too high.

I very much doubt this is the problem and I would expect your scene to still not render. I am just going at a guess here, but I am thinking that are scene is not rendering because you are using a .bmp file as your displacement. Your probably also using .bmp for your texture files aswell. So I'm going to give you a quick howto, so you can get your images into .map. Because believe it or not this is not only important for your scene to render but it will drop your render time aswell.

1. Open your .bmp files in photoshop, and save them out as a .tif file. For this example lets say we are saving our file in/as: C:/Project/textures/displacement.tif

2. Once you have done this, (I suggest you do this to your textures aswell as bump etc) open up your command like editor. If you dont know how to do this go Start>Run Then type in: cmd

3. Go to your directory. So using cd .. to go down a level and cd <directory> to go up a level you find your directory. Example: If I where to start in.

C:/ProgramFiles/> cd ..
C:/> cd Project/textures

4. Now comes the fun part. You want to first convert your image file to an .sgi, once you have done that you want to convert it to a .map file. Assuming we are still using the above example this is the code you will want to type

First: imgcvt displacement.tif displacement.sgi
Second: imf_copy -r -p displacement.sgi displacement.map

This means you successfully have a .map file for your displacement. Now you just need to do it for the rest of your files. I hope this helps, and if it doesnt at least you will know how to make .map files and you will know that your textures arnt the problem.

Good luck,


12-15-2006, 01:44 AM
Thank you GregOconn... I will try this as soon as I can!! I saw the process on a dvd once but never tried it out. I have used .bmp in the past without a problem (maya -> ZB -> maya). I will try a tiff file first and lower my approx values and see what I can see. Then after all is lost I will try the map conversion. Sounds like alot of work :(

Thanks again, will post after i have tried

12-15-2006, 04:59 AM
Using .tif for mental ray is a big no no.

12-16-2006, 06:49 PM
I just set my approx settings down instead of just jumping in head 1st into the higher values. I didnt convert any file, just used my .bmp

Everything is just fine now. I just started lower and will work my way up with fine tuning. hanks for the help guys.

With my settings at min 2 and max 3 in the approx. ed. everything is fine....
when i go up one more setting I get

allocation of 234881132 bytes failed: flushing
MEM 0.2 info : try '-memory 437' for future runs
GregOconn: I will keep that in mind about no tiffs with mental ray.

12-16-2006, 07:03 PM
why dont u use .map for dis map, my exp with other format, not map in displacement of is terrible

12-19-2006, 01:28 AM
Well I wrote alot more before but my computer here at work crashed, so I will sum it up...

I dont have experience ever doing it, I will have to learn. Does Photoshop save a map file type?
Also, I had already done a very simple animation with my model as just a bump and saw no real difference in the render when I did the disp. instead. So I kept the bump only version. I will have to learn to do a conversion from bmp to map, but I hate the dos style program that I know of to do it. I will have to learn :(
Here is one pic of the model I was working with. Its not the best render, and is not all that complex, but it is my new logo for my new website... Darkseal.com (http://darkseal.com), check it out when you get a few minutes. It does take a minute to load.
again, not the best lighting to really show it off but I will do more next time.
Thanks for the help guys... If you know of a godd tutorial for map conversion please post it!

12-19-2006, 09:27 AM

@IF %1 == "" GOTO end
imf_copy -p %1 "%~d1%~p1%~n1.map"
@GOTO convertfile
@ECHO Done!

save this as convertfile.bat
now with a simple drag and drop you can convert your tiff to map.


01-11-2007, 08:33 PM
drag and drop into where? in photoshop? in maya? where? i would love to know!

edit: or do you mean the cmd??

01-11-2007, 09:50 PM
i found this script on highend3d a while ago, it allows you to convert images to any specific format (including .map) inside maya without dealing with the command prompt and imf_copy. the coolest thing, you can convert them inside maya!


01-12-2007, 09:14 AM
u can create map format in photoshop

francesca luce wrote a script for that - look at mymentalray.com

or search here...

01-12-2007, 06:43 PM
i will check it out as soon as i can, Thanks!!

01-13-2007, 04:33 PM
A couple of further notes.

Memory limit. Do not set it up to 1800. On Windows with Maya and the OS taking up space, there still is not much more than 800 left over for rendering. Any single process is limited to 2G, so the 4G is not getting you much if anything. The default is 800, and it is possible you may need to set it lower. Think of the memory limit as a warning to the renderer that it is getting too close to filling up memory, so it is time to find something to flush out. If you wait too late, it will not have enough room to work. The second part is to make sure that there are pieces of your scene that can be flushed and reconstructed. Note that your scene could seem to have one single large piece.

Fine approximation. Although it is hidden sometimes from direct view in the UI, fine approximation will split up an object into separate parts so that it can be flushed and reconstructed. I think the default subd with displacement approximation does fine, but if you override the default with your own approximation, be careful. From version to version, unfortunately, this is a bit tricky from the UI.

Tiled textures. Tiled textures automatically use the texture cache, thus enabling flushing and reconstructing texture parts from memory. Unfortunately, in Maya 7 they cannot be used with the base maya file node using filtering. This has been fixed in Maya 8. For those that use imf_copy, tiled textures are created using the -r option. So to make a pyramid(mip-mapped) and tiled .map texture, do:
imf_copy -p -r orig.sgi tiled.map
I hope that explains why someone suggested -p -r earlier, while someone else suggested just -p.

Exr. There are two tiled texture formats which work well with mental ray. The first is the .map custom mi texture file format as mentioned above. The second is exr format, which can be made to be mip-mapped and tiled as well. You can download utilities to do this at openexr.com. Use exrmaketiled.

04-11-2007, 12:18 PM

@IF %1 == "" GOTO end
imf_copy -p %1 "%~d1%~p1%~n1.map"
@GOTO convertfile
@ECHO Done!

save this as convertfile.bat
now with a simple drag and drop you can convert your tiff to map.

code works great, going to be very useful Thank you :)
and you just can't convert png to .map? or is a different command required
i have a bunch of png's in use so wondering if i have to convert to tif and then .map or is there a faster way

CGTalk Moderation
04-11-2007, 12:18 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.