Map Optimization



This document describes various techniques to reduce the rendering times of textures in ProFX2. Using these, it is possible to render hundreds of textures in a few seconds. It is therefore very important for artists working on textures for a computer game to read and understand this document, in particular the section about sharing and reusing FXMaps.




I. Understanding the basics


The main idea to keep in mind when trying to reduce the rendering time of textures, is that, generally speaking, rendering procedural noises is slow, whereas applying filters is fast. Therefore, in most cases, optimizing the use of FXMaps in a graph will much be more efficient than working on the filters. As a consequence, most of this document will concentrate on either making FXMaps render faster, or reducing their number.

In the next section, we will review what settings have the most influence on FXMaps rendering times.



II. Optimizing individual FXMaps


There are three major items to be considered regarding individual FXMaps optimization:
1- The FXMaps' resolution. Bigger maps entail increased computation time. Generate maps of various sizes and select the smallest which will provide adequate quality.
2- The bouding box size. The patterns' bouding box size matters just as much as the map resolution. Try reducing them as much as possible, while keeping them larger than the patterns they contain. So reduce them until you start seeing artefacts (vertical or horizontal discontinuities) on your map.
3- The Level of Detail. Try to not specify a level of detail larger than 7.
Compositing Graph

Please note that on the left hand side of the MaPZone2 editor window you can find a set of pre-optimized FXMaps. As we'll see in the next section, re-using FXMaps is also a key for shorter computations. We recommend to use them as often as possible.
If you need to create your own optimized FXMaps, you can also assign them a specific ID (right click on the FXMap) and re-use them in other textures.



III. Computing less FXMaps


A. Sharing and reusing FXMaps


As previously indicated, try to use pre-optimized FXMaps as often as possible.
If you create your own FXMaps, do not hesitate to re-use them, they will be computed only once for all the textures which use them.
Then if you want to re-use a part of your compositing graph from a previously created texture, create external links in your new texture by right clicking in your graph and selecting the "Add External Links..." option. The library dialog box will then be displayed: open a file and select the ressources that you need in a list of available shared ressources in this file.
Shared ressources
This operation creates external links nodes to selected shared ressources in your compositing graph.
External Links nodes
Common shared ressources will be computed only once for multiple textures.
However to get these optimisation working well you will need to merge all the textures of a given level in a single .pfx file. To do that use the Export/Merge tool as described here.


B. Using transforms


Do not hesitate to use the transformations ("Tranform" option just below the compositing graph).
For example if you do a 1k*1k texture using a 256*256 noise, tile it 4x4 times by using the "Scale" option to get a higher level of detail.
However to get a texture which will tile only use a scale factor which is a multiple of 100%, i.e. 200%, 300%, etc.
So if you need a brick wall fo a large texture, make a few bricks that you will tile.
If you want a variation of a specific FXMap noise


IV. Other possible optimizations


- Whenever possible, replace a "Hue Saturation Lum. Shift" filter with a "Colorize+Blend" filter.
- To get a faster Uniform Blur, set up a filter in a lower resolution and then set the next filter in the resolution you want, so the former one will be blured due to interpolation.
- Similarly the Motion Blur filter can be replaced by the use of non-square texture as an input to filters with a square output. The input texture will be stretched and you will get a result similar to a Motion Blur.
- Prefer using a Mix than using some Colorize filters converted to a FX Filter To FXMap.
- When working e.g. on a 1024*1024 texture try to make the smoother noises in 512*512. Then at the end of the CompositingGraph add the higher frequency noise filters in 1024*1024 to take care of the small scale details.
- And of course the less boxes used in your graph the faster it will be

Regarding the relative speed of filters:
- Colorize, Colorize+Blend, Alpha, Uniform Luminosity/Contrast and Uniform Color are the fastest filters do not hesitate to use them.
- DirectionalWarp, Mix and Uniform Mix are a bit slower but really fast too.
- Warp, Emboss,Normal Map and Warp+Emboss are a bit slower. But globally all these filter are fast.
Then come some slower filters to use sparingly:
- Hue Saturation Lum. Shift and Uniform Hue Saturation Lum. which are a bit slower than the filters seen before.
- Motion Blur which is even slower than the "HSL" filters but faster than:
- Uniform Blur and Blur which are the slowest filters.

Regarding imported SVGs remember that these filters rendering speed and the size of their result depend on the precision you specify when you import the file. Usually it is faster to draw a simple shape with an FXMap than with vector file (and the resulting file will be smaller too).


Category:
CategoryGraphism

There are no comments on this page. [Add comment]

Page was generated in 0.5007 seconds