User Tools

Site Tools


arma3:terrain:convert-layers-png-fast

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
arma3:terrain:convert-layers-png-fast [2016-12-27 07:46]
snakeman created convert-layers-png-fast initial page.
arma3:terrain:convert-layers-png-fast [2019-01-22 19:03]
snakeman fix for _nohq instead of _no.
Line 1: Line 1:
 ====== Convert Layers\*.png Fast ====== ====== Convert Layers\*.png Fast ======
  
-**Using ArmA 3 ImageToPAA.exe** - howto convert satellite texture/​mask very quickly.+**Using ArmA 3 ImageToPAA.exe** - HOWTO convert satellite texture/​mask ​PNGs to PAAs very quickly.
  
-If you get tired of waiting [[arma3:​tools:​terrain-builder|Terrain Builder]] buldozer to finish converting layers directory PNG files to PAA format, then you can setup ImageToPAA to run this faster.+If you get tired of waiting [[arma3:​tools:​terrain-builder|Terrain Builder]] buldozer to finish converting layers directory PNG files to PAA format, then you can setup ImageToPAA to run this faster. The more COREs your processor has, the more quickly you can convert.
  
-Make a .bat file in your data\ directory, copy paste the following.+Make a .bat file in your MyTerrain\data\ directory, copy paste the following.
  
-**_run_png2paa-start.bat:**+**_run_png2paa-start_3_core.bat:**
 <code dos> <code dos>
 for /F "​Tokens=2* skip=2"​ %%A In ('REG QUERY "​HKEY_CURRENT_USER\SOFTWARE\Bohemia Interactive\imagetopaa"​ /v "​Tool"'​) DO SET ImageToPAAPath=%%B for /F "​Tokens=2* skip=2"​ %%A In ('REG QUERY "​HKEY_CURRENT_USER\SOFTWARE\Bohemia Interactive\imagetopaa"​ /v "​Tool"'​) DO SET ImageToPAAPath=%%B
 +
 +rem satellite texture
 +START ""​ /​D"​%CD%"​ /B "​%ImageToPAAPath%"​ layers\s_00?​_???​_lco.png
 +START ""​ /​D"​%CD%"​ /B "​%ImageToPAAPath%"​ layers\s_01?​_???​_lco.png
 +START ""​ /​D"​%CD%"​ /B /WAIT "​%ImageToPAAPath%"​ layers\s_02?​_???​_lco.png
 +
 +START ""​ /​D"​%CD%"​ /B "​%ImageToPAAPath%"​ layers\s_03?​_???​_lco.png
 +START ""​ /​D"​%CD%"​ /B "​%ImageToPAAPath%"​ layers\s_04?​_???​_lco.png
 +START ""​ /​D"​%CD%"​ /B /WAIT "​%ImageToPAAPath%"​ layers\s_05?​_???​_lco.png
 +
 +START ""​ /​D"​%CD%"​ /B "​%ImageToPAAPath%"​ layers\s_06?​_???​_lco.png
 +START ""​ /​D"​%CD%"​ /B "​%ImageToPAAPath%"​ layers\s_07?​_???​_lco.png
 +START ""​ /​D"​%CD%"​ /B /WAIT "​%ImageToPAAPath%"​ layers\s_08?​_???​_lco.png
 +
 +START ""​ /​D"​%CD%"​ /B "​%ImageToPAAPath%"​ layers\s_09?​_???​_lco.png
 +START ""​ /​D"​%CD%"​ /B "​%ImageToPAAPath%"​ layers\s_10?​_???​_lco.png
 +START ""​ /​D"​%CD%"​ /B /WAIT "​%ImageToPAAPath%"​ layers\s_11?​_???​_lco.png
 +
 +START ""​ /​D"​%CD%"​ /B "​%ImageToPAAPath%"​ layers\s_12?​_???​_lco.png
 +START ""​ /​D"​%CD%"​ /B "​%ImageToPAAPath%"​ layers\s_13?​_???​_lco.png
  
 rem mask - quick, as they are simple images with few colors rem mask - quick, as they are simple images with few colors
-START ""​ /​D"​%CD%"​ /B "​%ImageToPAAPath%"​ layers\m_*.png+START ""​ /​D"​%CD%"​ /B /WAIT "​%ImageToPAAPath%"​ layers\m_00?​_???​_lca.png
  
-rem satellite texture +START ""​ /​D"​%CD%"​ /B "​%ImageToPAAPath%"​ layers\m_01?​_???​_lca.png 
-rem 1st +START ""​ /​D"​%CD%"​ /B "​%ImageToPAAPath%"​ layers\m_02?​_???​_lca.png 
-START ""​ /​D"​%CD%"​ /B "​%ImageToPAAPath%"​ layers\s_00*.png+START ""​ /​D"​%CD%"​ /B /WAIT "​%ImageToPAAPath%"​ layers\m_03?​_???​_lca.png
  
-rem 2nd +START ""​ /​D"​%CD%"​ /B "​%ImageToPAAPath%"​ layers\m_04?​_???​_lca.png 
-START ""​ /​D"​%CD%"​ /B "​%ImageToPAAPath%"​ layers\s_01*.png+START ""​ /​D"​%CD%"​ /B "​%ImageToPAAPath%"​ layers\m_05?​_???​_lca.png 
 +START ""​ /​D"​%CD%"​ /B /WAIT "​%ImageToPAAPath%"​ layers\m_06?​_???​_lca.png
  
-rem 3rd +START ""​ /​D"​%CD%"​ /B "​%ImageToPAAPath%"​ layers\m_07?​_???​_lca.png 
-START ""​ /​D"​%CD%"​ /B "​%ImageToPAAPath%"​ layers\s_02*.png+START ""​ /​D"​%CD%"​ /B "​%ImageToPAAPath%"​ layers\m_08?​_???​_lca.png 
 +START ""​ /​D"​%CD%"​ /B /WAIT "​%ImageToPAAPath%"​ layers\m_09?​_???​_lca.png
  
-rem 4th +START ""​ /​D"​%CD%"​ /B "​%ImageToPAAPath%"​ layers\m_10?​_???​_lca.png 
-START ""​ /​D"​%CD%"​ /B "​%ImageToPAAPath%"​ layers\s_03*.png+START ""​ /​D"​%CD%"​ /B "​%ImageToPAAPath%"​ layers\m_11?​_???​_lca.png 
 +START ""​ /​D"​%CD%"​ /B /WAIT "​%ImageToPAAPath%"​ layers\m_12?​_???​_lca.png
  
-rem 5th +START ""​ /​D"​%CD%"​ /B "​%ImageToPAAPath%"​ layers\m_13?​_???​_lca.png 
-START ""​ /​D"​%CD%"​ /B "​%ImageToPAAPath%"​ layers\s_04*.png+ 
 +rem normal map - if you dont use it no problem, its just skipped 
 +START ""​ /​D"​%CD%"​ /B /WAIT "​%ImageToPAAPath%"​ layers\n_00?​_???​_nohq.png 
 + 
 +START ""​ /​D"​%CD%"​ /B "​%ImageToPAAPath%"​ layers\n_01?​_???​_nohq.png 
 +START ""​ /​D"​%CD%"​ /B "​%ImageToPAAPath%"​ layers\n_02?​_???​_nohq.png 
 +START ""​ /​D"​%CD%"​ /B /WAIT "​%ImageToPAAPath%"​ layers\n_03?​_???​_nohq.png 
 + 
 +START ""​ /​D"​%CD%"​ /B "​%ImageToPAAPath%"​ layers\n_04?​_???​_nohq.png 
 +START ""​ /​D"​%CD%"​ /B "​%ImageToPAAPath%"​ layers\n_05?​_???​_nohq.png 
 +START ""​ /​D"​%CD%"​ /B /WAIT "​%ImageToPAAPath%"​ layers\n_06?​_???​_nohq.png 
 + 
 +START ""​ /​D"​%CD%"​ /B "​%ImageToPAAPath%"​ layers\n_07?​_???​_nohq.png 
 +START ""​ /​D"​%CD%"​ /B "​%ImageToPAAPath%"​ layers\n_08?​_???​_nohq.png 
 +START ""​ /​D"​%CD%"​ /B /WAIT "​%ImageToPAAPath%"​ layers\n_09?​_???​_nohq.png 
 + 
 +START ""​ /​D"​%CD%"​ /B "​%ImageToPAAPath%"​ layers\n_10?​_???​_nohq.png 
 +START ""​ /​D"​%CD%"​ /B "​%ImageToPAAPath%"​ layers\n_11?​_???​_nohq.png 
 +START ""​ /​D"​%CD%"​ /B /WAIT "​%ImageToPAAPath%"​ layers\n_12?​_???​_nohq.png 
 + 
 +START ""​ /​D"​%CD%"​ /B "​%ImageToPAAPath%"​ layers\n_13?​_???​_nohq.png
 </​code>​ </​code>​
  
-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.+Now run the batch file. What happens now is that three (3) 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.+The trick is that when buldozer does one PNG at the time, these ImageToPAA'​s will convert ​three at the time. This means that you need to have Quad Core processor ​or better ​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 morePlease adjust ​the .bat file to meet PNG's of your project.+The "/​WAIT"​ parameter ​of the command line tells "​start" ​to pause until all commands have been executed to that pointIf you move the /wait parameter you can add more imagetopaa processes ​to run (see below).
  
-For example if you have PNG files ranging up to lets say S_060_000_lco.png then you must add more imagetopaa startup lineslike this:+If you use too many imagetopaa processes it will cause your windows desktop ​to be very sluggish to the point that you cannot use other software as imagetopaa'​s are hogging all the CPU resources. Do not add more processes than you have cores in your CPUalso take into consideration other software you run which uses cores. 
 + 
 +People with more CPU cores of course can convert even more PNG ranges at once. Below is example of crazy 7 core bat file. 
 + 
 +**_run_png2paa-start_7_core.bat:**
 <code dos> <code dos>
-rem 6th +for /F "​Tokens=2* skip=2" %%A In ('REG QUERY "​HKEY_CURRENT_USER\SOFTWARE\Bohemia Interactive\imagetopaa" /"Tool"'​) DO SET ImageToPAAPath=%%B
-START "" ​/D"%CD%" /"%ImageToPAAPath%" layers\s_05*.png+
  
-rem 7th +rem satellite texture 
-START ""​ /​D"​%CD%"​ /B "​%ImageToPAAPath%"​ layers\s_06*.png +START ""​ /​D"​%CD%"​ /B "​%ImageToPAAPath%"​ layers\s_00?​_???​_lco.png 
-</code>+START "" ​/D"​%CD%"​ /B "​%ImageToPAAPath%"​ layers\s_01?​_???​_lco.png
  
-The problem comes with so many PNG imagetopaa processes to start you run out of CPU cores as every core is busy with 100usage, this makes you windows sluggish where you almost cannot do anything elseEven the original s_04* startup setup fills quad core machines 4 cores, but only for a short time.+START ""​ /D"%CD%" /B "​%ImageToPAAPath%"​ layers\s_02?​_???​_lco.png 
 +START ""​ /​D"​%CD%"​ /B "​%ImageToPAAPath%"​ layers\s_03?​_???​_lco.png
  
-People ​with more CPU cores of course can convert even more PNG ranges at once.+START ""​ /​D"​%CD%"​ /B "​%ImageToPAAPath%"​ layers\s_04?​_???​_lco.png 
 +START ""​ /​D"​%CD%"​ /B "​%ImageToPAAPath%"​ layers\s_05?​_???​_lco.png 
 + 
 +START ""​ /​D"​%CD%"​ /B /WAIT "​%ImageToPAAPath%"​ layers\s_06?​_???​_lco.png 
 +START ""​ /​D"​%CD%"​ /B "​%ImageToPAAPath%"​ layers\s_07?​_???​_lco.png 
 + 
 +START ""​ /​D"​%CD%"​ /B "​%ImageToPAAPath%"​ layers\s_08?​_???​_lco.png 
 +START ""​ /​D"​%CD%"​ /B "​%ImageToPAAPath%"​ layers\s_09?​_???​_lco.png 
 + 
 +START ""​ /​D"​%CD%"​ /B "​%ImageToPAAPath%"​ layers\s_10?​_???​_lco.png 
 +START ""​ /​D"​%CD%"​ /B "​%ImageToPAAPath%"​ layers\s_11?​_???​_lco.png 
 + 
 +START ""​ /​D"​%CD%"​ /B "​%ImageToPAAPath%"​ layers\s_12?​_???​_lco.png 
 +START ""​ /​D"​%CD%"​ /B "​%ImageToPAAPath%"​ layers\s_13?​_???​_lco.png 
 + 
 +rem mask - quick, as they are simple images ​with few colors 
 +START ""​ /​D"​%CD%"​ /B "​%ImageToPAAPath%"​ layers\m_00?​_???​_lca.png 
 +START ""​ /​D"​%CD%"​ /B /WAIT "​%ImageToPAAPath%"​ layers\m_01?​_???​_lca.png 
 + 
 +START ""​ /​D"​%CD%"​ /B "​%ImageToPAAPath%"​ layers\m_02?​_???​_lca.png 
 +START ""​ /​D"​%CD%"​ /B "​%ImageToPAAPath%"​ layers\m_03?​_???​_lca.png 
 + 
 +START ""​ /​D"​%CD%"​ /B "​%ImageToPAAPath%"​ layers\m_04?​_???​_lca.png 
 +START ""​ /​D"​%CD%"​ /B "​%ImageToPAAPath%"​ layers\m_05?​_???​_lca.png 
 + 
 +START ""​ /​D"​%CD%"​ /B "​%ImageToPAAPath%"​ layers\m_06?​_???​_lca.png 
 +START ""​ /​D"​%CD%"​ /B "​%ImageToPAAPath%"​ layers\m_07?​_???​_lca.png 
 + 
 +START ""​ /​D"​%CD%"​ /B /WAIT "​%ImageToPAAPath%"​ layers\m_08?​_???​_lca.png 
 +START ""​ /​D"​%CD%"​ /B "​%ImageToPAAPath%"​ layers\m_09?​_???​_lca.png 
 + 
 +START ""​ /​D"​%CD%"​ /B "​%ImageToPAAPath%"​ layers\m_10?​_???​_lca.png 
 +START ""​ /​D"​%CD%"​ /B "​%ImageToPAAPath%"​ layers\m_11?​_???​_lca.png 
 + 
 +START ""​ /​D"​%CD%"​ /B "​%ImageToPAAPath%"​ layers\m_12?​_???​_lca.png 
 +START ""​ /​D"​%CD%"​ /B "​%ImageToPAAPath%"​ layers\m_13?​_???​_lca.png 
 + 
 +rem normal map - if you dont use it no problem, its just skipped 
 +START ""​ /​D"​%CD%"​ /B /WAIT "​%ImageToPAAPath%"​ layers\n_00?​_???​_nohq.png 
 + 
 +START ""​ /​D"​%CD%"​ /B "​%ImageToPAAPath%"​ layers\n_01?​_???​_nohq.png 
 +START ""​ /​D"​%CD%"​ /B "​%ImageToPAAPath%"​ layers\n_02?​_???​_nohq.png 
 +START ""​ /​D"​%CD%"​ /B "​%ImageToPAAPath%"​ layers\n_03?​_???​_nohq.png 
 + 
 +START ""​ /​D"​%CD%"​ /B "​%ImageToPAAPath%"​ layers\n_04?​_???​_nohq.png 
 +START ""​ /​D"​%CD%"​ /B "​%ImageToPAAPath%"​ layers\n_05?​_???​_nohq.png 
 +START ""​ /​D"​%CD%"​ /B "​%ImageToPAAPath%"​ layers\n_06?​_???​_nohq.png 
 + 
 +START ""​ /​D"​%CD%"​ /B /WAIT "​%ImageToPAAPath%"​ layers\n_07?​_???​_nohq.png 
 +START ""​ /​D"​%CD%"​ /B "​%ImageToPAAPath%"​ layers\n_08?​_???​_nohq.png 
 +START ""​ /​D"​%CD%"​ /B "​%ImageToPAAPath%"​ layers\n_09?​_???​_nohq.png 
 + 
 +START ""​ /​D"​%CD%"​ /B "​%ImageToPAAPath%"​ layers\n_10?​_???​_nohq.png 
 +START ""​ /​D"​%CD%"​ /B "​%ImageToPAAPath%"​ layers\n_11?​_???​_nohq.png 
 +START ""​ /​D"​%CD%"​ /B "​%ImageToPAAPath%"​ layers\n_12?​_???​_nohq.png 
 + 
 +START ""​ /​D"​%CD%"​ /B "​%ImageToPAAPath%"​ layers\n_13?​_???​_nohq.png 
 +</​code>​
  
 Greetings to Pennyworth for the high tech registry path reading magic. Greetings to Pennyworth for the high tech registry path reading magic.
  
 Reference original [[arma2:​terrain:​howto-convert-layers-png-fast|arma2 howto convert layers\*.png fast]]. Reference original [[arma2:​terrain:​howto-convert-layers-png-fast|arma2 howto convert layers\*.png fast]].
arma3/terrain/convert-layers-png-fast.txt · Last modified: 2019-01-22 19:03 by snakeman