Difference between revisions of "Generate a MegaTexture"

From Mod Wiki
(straight copy of megabuild article for use with the new SDK launcher)
 
(Updated with info matching the SDK launcher)
Line 1: Line 1:
The ETQW SDK Launcher includes all the settings required to generate a MegaTexture. It includes options for MegaGen (to render the raw texture tiles), Renderlight (to bake lighting info into the tiles) and MakeMegaTexture (which compiles the tiles into a compressed ''.mega'' file). It's a one-stop shop for compiling MegaTextures!<noinclude>__NOEDITSECTION__
+
The ETQW SDK Launcher includes all the settings required to generate a MegaTexture. It includes options for MegaGen (to render the raw texture tiles), Renderlight (to bake lighting info into the tiles) and MakeMegaTexture (which compiles the tiles into a compressed ''.mega'' file). It's a one-stop shop for compiling MegaTextures!
= Overview =
 
The MegaBuild application can be found in the "Utilities" folder of the main ETQW directory. Look for '''MegaBuild.exe''' and run it.
 
  
= Using MegaBuild =
+
Each section contains a ''"View Command Line"'' button, which will output a set of options for each process. You can add these to a command line of {{filename|ETQW.exe}} in a ''.bat'' file if you need to automate your MegaTexture compiles.
[[Image:megabuild_overview.png|right|MegaBuild main window]]
 
  
=== Find ETQW.exe ===
+
== Using the tools ==
Firstly you need to select a valid game executable to launch the commands from.
+
[[Image:sdk_launcher_megatexture.png|right|The "Generate a MegaTexture" tab of the ETQW SDK Launcher.]]
* Go to ''File -> Find EXE...'' (or hit {{accelkey|CTRL}}{{accelkey|SHIFT}}{{accelkey|O}}).
+
To access the MegaTexture generation tools, run the ETQW SDK Launcher, and go to the ''"Generate a MegaTexture"'' tab.
* Browse to the SDK directory and select ''ETQW.exe'' or ''ETQWx64.exe'' if you have a 64 bit version of Windows.
 
  
 +
=== Paths setup ===
 +
Firstly you need to select a valid game path, and a valid save path in the main ''"Launch the SDK"'' tab. If you have already set this up to work with your custom maps and mods, you shouldn't have to change anything here.
  
=== Find the Retail Game ===
+
Just make sure you have the correct ''"Save Path"'' and ''"Mod Name"'' which contain your custom terrains, textures and maps selected.
* Go to ''File -> Find Base Game Path...''.
 
* Browse to your game's install directory.
 
  
 +
=== Load a Surface Tree ===
 +
Now you will need to load a [[Surface Tree]] (''.sft'') file which contains the texture and surface information you want to render into your MegaTexture.
 +
Surface Trees are generated automatically by EditWorld from the [[Terrain Editor]]. Do not edit ''.sft'' files manually, or you may lose your changes whenever the map is saved!
  
=== Choose a Save Path ===
+
* Click the ''"Browse..."'' button next to the "1. Choose a Surface Tree" field.
* Go to ''File -> Find Save Path...''.
+
* Browse to your save path's ''/maps/'' folder and select your {{filename|<mapname>.sft}} file.
* Browse to the folder that you would like to save your files to.
 
  
  
=== Load a Surface Tree ===
+
==== Important notes ====
Now you will need to load a [[Surface Tree]] (''.sft'') file which contains the texture and surface information you want to render into your MegaTexture.
+
* You must have fully compiled your map successfully at least once before these processes will work.
* Go to ''File -> Open'' (or hit {{accelkey|CTRL}}{{accelkey|O}}).
+
* Your map's terrain model must have a "MegaTexture material" applied to it, and must be UV-mapped inside the 0-1 range. If you are unsure of how to do these steps, read through the tutorial for [[A Simple First Terrain]].
* Browse to your ''maps'' directory and select your ''mapname.sft'' file.
+
* These processes can take a long time, and use a lot of memory and hard drive space. For a full-resolution (32k x 32k) MegaTexture, you will need at least 18gb of free space on the drive ETQW is installed to.
 +
* Make sure all your paths are set up correctly, otherwise files may be missing.
 +
{{clear}}
 +
 
 +
 
 +
== MegaGen ==
 +
[[MegaGen]] is the first stage of making a MegaTexture. It scans your ''.sft'' file for textures and then renders them all to flat "tiles", 4096x4096 pixels across. Each tile comes in two parts, a "diffuse" tile (contains un-lit surface color), and a "local normal" tile (for the bump and directional information).
 +
 
 +
These tiles will be outputted to your ''/maps'' folder, in the format {{filename|<mapname>_d_0_0.tga}}, and {{filename|<mapname>_local_0_0.tga}}.
  
  
=== MegaGen Settings ===
+
Click on the "MegaGen Options >>" button to expand the option list. The settings are fairly straightforward:
MegaGen is the first stage of making a MegaTexture. The settings are fairly straightforward.
+
* '''Resolution''' - sets the width and height in pixels of your final MegaTexture. For ET:QW we used a ratio of 1 pixel to 1 game unit, so a terrain which is 32,768 units across would use a MegaTexture with a resolution of 32,768. You can choose smaller sizes for faster "preview" compiles, or for smaller terrain sizes.
* '''Resolution''' sets the width and height in pixels of your final MegaTexture. For ET:QW we used a ratio of 1 pixel to 1 game unit, so a terrain which is 32,768 units across would use a MegaTexture with a resolution of 32,768.
+
* '''Video Memory''' - how much of your graphics card's memory the program is allowed to use. 128 is a good value for most modern graphics cards.
* '''Video Cache'''. 128 is a good value.
+
* '''Cache Memory''' - memory used for caching all of the source images and writing out the tiles. Give it as much as your computer will allow! For a computer with 2GB of RAM, 1536 is a good value here.
* '''Memory Cache'''. Give it as much as your computer will allow! For a computer with 2GB of RAM, 1536 is a good value here.
+
* '''Additional Options''' - this is for advanced users to choose specific settings. A more comprehensive guide can be found in the [[MegaGen]] article.
  
  
=== RenderLight Settings ===
+
== RenderLight ==
RenderLight bakes atmospheric lighting information into your MegaTexture. Depending on the settings used here, MakeMegaTexture will either output a 3-channel (RGB) or 4-channel (RGBA) MegaTexture.
+
[[RenderLight]] bakes atmospheric lighting information into your MegaTexture. Depending on the settings used here, MakeMegaTexture will either output a 3-channel (RGB) or 4-channel (RGBA) MegaTexture. RenderLight reads in the "tiles" from the previous MegaGen stage, and calculates the lighting based on the terrain model, the bump maps, and your map's atmosphere. It will output tiles in the same manner as
* '''Bake lighting''' - When checked, this option will bake the atmospheric sunlight into the MegaTexture.
 
* '''Bake ambient''' - When checked, this option will bake the ambient atmospheric light into the MegaTexture.
 
* Leaving both '''Bake lighting''' and '''Bake ambient''' un-checked will produce a 4-channel MegaTexture, which is larger size on disk but contains more accurate surface bump information.
 
  
 +
For RenderLight to work correctly, first you need to create a ''.rlt'' file (RenderLight Template) containing various options. You can find out how to create a RenderLight Template by reading the [[RenderLight]] article.
  
=== MegaTexture Settings ===
 
MakeMegaTexture is the process which compiles the output of the previous processes into a compressed ''.mega'' file.
 
* '''Best Quality''' denotes using the best quality. You should usually leave this enabled.
 
* '''Luminance Error''' denotes the brightness compression quality, where lower amounts mean better quality but larger file sizes.
 
* '''Chrominance Error''' denotes the colour compression quality, where lower amounts mean better quality but larger file sizes.
 
* '''Alpha Error''' denotes the alpha compression quality, where lower amounts mean better quality but larger file sizes.
 
  
 +
Click on the "RenderLight Options >>" button to expand the option list. The settings are as follows:
 +
* '''Bake lighting''' - when checked, this option will bake the atmospheric sunlight into the MegaTexture.
 +
* '''Bake ambient''' - when checked, this option will bake the ambient atmospheric light into the MegaTexture.
 +
* Leaving both '''Bake lighting''' and '''Bake ambient''' un-checked will produce a 4-channel MegaTexture, which is larger size on disk but contains more accurate surface bump information, and requires a different material setup to the default settings found in {{filename|/materials/megatextures.mtr}}.
 +
* '''Additional Options''' - this is for advanced users to choose specific settings. A more comprehensive guide can be found in the [[RenderLight]] article.
  
For our retail Megatextures, we used 3-channel settings, with all the Error settings at 1, for best quality. If you are making a 4-channel Megatexture, we would recommend the Error settings at around 20-30 for each value. Lower values might greatly increase the file size, while higher values might result in very blurred Megatextures.
 
  
 +
== Make MegaTexture ==
 +
[[MakeMegaTexture]] is the process which compiles the tiles output from the RenderLight process into a compressed ''.mega'' file.
  
=== Run the Processes ===
 
Once you have set up all of the options for your MegaTexture, you can set the MegaBuild processes going.
 
* ''Tasks -> Run Checked...'' (or pressing {{accelkey|F5}}) will run all of the selected processes.
 
* If this is the first time you're compiling a MegaTexture, check all 3 boxes for MegaGen, RenderLight and MegaTexture.
 
* You can un-check any processes you don't want to run at this time. For example if you want to re-compile some tiles from RenderLight with different MegaTexture settings, un-check MegaGen and RenderLight, leave MegaTexture checked, and then select ''Run Checked'' or hit {{accelkey|F5}}.
 
** Alternately, you can just click the ''"Make MegaTexture"'' button in the MegaTexture field.
 
  
 +
Click on the "Make MegaTexture Options >>" to expand the option list. The settings are as follows:
 +
* '''Best Quality''' - denotes using the best quality compression. You should usually leave this enabled.
 +
* '''Luminance Error''' - controls the brightness compression quality, where lower amounts mean better quality but larger file sizes.
 +
* '''Chrominance Error''' - controls the colour compression quality, where lower amounts mean better quality but larger file sizes.
 +
* '''Alpha Error''' - controls the alpha compression quality, where lower amounts mean better quality but larger file sizes.
  
= Components =
 
These are the individual processes that MegaBuild calls from the game.
 
  
=== MegaGen ===
+
For our retail Megatextures, we used 3-channel output from RenderLight, with all the MakeMegaTexture Error settings at 1, for best quality.
{{:MegaGen}}
+
If you are making a 4-channel MegaTexture, we would recommend the Error settings at around 20-30 for each value. Lower values might greatly increase the file size, while higher values might result in very blurred MegaTextures.
  
=== RenderLight ===
 
{{:RenderLight}}
 
  
=== MakeMegaTexture ===
+
== Run the processes ==
{{:MakeMegaTexture}}
+
Once you have set up all of the options for your MegaTexture, you can set the processes running.
 +
* Each process can be launched individually by clicking the ''"Run"'' button on the right of each section.
 +
* The ''"Run Selected Tasks"'' button in the bottom right will launch all of the checked processes.
 +
** If this is the first time you're compiling a MegaTexture, check all 3 boxes for MegaGen, RenderLight and MegaTexture.
 +
* You can un-check any processes you don't want to run. For example if you want to re-compile some tiles from RenderLight with different compression settings, un-check MegaGen and RenderLight, leave Make MegaTexture checked, and then select ''"Run Selected Tasks"''.
 +
** Alternately, you can just click the ''"Make MegaTexture"'' button in the MegaTexture field.
  
 
[[Category:Art]]
 
[[Category:Art]]
 
[[Category:Level Design]]
 
[[Category:Level Design]]
</noinclude>
 

Revision as of 16:59, 7 December 2007

The ETQW SDK Launcher includes all the settings required to generate a MegaTexture. It includes options for MegaGen (to render the raw texture tiles), Renderlight (to bake lighting info into the tiles) and MakeMegaTexture (which compiles the tiles into a compressed .mega file). It's a one-stop shop for compiling MegaTextures!

Each section contains a "View Command Line" button, which will output a set of options for each process. You can add these to a command line of ETQW.exe in a .bat file if you need to automate your MegaTexture compiles.

Using the tools

The "Generate a MegaTexture" tab of the ETQW SDK Launcher.

To access the MegaTexture generation tools, run the ETQW SDK Launcher, and go to the "Generate a MegaTexture" tab.

Paths setup

Firstly you need to select a valid game path, and a valid save path in the main "Launch the SDK" tab. If you have already set this up to work with your custom maps and mods, you shouldn't have to change anything here.

Just make sure you have the correct "Save Path" and "Mod Name" which contain your custom terrains, textures and maps selected.

Load a Surface Tree

Now you will need to load a Surface Tree (.sft) file which contains the texture and surface information you want to render into your MegaTexture. Surface Trees are generated automatically by EditWorld from the Terrain Editor. Do not edit .sft files manually, or you may lose your changes whenever the map is saved!

  • Click the "Browse..." button next to the "1. Choose a Surface Tree" field.
  • Browse to your save path's /maps/ folder and select your <span style="padding: 0 0.5ex; background: #def;" title="A file or folder named '<mapname>.sft'"><mapname>.sft file.


Important notes

  • You must have fully compiled your map successfully at least once before these processes will work.
  • Your map's terrain model must have a "MegaTexture material" applied to it, and must be UV-mapped inside the 0-1 range. If you are unsure of how to do these steps, read through the tutorial for A Simple First Terrain.
  • These processes can take a long time, and use a lot of memory and hard drive space. For a full-resolution (32k x 32k) MegaTexture, you will need at least 18gb of free space on the drive ETQW is installed to.
  • Make sure all your paths are set up correctly, otherwise files may be missing.


MegaGen

MegaGen is the first stage of making a MegaTexture. It scans your .sft file for textures and then renders them all to flat "tiles", 4096x4096 pixels across. Each tile comes in two parts, a "diffuse" tile (contains un-lit surface color), and a "local normal" tile (for the bump and directional information).

These tiles will be outputted to your /maps folder, in the format <span style="padding: 0 0.5ex; background: #def;" title="A file or folder named '<mapname>_d_0_0.tga'"><mapname>_d_0_0.tga, and <span style="padding: 0 0.5ex; background: #def;" title="A file or folder named '<mapname>_local_0_0.tga'"><mapname>_local_0_0.tga.


Click on the "MegaGen Options >>" button to expand the option list. The settings are fairly straightforward:

  • Resolution - sets the width and height in pixels of your final MegaTexture. For ET:QW we used a ratio of 1 pixel to 1 game unit, so a terrain which is 32,768 units across would use a MegaTexture with a resolution of 32,768. You can choose smaller sizes for faster "preview" compiles, or for smaller terrain sizes.
  • Video Memory - how much of your graphics card's memory the program is allowed to use. 128 is a good value for most modern graphics cards.
  • Cache Memory - memory used for caching all of the source images and writing out the tiles. Give it as much as your computer will allow! For a computer with 2GB of RAM, 1536 is a good value here.
  • Additional Options - this is for advanced users to choose specific settings. A more comprehensive guide can be found in the MegaGen article.


RenderLight

RenderLight bakes atmospheric lighting information into your MegaTexture. Depending on the settings used here, MakeMegaTexture will either output a 3-channel (RGB) or 4-channel (RGBA) MegaTexture. RenderLight reads in the "tiles" from the previous MegaGen stage, and calculates the lighting based on the terrain model, the bump maps, and your map's atmosphere. It will output tiles in the same manner as

For RenderLight to work correctly, first you need to create a .rlt file (RenderLight Template) containing various options. You can find out how to create a RenderLight Template by reading the RenderLight article.


Click on the "RenderLight Options >>" button to expand the option list. The settings are as follows:

  • Bake lighting - when checked, this option will bake the atmospheric sunlight into the MegaTexture.
  • Bake ambient - when checked, this option will bake the ambient atmospheric light into the MegaTexture.
  • Leaving both Bake lighting and Bake ambient un-checked will produce a 4-channel MegaTexture, which is larger size on disk but contains more accurate surface bump information, and requires a different material setup to the default settings found in /materials/megatextures.mtr.
  • Additional Options - this is for advanced users to choose specific settings. A more comprehensive guide can be found in the RenderLight article.


Make MegaTexture

MakeMegaTexture is the process which compiles the tiles output from the RenderLight process into a compressed .mega file.


Click on the "Make MegaTexture Options >>" to expand the option list. The settings are as follows:

  • Best Quality - denotes using the best quality compression. You should usually leave this enabled.
  • Luminance Error - controls the brightness compression quality, where lower amounts mean better quality but larger file sizes.
  • Chrominance Error - controls the colour compression quality, where lower amounts mean better quality but larger file sizes.
  • Alpha Error - controls the alpha compression quality, where lower amounts mean better quality but larger file sizes.


For our retail Megatextures, we used 3-channel output from RenderLight, with all the MakeMegaTexture Error settings at 1, for best quality. If you are making a 4-channel MegaTexture, we would recommend the Error settings at around 20-30 for each value. Lower values might greatly increase the file size, while higher values might result in very blurred MegaTextures.


Run the processes

Once you have set up all of the options for your MegaTexture, you can set the processes running.

  • Each process can be launched individually by clicking the "Run" button on the right of each section.
  • The "Run Selected Tasks" button in the bottom right will launch all of the checked processes.
    • If this is the first time you're compiling a MegaTexture, check all 3 boxes for MegaGen, RenderLight and MegaTexture.
  • You can un-check any processes you don't want to run. For example if you want to re-compile some tiles from RenderLight with different compression settings, un-check MegaGen and RenderLight, leave Make MegaTexture checked, and then select "Run Selected Tasks".
    • Alternately, you can just click the "Make MegaTexture" button in the MegaTexture field.