User Tools

Site Tools


arma3:terrain:convert-layers-png-fast

This is an old revision of the document!


Convert Layers\*.png Fast

Using ArmA 3 ImageToPAA.exe - howto convert satellite texture/mask very quickly.

If you get tired of waiting Terrain Builder buldozer to finish converting layers directory PNG files to PAA format, then you can setup ImageToPAA to run this faster.

Make a .bat file in your data\ directory, copy paste the following.

_run_png2paa-start.bat:

for /F "Tokens=2* skip=2" %%A In ('REG QUERY "HKEY_CURRENT_USER\SOFTWARE\Bohemia Interactive\imagetopaa" /v "Tool"') DO SET ImageToPAAPath=%%B

rem mask - quick, as they are simple images with few colors
START "" /D"%CD%" /B "%ImageToPAAPath%" layers\m_*.png

rem satellite texture
rem 1st
START "" /D"%CD%" /B "%ImageToPAAPath%" layers\s_00*.png

rem 2nd
START "" /D"%CD%" /B "%ImageToPAAPath%" layers\s_01*.png

rem 3rd
START "" /D"%CD%" /B "%ImageToPAAPath%" layers\s_02*.png

rem 4th
START "" /D"%CD%" /B "%ImageToPAAPath%" layers\s_03*.png

rem 5th
START "" /D"%CD%" /B "%ImageToPAAPath%" layers\s_04*.png

Now run the batch file. What happens now is that six (6) ImageToPAA processes are run at the same time. You can see the PNG's get converted much faster than what buldozer does, or single ImageToPAA would do alone.

The trick is that when buldozer does one PNG at the time, these ImageToPAA's will convert six at the time. This means that you need to have Dual or Quad Core processor so it spreads out the load to the separate CPU cores.

Of course you can tweak the number of processes run, but on large satellite texture sizes the PNG's range from 000 up to 042 or even more. Please adjust the .bat file to meet PNG's of your project.

For example if you have PNG files ranging up to lets say S_060_000_lco.png then you must add more imagetopaa startup lines, like this:

rem 6th
START "" /D"%CD%" /B "%ImageToPAAPath%" layers\s_05*.png

rem 7th
START "" /D"%CD%" /B "%ImageToPAAPath%" layers\s_06*.png

The problem comes with so many PNG imagetopaa processes to start you run out of CPU cores as every core is busy with 100% usage, this makes you windows sluggish where you almost cannot do anything else. Even the original s_04* startup setup fills quad core machines 4 cores, but only for a short time.

People with more CPU cores of course can convert even more PNG ranges at once.

Greetings to Pennyworth for the high tech registry path reading magic.

Reference original arma2 howto convert layers\*.png fast.

arma3/terrain/convert-layers-png-fast.1482824774.txt.gz · Last modified: 2016-12-27 07:46 by snakeman