In this part of the 3ds Max rendering tutorial, we will show you practical optimization techniques and tricks which you can apply on your everyday CG workflow.
In the previous part of the optimizing textures guide, we talked about the theory behind digital images like bit depth, compression and color models. These factors have a decisive impact on the size of a texture on a hard drive and RAM.
We know that the texture's size in computer's RAM follows this formula:
Raw image size = Horizontal resolution x Vertical resolution (in pixels) x Number of channels x Color depth (Number of bits per channel)
This part of the tutorial is a continuation of the textures segment and touches on more techniques that can be employed to optimize textures when preparing a scene for rendering, whether locally or on a render farm. At GarageFarm.NET we always place an emphasis on running tests for scenes before rendering at full resolution or at the entire frame range. Doing so helps you not only anticipate render time more accurately but also enables you to apply optimization in whichever part of your scene would be most feasible. We hope this series helps in raising your awareness in the options available. Happy reading!
Photoshop offers a handy tool called Image Processor.
It accepts almost all of the file formats supported by Photoshop as the input. Unfortunately, it's restricted to just three image formats as the output right now: JPG, PSD, and TIFF. The tool also doesn’t have an option to rename file names while re-scaling.
We will describe some workarounds and alternative methods for this problem as well.
1. To use Image Processor choose File → Scripts → Image Processor.
There is no need to open images in Photoshop first before using this tool. You can do it, but with a significant number of images it can slow down your computer and Photoshop performance.
2. After choosing Image Processor, you will see this dialog.
3. Select images to process
4. Select location to save processed images
5. File Type - these options let you choose type and resolution of output files.
6. Preferences
7. Load (Save) - Lets you save and load Image Processor settings as an XML file.8. Run - Runs Image Processor.
8. Run - Runs Image Processor.
Gimp is a free alternative to Photoshop. It has a great plugin called “David’s Batch Processor” which allows batch resizing images.
It is similar to Photoshop's Image Processor, but it supports all the popular file formats and allows you to resize and rename files in one batch.
You can download GIMP here: https://www.gimp.org
And the “David’s Batch Processor” plugin here: http://members.ozemail.com.au/~hodsond/dbp.html
For Windows, just download the zip file with the installer, unpack it and place “dbp.exe” file in GIMP’s plugins path (for example Computer\C:\Program Files\GIMP 2\lib\gimp\2.0\plug-ins)
To batch re-scale multiple images:
1. Run GIMP
2. Run the plugin through Filters → Batch Process
3. You will see a popup window with these options:
1. Input - The input page is used to choose images to process.
2. Resize - Allows you to batch resize images.
Difference between Exact, Padded, Inside and Outside resizing
3. Rename - These options let you batch rename processed images.
The processor will not overwrite an existing file. The output file must be renamed, have its extension changed, or be put into a different directory.
4. Output - This option lets you choose an output format, and it's settings for processed images. It supports all the popular formats used for textures.
5. Start, Cancel - starts and cancels batch processing
6. Test (Show Images) - Runs a preview of processing the first image from the list. You can see the effect of all the adjustments applied from the left to the right of the options window.
7. Turn, Blur, Colour, Crop, Sharpen - Other options you can apply during the batch process. We won't describe them in detail here because they are usually not necessary when resizing textures. If you would like to learn more about options we didn't mention, you can check them on this website: http://members.ozemail.com.au/~hodsond/dbp.html
You can also resize your textures using free online batch image re-scalers, (just type ‘batch image re-scaling' in Google) but the quality might not be as good as in the programs above.
In 3ds Max, you can cut out a shape in your model, using opacity maps (texture). The way they work is simple - the black part of the texture will be transparent, the white part will be opaque, and the shades of grey will be semi-transparent. Opacity maps are handy, for example, if you want to create leaves on a tree. You can create a plane and apply such a map to it, and the shape of the leaf will be cut out from the model during the rendering.
The flaw of this method is that models with opacity maps applied on them tend to render very long.
Below, we will give you some methods of optimizing opacity maps to get shorter render times.
1. First Method - white and black pixels
When the rendering engine calculates opacity, it takes shades of grey as semitransparent and adjusts the level of the transparency to the lightness of the given pixel of the texture. It is much faster for a render engine to calculate pixels which are just white or black than the grey ones. You can create such a map using the following steps:
That way you automatically create much smaller white and black textures.
You can also manually turn up image contrast to the maximum value, using the levels or contrast option in the image editor, but saving it in 2-colors png will give you 100% certainty that there are only two colors: pure black and pure white (RGB 0 and 255).
2. Second Method - blur and filtering
3ds Max blurs and filters textures by default to ensure that no pixels will be visible on rendered materials. If you use black and white opacity map, the edges will be blurred by that process and lengthen the rendering time.
To avoid that, you can turn off blurring and filtering of the map in texture editor.
The test below illustrates the effect of rendering a couple of trees before and after the optimization of opacity maps.
This method will create opacity maps which will have pixelated edges. In most cases, this is not a problem, because during the rendering process most of the render engines apply an anti-aliasing filter which smoothens all the jagged edges.
In close up shots, however, the pixels of opacity maps may be visible. In those cases, use higher resolution map and turn up the level of blurring in texture settings which will give you the desired effect.
Those shaders’ settings (texture slots) are designed to work with the given render engine and will give you much shorter render times. You can use the opacity maps optimized with the method above to get the best results - just apply an optimized texture in the right map slot for the given render engine, and turn off all the filtering options in texture settings. Displacement effects offered by different render engines can create excellent results but usually need a lot of RAM and make the rendering process longer.
NOTE: The displacement which is not visible in the scene will also be calculated to be visible in reflections. Try to reduce the surface of the displacement only to the part which will be visible in the shot. Also, if the object is far away from the camera, or it has very fine details, you can use bump instead of displacement.
Procedural textures are created by a mathematical algorithm, unlike bitmaps which are ready digital images with a fixed resolution.
Their advantage in optimizing rendering of the scene is that they don’t need much RAM, no space on the hard drive, and render pretty fast.
Similar to the vector maps they are scalable without pixels visible in close-ups. Most of them can also be animated.
You can read more about 3ds Max procedural maps here: https://knowledge.autodesk.com/support/3ds-max/learn-explore/caas/CloudHelp/cloudhelp/2017/ENU/3DSMax/files/GUID-783C7A59-F829-41DA-A2A2-E967E516172D-htm.html
Since version 2014, 3ds Max has supported maps saved as vector graphics. You can use them by loading a vector image to the VectorMap in a similar way to a Bitmap.
The Vector map supports a variety of industry-standard vector-graphic formats, like AI (Adobe Illustrator), PDF, PAT, SVG, and SVGZ.
The most significant advantage of this texture format is that no matter how far away or close to the texture the camera is, they are always sharp. Thanks to that you don't need to use high-resolution raster maps which require significant amounts of RAM and space on your drive.
Vector maps work the best for posterized and simple images like logos, artworks or cartoon textures. In case of cartoons, they give a possibility of animating a texture, and you don't need to worry that you will see pixels on color edges in any shot.
You can create vector textures based on raster images in programs like Photoshop or Inkscape. There are many free online converters online too, but not all of them work correctly.
The software which is very simple and can help you create vector maps is Vector Magic. It has both web and desktop versions.
NOTE: Some third-party render engines can have issues with rendering that kind of maps.
If you would like to read more about vector maps in 3ds Max, here is a link to a more detailed source: https://knowledge.autodesk.com/support/3ds-max/learn-explore/caas/CloudHelp/cloudhelp/2016/ENU/3DSMax/files/GUID-6C868265-792B-4553-B633-575D1895C611-htm.html
3ds Max Bitmap Pager is a tool not used much anymore, but since we are talking about textures, it is worth mentioning.
It is a tool which was very useful on 32bit systems, which restricted RAM usage to around 3 GB. Today's 64 bit systems don't have this barrier, so lack of RAM for rendering big images and heavy textures happens less often.
Bitmap pager allows the system to divide big textures, a big number of textures or big resolution rendered image which won't fit into memory into smaller pieces, (pages) and to save them temporarily on a hard drive. Because Pager operates by swapping memory to disk, it can lengthen the rendering process a lot.
That’s why the Bitmap Pager UI has been completely removed from the Customize→Preferences tab. It is also turned off by default.If you want to check if this option is turned off, or you want to turn it on, you can do this in:
Rendering → Render Setup → Common → Bitmap Performance and Memory Options
You can turn Bitmap Paging on in the Setup options:
You can also check if the option is turned on and turn it off in Asset Tracking tool (shift + t) → Bitmap Performance and Memory → Enable Bitmap Paging. The option can be ticked on or off there.
NOTE: In case of using external render farms which usually use network drives this option can create errors in rendering and extend render times.
You can read more about bitmap pager here: https://knowledge.autodesk.com/support/3ds-max/learn-explore/caas/sfdcarticles/sfdcarticles/Guidelines-for-using-Bitmap-Pager.html
Optimizing textures can reduce the amount of RAM which your scene needs to render, and in some cases also reduce the render time.
Using compressed file formats will reduce the disk space needed by your project and amount of time required to upload it to nodes and open in a 3d application in network rendering. However, the compression itself doesn't change the amount of RAM needed to render the scene.
It is good to reduce the resolution, the number of channels and bit depth of textures only to be enough to get the quality of a rendered image that you need. You can use automated tools in image editing software to prepare your textures that way.
In case of transparency/opacity effects, it is better to use the shader options provided by the render engine than to use Opacity slot in materials settings and to use the texture with as low bit depth as possible and turn off filtering.
Procedural maps are very fast and don't take HDD space, so it is good to use them when it is possible. They are also very easily adjustable. When it comes to vector maps, in case of cartoon style and simple graphic signs they can save you from using big resolution raster textures.
www.wikipedia.org
https://knowledge.autodesk.com/
https://helpx.adobe.com/support.html
Own experience and tests
CG Society, 3d Total forums
ThioJoeTech Youtube channel
All tests were run on 3ds Max 2016 and Vray 3.40.03.
www.hdrlabs.com/tools/links.html - links to many openEXR editors
This guide has been created by Michał Moś and edited with the help of the team at GarageFarm.NET. We derived most of the knowledge used in this guide from own experience as well as from the Autodesk Knowledge Network. Textures used in the tests are from www.textures.com
https://michalmos.carbonmade.com
https://garagefarm.net/
Comments