Difference between revisions of "RenderLight"

From Mod Wiki
(RenderLight Template)
 
(2 intermediate revisions by the same user not shown)
Line 5: Line 5:
 
RenderLight will try to use all tiles it finds in a folder. If you compile a large MegaTexture and then a smaller one afterwards, make sure to clean out the old tiles first, or your MegaTexture may end up looking broken!
 
RenderLight will try to use all tiles it finds in a folder. If you compile a large MegaTexture and then a smaller one afterwards, make sure to clean out the old tiles first, or your MegaTexture may end up looking broken!
 
* The output files can be found in the base game folder, under {{filename|megatextures/<mapname>_lit_x_y.tga}}
 
* The output files can be found in the base game folder, under {{filename|megatextures/<mapname>_lit_x_y.tga}}
 +
 +
 +
= RenderLight Template =
 +
Before using RenderLight, you will need to create a ''.rlt'' template. You can find examples of these in {{filename|base/renderlight/}}.
 +
 +
A RenderLight template looks like this:
 +
{
 +
mesh "models/terrain/<mapname>.lwo"
 +
diffuse "maps/<mapname>_d.tga"
 +
bump "maps/<mapname>_local.tga"
 +
out "megatextures/<mapname>_lit.tga"
 +
map "maps/<mapname>.entities"
 +
atmosphere "<atmosphere name>"
 +
}
 +
 +
* '''mesh''' - this should point to the relative path of your terrain model.
 +
** For ETQW we made two versions of each terrain mesh, one for in-game use with holes cut out where buildings and tunnels were placed, and one ''"<mapname>_renderlight"'' version with all the holes capped to prevent lighting errors and visible seams when baking the atmospheric light into the Megatexture. This is not a vital step, but is recommended for best lighting results. If your terrain mesh has no holes in it, making a capped ''"_renderlight"'' version is not necessary.
 +
* '''diffuse''' - this is the path to the output diffuse texture tiles from the previous [[MegaGen]] stage.
 +
* '''bump''' - this is the path to the output local normal-map texture tiles from the previous [[MegaGen]] stage.
 +
* '''out''' - this is where RenderLight will output the lit texture tiles.
 +
* '''map''' - this is the path to your map's ''.entities'' file, which is created when the map is compiled. RenderLight should read the atmosphere information from this file. If Renderlight is giving warnings about missing atmospheres, make sure your map has an atmosphere entity, and has been compiled successfully.
 +
** An ''Only Entities'' compile is sufficient for this to work, and much faster than a full compile.
 +
* '''atmosphere''' - the name of the atmosphere you want to take lighting information from (for example ''slipgate_desert01'').
 +
** This parameter will override any atmospheres found in the ''.world'' file loaded at the '''map''' stage. You can use this to bake different lighting into your Megatexture independently of the map's lighting.
  
 
= MegaBuild Options =
 
= MegaBuild Options =

Latest revision as of 16:08, 13 December 2007

RenderLight bakes lighting into a set of diffuse tiles outputted from MegaGen, based on the map's atmosphere settings and using the local normal-map tiles to bake in accurate fine detail.

RenderLight will try to use all tiles it finds in a folder. If you compile a large MegaTexture and then a smaller one afterwards, make sure to clean out the old tiles first, or your MegaTexture may end up looking broken!

  • The output files can be found in the base game folder, under <span style="padding: 0 0.5ex; background: #def;" title="A file or folder named 'megatextures/<mapname>_lit_x_y.tga'">megatextures/<mapname>_lit_x_y.tga


RenderLight Template

Before using RenderLight, you will need to create a .rlt template. You can find examples of these in base/renderlight/.

A RenderLight template looks like this:

{
	mesh		"models/terrain/<mapname>.lwo"
	diffuse		"maps/<mapname>_d.tga"
	bump		"maps/<mapname>_local.tga"
	out		"megatextures/<mapname>_lit.tga"
	map 		"maps/<mapname>.entities"
	atmosphere	"<atmosphere name>"
}
  • mesh - this should point to the relative path of your terrain model.
    • For ETQW we made two versions of each terrain mesh, one for in-game use with holes cut out where buildings and tunnels were placed, and one "<mapname>_renderlight" version with all the holes capped to prevent lighting errors and visible seams when baking the atmospheric light into the Megatexture. This is not a vital step, but is recommended for best lighting results. If your terrain mesh has no holes in it, making a capped "_renderlight" version is not necessary.
  • diffuse - this is the path to the output diffuse texture tiles from the previous MegaGen stage.
  • bump - this is the path to the output local normal-map texture tiles from the previous MegaGen stage.
  • out - this is where RenderLight will output the lit texture tiles.
  • map - this is the path to your map's .entities file, which is created when the map is compiled. RenderLight should read the atmosphere information from this file. If Renderlight is giving warnings about missing atmospheres, make sure your map has an atmosphere entity, and has been compiled successfully.
    • An Only Entities compile is sufficient for this to work, and much faster than a full compile.
  • atmosphere - the name of the atmosphere you want to take lighting information from (for example slipgate_desert01).
    • This parameter will override any atmospheres found in the .world file loaded at the map stage. You can use this to bake different lighting into your Megatexture independently of the map's lighting.

MegaBuild Options

  • Bake lighting - adds in the sunlight contribution to the output
    • same as -preMulLighting on the command line
  • Bake ambient - adds in the ambient light color to the output
    • same as -preMulAmbient on the command line