<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>https://wiki.splashdamage.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=MoP</id>
	<title>Mod Wiki - User contributions [en-gb]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.splashdamage.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=MoP"/>
	<link rel="alternate" type="text/html" href="https://wiki.splashdamage.com/index.php/Special:Contributions/MoP"/>
	<updated>2026-04-07T14:25:17Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.31.0</generator>
	<entry>
		<id>https://wiki.splashdamage.com/index.php?title=Collision_Meshes&amp;diff=4091</id>
		<title>Collision Meshes</title>
		<link rel="alternate" type="text/html" href="https://wiki.splashdamage.com/index.php?title=Collision_Meshes&amp;diff=4091"/>
		<updated>2008-01-03T13:48:35Z</updated>

		<summary type="html">&lt;p&gt;MoP: Back down a level!&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview ==&lt;br /&gt;
Collision meshes are used to improve in-game physics performance. They can also be used to stop players or vehicles catching on small protrusions from meshes, and generally smoothing out player movement over complex shapes.&lt;br /&gt;
&lt;br /&gt;
== Collision Meshes for Mapobject Models ==&lt;br /&gt;
When you make a model to be used as a mapobject, by default all the triangles are used as collision parts. This means that bullets, projectiles, players and vehicles collision all have to be calculated against every polygon in the model. Most of the time this is unnecessary (especially for player and vehicle collision) and reduces run-time performance in the game.&lt;br /&gt;
&lt;br /&gt;
Therefore, we can make optimised versions of the mesh, and store them in the same model file with a specific &amp;quot;collision&amp;quot; materials so that the game will only calculate collisions against the optimised versions.&amp;lt;includeonly&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{main|Collision Meshes}}&amp;lt;/includeonly&amp;gt;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== A Simple Example ===&lt;br /&gt;
[[Image:teapot_mesh.jpg|right|thumb|A small but detailed teapot model.]]&lt;br /&gt;
Here's a teapot model that we want to use in the game. It's not very big, but it has 1600 triangles!&lt;br /&gt;
At the moment, all the model's triangles will be used to calculate collision, which isn't very efficient or necessary.&lt;br /&gt;
&lt;br /&gt;
We could set ''&amp;quot;nonsolid&amp;quot;'' on the teapot's material, but that would mean that players could walk through the object and bullets wouldn't collide with it, which is usually not what you want!&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
==== Vehicle and Player Collision ====&lt;br /&gt;
[[Image:teapot_vehicleplayerclip.jpg|right|thumb|The vehicle and player collision mesh for the teapot, made of 15 polygons.]]&lt;br /&gt;
We usually make really simple shapes that serve as collision models for vehicle and player physics. Most of the time, especially on small objects, the player will not be able to tell they are walking over or around a box or simple cylinder instead of the actual visible mesh.&lt;br /&gt;
&lt;br /&gt;
In fact, in a lot of cases, a simpler vehicle and player collision mesh also makes movement around the world feel smoother, since there aren't any small poking-out pieces to get stuck on.&lt;br /&gt;
&lt;br /&gt;
The vehicle and player collision mesh we've created here is only 18 triangles! It should be fine for the player to walk around without getting stuck, and is much cheaper for collision physics calculations.&lt;br /&gt;
&lt;br /&gt;
For this mesh we use &amp;quot;&amp;lt;tt&amp;gt;textures/common/vehicleplayer_clip&amp;lt;/tt&amp;gt;&amp;quot; to make sure it collides with only vehicles and players (more info at the bottom of this page).&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Bullet Collision ====&lt;br /&gt;
[[Image:teapot_bulletclip.jpg|right|thumb|The bullet collision mesh for the teapot, made of 160 polygons.]]&lt;br /&gt;
Most of the time, the very simple shape used for player and vehicle collision is not enough to support complex surface interactions like drawing bullet decals onto the mesh. Additionally, a mesh that is simplified for player and vehicle collision might create invisible collision in places where you should be able to shoot bullets through (in this case, the teapot's handle).&lt;br /&gt;
&lt;br /&gt;
Therefore, we need to make a bullet collision mesh. At only 160 polygons, this bullet collision mesh is 10 times less detailed than the visible teapot mesh. This is still keeping enough information about the shape and volume of the teapot to create an accurate representation of how bullets might collide with it.&lt;br /&gt;
&lt;br /&gt;
For this mesh we use &amp;quot;&amp;lt;tt&amp;gt;textures/common/rendermodel_clip&amp;lt;/tt&amp;gt;&amp;quot; to make sure it collides with only bullets (more info at the bottom of this page).&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Collision Model Tips ===&lt;br /&gt;
* You do not have to create separate meshes for the vehicles, players and bullet collision if you don't want to. You can create a single optimised collision mesh and use the &amp;quot;&amp;lt;tt&amp;gt;textures/common/collision&amp;lt;/tt&amp;gt;&amp;quot; material.&lt;br /&gt;
* Unlike shadow hulls, collision meshes do not have to be &amp;quot;watertight&amp;quot;, open edges are allowed. However, bear in mind that things in the game will only collide with front-facing polys, so a single flat plane would only have collision on one side of it.&lt;br /&gt;
* Collision meshes are automatically optimised by the game to use polygons rather than triangles. Therefore, co-planar triangles will be optimised down into a single ''n''-sided polygon, for efficiency and performance.&lt;br /&gt;
** As an example, while a simple cube is rendered using 12 three-sided polygons (triangls), the collision optimisation will read it as 6 four-sided polygons (quads).&lt;br /&gt;
* As soon as you add any collision materials to your model file, any non-collision materials will be treated as nonsolid. Therefore, if you only add a player_clip mesh to your model, you will find that vehicles and bullets still pass through.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Valid Collision Materials ==&lt;br /&gt;
The surface type of each material is denoted by the suffix (eg. ''_metal'' for metal sound and particle effects).&lt;br /&gt;
Where no surface type suffix is specified, default effects will be used, which usually look and sound like concrete.&lt;br /&gt;
&lt;br /&gt;
=== Generic Collision ===&lt;br /&gt;
Vehicles, players, bullets and projectiles will all collide with this material. Nothing passes through.&lt;br /&gt;
* &amp;lt;tt&amp;gt;textures/common/collision&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;textures/common/collision_wood&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;textures/common/collision_metal&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;textures/common/collision_concrete&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Vehicle &amp;amp; Player Collision ===&lt;br /&gt;
Vehicles and players will collide with this material. Projectiles and bullets will pass through.&lt;br /&gt;
* &amp;lt;tt&amp;gt;textures/common/vehicleplayer_clip&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;textures/common/vehicleplayer_clip_metal&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;textures/common/vehicleplayer_clip_wood&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;textures/common/vehicleplayer_clip_concrete&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;textures/common/vehicleplayer_clip_glass&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;textures/common/vehicleplayer_clip_snow&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Player Collision ===&lt;br /&gt;
Only players will collide with this material. Vehicles, projectiles and bullets will pass through.&lt;br /&gt;
* &amp;lt;tt&amp;gt;textures/common/player_clip&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;textures/common/player_clip_metal&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;textures/common/player_clip_wood&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;textures/common/player_clip_concrete&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;textures/common/player_clip_glass&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Vehicle Collision ===&lt;br /&gt;
Only vehicles will collide with this material. Players, projectiles and bullets will pass through.&lt;br /&gt;
* &amp;lt;tt&amp;gt;textures/common/vehicle_clip&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;textures/common/vehicle_clip_metal&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;textures/common/vehicle_clip_wood&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;textures/common/vehicle_clip_concrete&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;textures/common/vehicle_clip_snow&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;quot;Rendermodel&amp;quot; Collision ===&lt;br /&gt;
Bullets and projectiles (and flyer drones!) will collide with this material. Players and vehicles will pass through.&lt;br /&gt;
* &amp;lt;tt&amp;gt;textures/common/rendermodel_clip&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;textures/common/rendermodel_clip_metal&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;textures/common/rendermodel_clip_wood&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;textures/common/rendermodel_clip_concrete&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;textures/common/rendermodel_clip_glass&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Special Collision Types ===&lt;br /&gt;
* &amp;lt;tt&amp;gt;textures/common/projectile_clip&amp;lt;/tt&amp;gt; - Allows bullets to pass through, but not projectiles (eg. rockets and tank shells).&lt;br /&gt;
&lt;br /&gt;
[[Category:Models]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>MoP</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.splashdamage.com/index.php?title=An_Advanced_Terrain_and_Megatexture&amp;diff=4032</id>
		<title>An Advanced Terrain and Megatexture</title>
		<link rel="alternate" type="text/html" href="https://wiki.splashdamage.com/index.php?title=An_Advanced_Terrain_and_Megatexture&amp;diff=4032"/>
		<updated>2007-12-14T16:35:18Z</updated>

		<summary type="html">&lt;p&gt;MoP: templates for accelkeys and filenames&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Image:AdvMega_Intro.jpg|thumb|500px|right]]&lt;br /&gt;
This guide will show you step by step, on how to create a detailed Megatextured Terrain.&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
'''For this tutorial you must:'''&lt;br /&gt;
* Have a modelling package that can export as LWO, ASE or OBJ&lt;br /&gt;
* Have basic modelling skills&lt;br /&gt;
* Have basic mapping skills, as in [[A Simple First Terrain]]&lt;br /&gt;
&lt;br /&gt;
'''This tutorial covers:'''&lt;br /&gt;
* Steps to create a detailed terrain mesh.&lt;br /&gt;
* How to assign the Megatexture&lt;br /&gt;
* How to add the terrain mesh to a map&lt;br /&gt;
* How to make a Megatexture&lt;br /&gt;
* How to compile a Megatexture&lt;br /&gt;
* How to add Water to a map&lt;br /&gt;
&lt;br /&gt;
'''Programs used in this tutorial are:'''&lt;br /&gt;
* Mudbox&lt;br /&gt;
* World Machine&lt;br /&gt;
* Lightwave&lt;br /&gt;
* Maya (only used briefly)&lt;br /&gt;
Other similar programs can be used instead of these, but wont be covered in this tutorial.&lt;br /&gt;
&lt;br /&gt;
'''This tutorial does not cover in detail:'''&lt;br /&gt;
* How to use Mudbox / ZBrush / World Machine / Blender / Lightwave / Maya / 3DSMax&lt;br /&gt;
&lt;br /&gt;
'''If you already have a terrain mesh''', and do not want to use Mudbox and World Machine, skip to [[#Prepare Terrain for Megatexture|Prepare Terrain for Megatexture]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Mudbox: Shape the Terrain =&lt;br /&gt;
[[Image:AdvMega_Mudbox.jpg|thumb|128px|right|Mudbox Layers]]&lt;br /&gt;
These are the basic steps for sculpting a terrain in Mudbox.&lt;br /&gt;
* Create a plane, and subdivide (but still keep a low tessellation).&lt;br /&gt;
* Change any tools you use to have the edit ''Direction'' set to ''Y'' axis.&lt;br /&gt;
* Create a new Layer, and sculpt the rough layout for the terrain.&lt;br /&gt;
* Subdivide again to the level of detail you want (or can).&lt;br /&gt;
* Create another layer, and sculpt more details into the terrain.&lt;br /&gt;
* Export to OBJ.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
= Convert Mesh to Heightmap =&lt;br /&gt;
This step is needed if you want to import your current terrain mesh into World Machine.&lt;br /&gt;
* Firstly, rotate the terrain mesh. In Lightwave, rotate -90° around the X axis. For 3ds Max &amp;amp; Maya, rotate +90° around the X axis.&lt;br /&gt;
* Cap any holes in the mesh, and triangulate the mesh.&lt;br /&gt;
* Using a machine with an nVidia graphics card, run the following command in the ETQW console to get the heightmap (where &amp;lt;model&amp;gt; is the relative path of the ''.lwo'', ''.obj'' or ''.ase'' mesh):&lt;br /&gt;
** {{consolecmd|RenderBumpFlat –floatHeightmap -size 2048 2048 &amp;lt;model&amp;gt;}}&lt;br /&gt;
* An ''.r32'' (raw 32-bit) heightmap will be saved into the same folder as your model, this heightmap can be used in World Machine.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= World Machine: Adding Flow =&lt;br /&gt;
[[Image:AdvMega_WorldMachine.jpg|thumb|320px|right|World Machine Device View]]&lt;br /&gt;
[http://www.world-machine.com World Machine] is used to add erosion flow lines to the terrain.  It's also useful as the flow maps can be exported to help create masks for texture distribution later in [[Terrain_Editor|Terrain Editor]].  These are the basic steps made to build the World Machine device nodes.&lt;br /&gt;
&lt;br /&gt;
* Blend the heightmap made from the Mudbox mesh with ''Perlin Noise'' to help the ''Erosion'' filters.&lt;br /&gt;
* Use a ''Snow'' filter around the rocks (mask used), so rocks look like they are sitting in soil.&lt;br /&gt;
* Pass the heightmap through two ''Erosion'' nodes, which are set up differently, and combined give a natural flowing look.  Both ''Erosion'' nodes are masked around the rocks, so they will keep their shape.  The first ''Erosion'' node is setup as ''Channeled Erosion'' with an ''Inverse Filter'', carving large flow lines into the terrain.  The Second is a ''Channeled Erosion'' set with ''No Filter'' , adding finer detailed flow lines.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
[[Image:AdvMega_WM_Output.jpg|thumb|150px|right|World Machine Heightmap]]&lt;br /&gt;
* The heightmap output of the erosion is split so the heightmap can be saved (and later used to create a mesh), and further filters created (sediment and normal map) to help make masks for texture distribution later.&lt;br /&gt;
&lt;br /&gt;
[[Image:AdvMega_WM_Flow.jpg|thumb|100px|right|Flow Map]]&lt;br /&gt;
* ''Flow'' and ''Deposition'' maps from the Erosion nodes are passed through ''Simple Transformation'' nodes that brighten the output saved.&lt;br /&gt;
* The heightmap saved above is imported and rendered at a lower (usable) resolution to the ''Mesh Output'' node creating an OBJ mesh.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This World Machine example was given using World Machine 2, which is currently in [http://www.world-machine.com/blog/ Beta].  A couple of features show aren't available in World Machine v1.25.  They are the ''Snow'' node (which isn't needed) and ''Mesh Output''. An alternative to creating a mesh from a heightmap [[Making_a_Terrain_Model#Optimising_to_Game_Mesh|can be found here]].&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= High to Low poly =&lt;br /&gt;
=== Optimizing ===&lt;br /&gt;
[[Image:AdvMega Dags.jpg|thumb|320px|right|Dangling border polygons to delete]]&lt;br /&gt;
This stage will briefly explain how the high-poly mesh exported from World Machine can be optimized down to the low poly game mesh.&lt;br /&gt;
* Load the OBJ exported from [[#World Machine: Adding Flow|World Machine]] into your preferred 3d Application.&lt;br /&gt;
* Rotate so it's orientated correctly.&lt;br /&gt;
* The outer mesh border will look like it's been dragged down (an artifact from the mesh being built from a heightmap). So remove this by selecting the mesh border polygons, and delete them.&lt;br /&gt;
* Triangulate the mesh and save out as ''.OBJ'', so it can be loaded into Lightwave.&lt;br /&gt;
* In Lightwave, use a plug-in called [http://amber.rc.arizona.edu/lw/qemloss3.html qemLOSS3] (once installed, found in the Utilities tab) to reduce the polygons to a reasonable amount (ETQW used around 30,000 polygons for the 32,768 unit width terrain).  If you have trouble running qemLOSS3, apply a different material other than the default.&lt;br /&gt;
* Fix edges that are triangulated in the wrong direction.&lt;br /&gt;
* Smooth subdivide the mesh, and run your mesh through qemLOSS3 again (to the same polygon count as before).  This will give a smoother terrain, easier for player movement and with less harsh silhouette angles. Repeat until you're happy with the mesh smoothness.&lt;br /&gt;
* Again fix edges that are triangulated in the wrong direction (these show up most obviously by applying a shiny material, and making sure the mesh has a single smoothing group (all soft edges, 180 degree smoothing angle).&lt;br /&gt;
* If you plan on having water, cut the mesh along the waterline, so no polygons are both above or below the water.  This is so the [[#Water Fog|water fog]] has a clear line to stop at.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== UV the Terrain ===&lt;br /&gt;
[[Image:AdvMega_UV.png|thumb|200px|right|UV Layout]]&lt;br /&gt;
This process is written for Maya, other 3d packages will have to modify the process.&lt;br /&gt;
* To achieve relaxed UV borders use a mel script called worldSpaceUVLine - it can be found on [http://Highend3d.com/maya/downloads/mel_scripts/modeling/poly_tools/4508.html Highend3D]. Copy the .mel into your ''My Documents\maya\#.#\scripts'' folder and run by typing '''''worldSpaceUVLine;''''' in the Maya command line.&lt;br /&gt;
* Snap all 4 corners to the UV 0-1 square.  Select all the edge uv for one side, and in the worldSpaceUVLine tool select the corresponding UV layout direction (U for horizontal, V for vertical), and press the align UV’s on selected line button. Repeat for each side.&lt;br /&gt;
* Make sure all holes in the mesh are capped, and run the Relax UVs tool, with the option ''Edge Weights'' set to ''World Space'', and ''Pin UV Border'' selected.  Keep repeating Relax UVs until you see no more UV movement.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Perturbate Image (Normal Map) ===&lt;br /&gt;
[[Image:AdvMega_Perturbate.jpg|thumb|200px|right|Perturbate Image (Tangent Space Local Map)]]&lt;br /&gt;
The Perturbate Image is an image that is [[#Construct the Megatexture|applied to the megatexture]], and corrects the low poly mesh normal to match that of the high poly.&lt;br /&gt;
* Load the high and low poly mesh into your preferred 3d Application.&lt;br /&gt;
* Use a surface-sampler (also known as baking textures, or render-to-texture, most good 3D applications will have this capability) to render the high poly normals onto the low poly model, with normals set to &amp;quot;tangent space&amp;quot;.&lt;br /&gt;
* You probably will need to fix the normal map channels (red and green) as the 3D Application use normals maps differently to the Game.  Make sure the green channel has white facing down, and red has white facing right.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Convert World Machine masks to UV space ===&lt;br /&gt;
[[Image:AdvMega_LowPoly.jpg|thumb|400px|right|Low Poly Mesh with Local Map]]&lt;br /&gt;
All the masks created created in World Machine (flow, deposition etc.) won't match the new game mesh UV coordinates&lt;br /&gt;
* Load the high and low poly mesh into your preferred 3D application.&lt;br /&gt;
* Duplicate the game mesh and apply a planar UV projection.&lt;br /&gt;
* Apply the masks created in World Machine to the planar mapped mesh.&lt;br /&gt;
* Surface sample the diffuse from the planar mapped mesh, onto the game UV mesh.&lt;br /&gt;
Also render the mesh normals (world space) to an image.  The blue channel will become useful when creating distribution masks, as it represents how vertical a polygon is.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Prepare Terrain for Megatexture =&lt;br /&gt;
Now the mesh is nearly ready for the game, just a couple more steps.&lt;br /&gt;
&lt;br /&gt;
=== Prepare the Mesh ===&lt;br /&gt;
* Scale the game mesh to the correct size, as after converting from a heightmap it probably isn't the right size.  This tutorial mesh is a small 8,192 x 8,192 unit mesh (again the Enemy Territory : Quake Wars terrains are 32,768 x 32,768).&lt;br /&gt;
* Rename the material to ''megatextures/sdk/terrain_mesh_sdk'' (''megatextures/'''&amp;lt;map_name&amp;gt;'''''). Maya will have problems with this naming convention.&lt;br /&gt;
* Set the Mesh normals to be smooth.&lt;br /&gt;
* Save the mesh to {{filename|/models/terrain/sdk/terrain_mesh_sdk.lwo}} ('''''&amp;lt;map_name&amp;gt;'''.lwo'' or ''.obj'' to {{filename|/models/terrain}}).&lt;br /&gt;
&lt;br /&gt;
=== Setup the Material ===&lt;br /&gt;
* Create a text file called {{filename|/materials/megatextures_sdk.mtr}}&lt;br /&gt;
* Add the following text to create the material:&lt;br /&gt;
 ''material megatextures/sdk/terrain_mesh_sdk	{ useTemplate megatextures/default_ambient&amp;lt; &amp;quot;sdk/terrain_mesh_sdk&amp;quot; &amp;gt; }''&lt;br /&gt;
* Save the file. You will need to restart the whole game and editor before any new files are loaded. If you just added the declaration to an existing ''.mtr'' file, you can just use the {{consolecmd|reloaddecls}} console command.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Construct the Megatexture =&lt;br /&gt;
This section will cover the step by step creation of the Megatexture using Terrain Editor (an inspector tab in EditWorld).  For Detailed explanation on feilds and setting not discussed here, check out the [[Terrain_Editor|Terrain Editor]]&lt;br /&gt;
&lt;br /&gt;
=== Set up the Map ===&lt;br /&gt;
* Load EditWorld, and create a new map.&lt;br /&gt;
* Bring up the [[Terrain Editor]] inspector.&lt;br /&gt;
* {{accelbtn|RMB}} in the left blank (white) area.  In the pop-up menu select ''New'' | ''Tree...''&lt;br /&gt;
* On the Root node set the model field to {{filename|/models/terrain/sdk/terrain_mesh_sdk.lwo}}, and also set the ST Model to the same model.  If you have holes in your mesh (holes cut for buildings), you'd need to make a separate ST Model version with no mesh holes.&lt;br /&gt;
* Seal the map up by [[A_Simple_First_Terrain#Creating a Caulk Hull|Creating a Caulk Hull]].  Make sure the origin of the terrain mesh is inside this hull.&lt;br /&gt;
*For the area to be lit by the sun, create a brush inside the caulk hull, textured with 'editor/outsideportal'.&lt;br /&gt;
*To set the atmosphere create an Atmosphere entity and set '''atmospheredecl''' to '''Valley01''' (or what ever atmosphere you're using).&lt;br /&gt;
&lt;br /&gt;
=== Detail Textures ===&lt;br /&gt;
Also on the Root node is where the detail textures are assigned. In each of the layers created, you assign which of these 4 detail textures to use. Detail Textures need to be a greyscale 512x512 texture (preferably saved in ''base/textures/detail/'').&lt;br /&gt;
{| cellspacing=&amp;quot;8&amp;quot; border=&amp;quot;0&amp;quot;&lt;br /&gt;
|'''Detail Texture 0'''&lt;br /&gt;
|&lt;br /&gt;
|{{filename|textures/detail/temperate_dirt.tga}}&lt;br /&gt;
|-&lt;br /&gt;
|'''Detail Texture 1'''&lt;br /&gt;
|&lt;br /&gt;
|{{filename|textures/detail/temperate_grass.tga}}&lt;br /&gt;
|-&lt;br /&gt;
|'''Detail Texture 2'''&lt;br /&gt;
|&lt;br /&gt;
|{{filename|textures/detail/temperate_gravel.tga}}&lt;br /&gt;
|-&lt;br /&gt;
|'''Detail Texture 3'''&lt;br /&gt;
|&lt;br /&gt;
|{{filename|textures/detail/temperate_rock.tga}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Image Sources ===&lt;br /&gt;
Here we'll start to create the texture layers that build up the Megatexture. The steps will progressively skip repetitive information about the layer setup.&lt;br /&gt;
&lt;br /&gt;
;Ground_Base&lt;br /&gt;
* Create a '''Group node''', {{accelbtn|RMB}} and  with the pop-up menu select ''New'' | '''Group'''. In the right field you can enter a name for the Group, we'll name this one '''Ground_Base'''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;Dirt&lt;br /&gt;
* Now we'll create a base '''Image Source''' node. {{accelbtn|RMB}} over the Group node, and create an '''Image Source''' node, this should create it as a child to the Group.  If you accidently created the Image node under the Root, don't worry as you can drag and release over the Group node to make it a child.  Name the Layer '''Dirt''', same way as the Group node.&lt;br /&gt;
* Apply a Diffuse texture by selecting '''Diffuse''' on the right hand panel of the inspector, then selecting the '''File Name''' field and press the '''...''' button to choose a texture.  For this layer we'll use {{filename|textures/megagen/temperate/dirt_06_d.tga}}&lt;br /&gt;
* Repeat the same process for the '''Local''' image by selecting '''Local''' on the right, and applying the texture {{filename|textures/megagen/temperate/dirt_06_local.tga}}&lt;br /&gt;
* As this is the base layer, the '''Distribution''' needs to cover the whole map.  So apply a full white image the same way as above but to the '''Distribution'''.&lt;br /&gt;
* This layer is a dirt layer so I'll set the the '''Detail Texture Type''' to '''0''', to match the number for the dirt detail texture.&lt;br /&gt;
* Also as this layer is dirt I'll set '''Sur Type Properties''' | '''Type''' to '''dirt'''. For a full list of usable surface types, check the [[Terrain_Editor#Surface_Type|Surface Type]] section.&lt;br /&gt;
* The diffuse texture has the dimensions 1024 x 1024, while the map covers 8192.  To keep the correct texture ratio, set '''Texture Properties''' | '''Scale''' to '''8 8'''.&lt;br /&gt;
* '''Texture Properties''' | '''Rotation''' is set to '''270''' to keep the to match the texture lighting to that of the atmosphere.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:AdvMega_2Layers.png|thumb|300px|right|Blend with Distribution Pattern]]&lt;br /&gt;
;Sand&lt;br /&gt;
* Sand will settle along the flow lines, as it's been washed down with the weather.&lt;br /&gt;
* Create this layer in the same way as the '''Dirt''' layer.  The '''Diffuse''' and '''Local''' can also be set up in the same way except choosing {{filename|textures/megagen/temperate/dirt_07.*}} as the textures.&lt;br /&gt;
* This layer will require a unique '''Distribution''' image.  The flow masks ([[# Convert World Machine masks to UV space|UV corrected]]) created from [[# World Machine: Adding Flow|World Machine]] were used to help create '''textures/megagen/terrain_mesh_sdk/masks/masks_sand.tga''' which is applied as the '''Distribution'''.&lt;br /&gt;
* To make the blend more fitting and unique set the '''Distribution Pattern''' to {{filename|textures/megagen/temperate/dirt_06_mask_inverse.tga}}.  This will blend the '''Sand''' into the cracks of the '''Dirt''' before the peaks (stones).&lt;br /&gt;
* '''Ramp Width''' is changed to '''0.5''' so the blend will become tighter.&lt;br /&gt;
* '''Distribution Pattern Texture Rotation''' and '''Scale''' Should match that of the '''Dirt''' layer, as it's using a Distribution Pattern that matches the dirt.&lt;br /&gt;
* Set the '''Detail Texture Type''' to '''0''' (dirt, as it's the best matching of the four), and the '''Surface Type Properties''' | '''Type''' to '''sand'''.&lt;br /&gt;
* To see how the Megatexture is progressing, render a [[Terrain_Editor#Megatexture_Preview|Megatexture Preview]] [[Image:TerEd_PreviewRender.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;Gravel&lt;br /&gt;
* To give the look off loose stones being scatter from the road.&lt;br /&gt;
* Create in the same way as above.  Was created after the [[#Road_Tool|Road Layer]] being placed.&lt;br /&gt;
* The '''Distribution Pattern''' image for this layer will match it's own gravel diffuse, so the '''Rotation''' and '''Scale''' for the '''Diffuse''' and '''Distribution Pattern''' images should be the same.&lt;br /&gt;
* Set the '''Detail Texture Type''' to '''2''' ({{filename|textures/detail/temperate_gravel.tga}}), and the '''Surface Type Properties''' | '''Type''' to '''gravel'''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;Dry_Dirt&lt;br /&gt;
* Gives a dried up cracked earth appearance, were standing water would have once been.&lt;br /&gt;
* Slight transparency given so layer blends smoother over light sand and darker dirt, '''Alpha''' set to '''0.75'''&lt;br /&gt;
* '''Ramp Width''' set to '''0.25''' making the blend even tighter (sharper).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;Sticks&lt;br /&gt;
* Helps the grass blend in with the dirt.&lt;br /&gt;
* Created after the grass, then layer moved above by dragging and releasing between the layers '''Grass_Outer''' and '''Dry_Dirt'''.&lt;br /&gt;
* '''Ramp Width''' set to '''0.75''' so the blend can be softer.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;Grass_Outer&lt;br /&gt;
* Texture used is of a patchy grass, good for grass on the edges of a grass clump.&lt;br /&gt;
* '''Distribution Pattern''' texture carefully made so the dirt parts of the diffuse blend in last.&lt;br /&gt;
* Texture '''Rotation''' set to '''300''', this is to break up the look of textures tiling in the same direction.&lt;br /&gt;
* The '''Detail Texture Type''' is set to '''1''' ({{filename|textures/detail/temperate_grass.tga}}), and the '''Surface Type Properties''' | '''Type''' to '''grass'''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;Grass_Inner&lt;br /&gt;
* Dense Grass, blended to cover the dirt of the patchy grass texture ('''Grass_Outer'''), where the mask become more solid (white).&lt;br /&gt;
* Uses the same '''Distribution''' mask as '''Grass_Outer''', as the '''Distribution Pattern''' texture is made so that it is never stronger than that of the patchy grass.&lt;br /&gt;
* Texture '''Rotation''' and '''Scale''' needs to match that of '''Grass_Outer''' as the '''Distribution Pattern''' textures of both grass layers work together, with the same '''Distribution'''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;Stones&lt;br /&gt;
* Create the Stone '''Distribution''' after the solid rock layers, as the rock will look better when it blends to the stones.  To find out where rocks are distributed exactly, [[Terrain_Editor#Megatexture_Preview|Preview Render]] the megatexture with the rocks layer tinted black, and only a white base layer.  The Preview Megatexture will be saved to {{filename|base/imagedump/maps/&amp;lt;map_name&amp;gt;}} and flipped vertically.&lt;br /&gt;
* As well as being concentrated around the solid rock sections, stones should flow down the surrounding slopes.&lt;br /&gt;
* Make the Stones more dense around rocks.&lt;br /&gt;
* The '''Distribution Pattern''' texture has been created so the stones will blend in one by one.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:AdvMega_GroundLayers.png|thumb|300px|right|Ground Base Layers]]&lt;br /&gt;
;Pebbles&lt;br /&gt;
* Pebbles in Mud works well around the waterline.&lt;br /&gt;
* The '''Distribution''' mask is made slightly darker where the sand '''Distribution''' is.  This will give good variation, as the Pebbles will blend in first (due to '''Distribution Pattern'''), making them appear to be on sand instead of mud.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;Rock&lt;br /&gt;
* A new '''Group''' is created under the '''Root''' node to keep the rock elements neatly together.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;Rock_Base&lt;br /&gt;
* Rock should usually be created (distributed) near the start of making a Megatexture, as rock usually effects where all other elements will be distributed.&lt;br /&gt;
* Texture '''Rotation''' for both '''Diffuse''' and '''Distribution Pattern''' is set to '''0.45''', this is so the rock diffuse is rotated to match the direction of the rock in the map.  If you have rock in all directions you could make separate rock masks for the different rotations.&lt;br /&gt;
* A '''Heightmap''' image is assigned, {{filename|textures/megagen/temperate/rock_01_h.tga}}.  This will help the '''Rock_Stain_(HeightMap)''' blend into the cracks.&lt;br /&gt;
* Set the '''Propagate Distribution''' to '''true''', by ticking the box.  This will mask any child layers with this layers distribution.&lt;br /&gt;
* The '''Detail Texture Type''' is set to '''3''' ({{filename|textures/detail/temperate_rock.tga}}), and the '''Surface Type Properties''' | '''Type''' to '''stone'''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;Rock_Smooth&lt;br /&gt;
* By distributing smooth rock on raised and large flat areas, while not in cracks and around rock edges, will help to give it shape.&lt;br /&gt;
* This layer can be set up in the same way as '''Rock_Base''' (including having a heightmap image), except you don't need to '''Propagate Distribution'''.&lt;br /&gt;
* Use the same '''Distribution Pattern''' used in '''Rock_Base''' so the smooth rock will form on the ridges first.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;Rock_Horizontal&lt;br /&gt;
* This layer will use a different technique to create horizontal crack lines in the rock.&lt;br /&gt;
* Most of the settings can be set up in the same way as the previous rock layers.&lt;br /&gt;
* Use the same '''Distribution Pattern''' used in '''Rock_Base''' (including the same scale and rotation).&lt;br /&gt;
* Set the '''Projector Pattern''' image to the horizontal rock distribution pattern ({{filename|textures/megagen/temperate/rock_04_mask.tga}}).&lt;br /&gt;
* Set the last value of the '''Blend Parameters''' giving 0 0 0 '''0.75''', this controls the sharpness off the '''Projector Pattern''' blend.&lt;br /&gt;
* The '''Distribution''' mask should only include steep polygons that face the angle of projection (this will prevent texture stretching).&lt;br /&gt;
* Set '''Image Renderer''' | '''UV Type''' to '''Parallel Side'''.  This will force the layer to render has a side projection.  For this to work correctly, the terrain mesh needs to be centered around the grid origin.&lt;br /&gt;
* Set '''Image Renderer''' | '''Projection Angle''' to '''135''', so the projection is in the direction of the vertical rock face (this will rotate the projection around the Z axis).&lt;br /&gt;
* '''Texture Properties''' | '''Scale''' to '''6 2''', as this is a side projection, the number of tiles should match the side profile of the mesh.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:AdvMega_RockLayers.png|thumb|300px|right|Rock with Horizontal Projection]]&lt;br /&gt;
;Rock_Stain(Heightmap)&lt;br /&gt;
* This layer will create darker staining on the rock, by the use of a heightmap blend.&lt;br /&gt;
* The way this blend method works is it renders all the heightmaps from each of the layers first, and then blends the diffuse &amp;amp; local images into the lower (darker) parts of the heightmap.&lt;br /&gt;
* Assign a black texture ({{filename|textures/megagen/black.tga}}) to the '''Heightmap''' image, this will help the staining occur stronger based on the '''Distribution''' mask.&lt;br /&gt;
* Set the first 2 values of the '''Blend Parameters''' giving '''0.33 0.25''' 0 0 . The first value (0.33) controls the height at which the blend takes place, while the second (0.25) controls the sharpness of the falloff in the blend.&lt;br /&gt;
* Set the '''Color''' of the layer to '''black''', either by texture or color tinting.&lt;br /&gt;
* No '''Local''' map required&lt;br /&gt;
* '''Alpha''' set to 0.5 so the rock texture underneath shows through.&lt;br /&gt;
* '''Detail Texture Type''' set to -1 , this will disable distributing detail textures for this layer.&lt;br /&gt;
* Leave the '''Surface Type Properties''' | '''Type''' field blank.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;Water_Line&lt;br /&gt;
* A new '''Group''' is created under the '''Root''' node to keep the water line elements neatly together.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;Water_Line_(Geometry_Based)&lt;br /&gt;
* This layer will give a look of wet ground.&lt;br /&gt;
* Set the '''Blend''' mode to '''Multiply (d*s)''', this will darken (multiply) over the textures underneath.&lt;br /&gt;
* Assign the '''Diffuse''' to {{filename|textures/megagen/white.tga}}, and '''Color''' tint to '''Hue 0, Saturation 0, Brightness 180'''&lt;br /&gt;
* For the '''Distribution''', change '''Source Type''' to '''geometryBased'''.  '''Enable''' the '''Altitude Upper''', set the '''Value''' to '''800''' (32 units just above the water line), and '''Fuzziness''' to '''0.075''' (the falloff).  '''Resolution''' can be set to '''1024''' (generated texture size of the mask).&lt;br /&gt;
* Again '''Detail Texture Type''' set to -1&lt;br /&gt;
* '''Surface Type Properties''' | '''Type''' set to '''water''', so allow splashes to form on the shoreline.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;Water_Fade_(Geometry_Based)&lt;br /&gt;
* This will help give the water depth (and reduce megatexture size ;)&lt;br /&gt;
* Setup in the same way as '''Water_Line_(Geometry_Based)''' above, except:&lt;br /&gt;
* Set the '''Blend''' mode to '''Blend''', this will cover over the textures underneath (looking similar to fog).&lt;br /&gt;
* '''Color''' tint set to '''Hue 60, Saturation 115, Brightness 22'''&lt;br /&gt;
* With '''Source Type''' set to '''geometryBased''', change the '''Altitude Upper''' | '''Value''' to '''768''' (water height) and '''Fuzziness''' to '''1''' (larger falloff).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;Perturbate&lt;br /&gt;
* Create under the '''Root''' node.  Will bring back the normals to that of the [[#Perturbate Image (Normal Map)|high-res mesh]], improving the baked lighting.&lt;br /&gt;
* Set the '''Blend''' mode to '''Perturbate Normals''', this will add the normals to those already generated by the other layers.&lt;br /&gt;
* Assign no '''Diffuse''' texture.&lt;br /&gt;
* Assign a white texture to the '''Distribution''' (as to cover the whole megatexture).&lt;br /&gt;
* Set the '''Local''' texture to {{filename|textures/megagen/terrain_mesh_sdk/local.tga}} (the mesh's normal map).&lt;br /&gt;
* '''Detail Texture Type''' set to -1&lt;br /&gt;
* Leave the '''Surface Type Properties''' | '''Type''' field blank.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:AdvMega_AmbOcc.jpg|thumb|200px|right|Ambient Occlusion map]]&lt;br /&gt;
;Ambient_Occlusion&lt;br /&gt;
* Also created under the '''Root''' node.  Rendered in ''Maya'' to emulate light being occluded in crevices.&lt;br /&gt;
* Set the '''Blend''' mode to '''Multiply (d*(s*1.6)'''. in this blend mode diffuse image colors darker than 160 will darken the previous layers, while colors brighter than 160 will lighten.&lt;br /&gt;
* Assign {{filename|textures/megagen/terrain_mesh_sdk/ambient_occlusion.tga}} as the Diffuse.  The image is balanced so that areas of no change are around 160 in color brightness.&lt;br /&gt;
* Assign a white texture to the '''Distribution''' (as to cover the whole megatexture).&lt;br /&gt;
* '''Detail Texture Type''' set to -1&lt;br /&gt;
* Leave the '''Surface Type Properties''' | '''Type''' field blank.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Road Tool ===&lt;br /&gt;
Here we'll create a paved road using the [[Terrain_Editor#Road_Node|Road Tool]].&lt;br /&gt;
* First we'll create a '''Road Template (.rtl)''', to assign what textures and surface type to assign to the road.&lt;br /&gt;
* Create a blank text file called {{filename|/megagen/roadtemplates/terrain_mesh_sdk.rtl}} and add the needed information:&lt;br /&gt;
 roadTemplate sdk_main_road {&lt;br /&gt;
     {&lt;br /&gt;
         diffuse image sdTextureTGA_Properties {&lt;br /&gt;
             name &amp;quot;textures/megagen/temperate/road_01_d.tga&amp;quot;&lt;br /&gt;
         }&lt;br /&gt;
         local image sdTextureTGA_Properties {&lt;br /&gt;
             name &amp;quot;textures/megagen/temperate/road_01_local.tga&amp;quot;&lt;br /&gt;
         }&lt;br /&gt;
         distribution image sdTextureTGA_Properties {&lt;br /&gt;
             name &amp;quot;textures/megagen/temperate/road_01_mask.tga&amp;quot;&lt;br /&gt;
         }&lt;br /&gt;
         offset ( -1 1 )&lt;br /&gt;
         surfaceType &amp;quot;pavement&amp;quot;&lt;br /&gt;
         detailtexture &amp;quot;textures/detail/temperate_gravel.tga&amp;quot;&lt;br /&gt;
         }&lt;br /&gt;
 }&lt;br /&gt;
Here we've given the road material a name '''sdk_main_road''', and set the '''Diffuse''', '''Local''', and  '''Mask''' textures.  Also setting the '''Surface Type''' to '''pavemant''', and '''Detail Texture''' to {{filename|textures/detail/temperate_gravel.tga}} (which also must be assigned in the '''Root''' node).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:AdvMega_RoadLayer.png|thumb|300px|right|Road Tool]]&lt;br /&gt;
;Main_Road&lt;br /&gt;
* Create the '''Road''' node, {{accelbtn|RMB}} over the Root node, a pop-up menu will appear and select ''New'' | '''Road'''.&lt;br /&gt;
* Set '''Road Template''' to '''sdk_main_road''', this points the road tool to the correct road template.&lt;br /&gt;
* Start placing the road along the map:&lt;br /&gt;
** Select the node&lt;br /&gt;
** Click on the ''XY Top'' window&lt;br /&gt;
** Enter vertex editing mode ({{accelkey|v}})&lt;br /&gt;
** Hold {{accelkey|Ctrl}}{{accelkey|Shift}} and {{accelbtn|lmb}} in the ''XY Top'' window to start placing the points that make up the road curve.&lt;br /&gt;
* Now to fix the width and direction of the road.&lt;br /&gt;
** You need to be in vertex editing mode if not already (toggled with {{accelkey|v}}).&lt;br /&gt;
** '''Moving Road Points''' {{accelbtn|LMB}}-drag the blue points.&lt;br /&gt;
** '''Change Points Direction''' {{accelbtn|LMB}}-drag the yellow points.&lt;br /&gt;
** '''Change Width of Road''' {{accelbtn|LMB}}-drag out the red points.  Alternatively you can widen the whole road when outside the vertex editing mode by selecting the Road node, then {{accelbtn|LMB}}-drag beside the road.&lt;br /&gt;
** '''Adding new Points''' hold {{accelkey|Ctrl}}{{accelkey|Shift}} and {{accelbtn|lmb}} the area where you want create the new point.&lt;br /&gt;
** '''Deleting Points''' {{accelbtn|LMB}} and hold the blue point you want to delete and press ''Backspace''.&lt;br /&gt;
** Press {{accelkey|Esc}} to exit vertex editing mode.&lt;br /&gt;
* The Road Tool must never cross a mesh border, so make sure you bump in your road by at least one unit.  If it does cross a border the Road Tool will render with an artifact stretching to the mesh corner.&lt;br /&gt;
*Finally move the layer into it's correct place for rendering.  Drag and release the node between the '''Ground_Base''' and '''Rock''' group node.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Projector ===&lt;br /&gt;
Using the projector node, localized texture detail can be projected onto the megatexture.&lt;br /&gt;
&lt;br /&gt;
;Projectors&lt;br /&gt;
Created a groups to keep things nice an neat.&lt;br /&gt;
&lt;br /&gt;
;Cracked_Road&lt;br /&gt;
* To give the look of cracked tar where the crater nears the road.&lt;br /&gt;
* Create the '''Road Node''', {{accelbtn|RMB}} over the '''Projectors''' Group node, a pop-up menu will appear and select ''New'' | '''Projector'''.&lt;br /&gt;
* Setup the '''Projector''' the same way you would a standard '''Image Source''' node, except you only need a '''Distribution''' mask (and not a '''Distributed Pattern), as the texture shouldn't be projected larger than the source textures.&lt;br /&gt;
* To place the projector move/scale/rotate as you would a normal brush (including vertex editing).  The projector should be positioned above the terrain mesh.&lt;br /&gt;
&lt;br /&gt;
;Crater&lt;br /&gt;
* Places the crater scorch marks.&lt;br /&gt;
* Setup the same way as '''Cracked_Road'''.&lt;/div&gt;</summary>
		<author><name>MoP</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.splashdamage.com/index.php?title=An_Advanced_Terrain_and_Megatexture&amp;diff=4021</id>
		<title>An Advanced Terrain and Megatexture</title>
		<link rel="alternate" type="text/html" href="https://wiki.splashdamage.com/index.php?title=An_Advanced_Terrain_and_Megatexture&amp;diff=4021"/>
		<updated>2007-12-13T18:54:39Z</updated>

		<summary type="html">&lt;p&gt;MoP: link to simple terrain tutorial rather than map tutorial, clear some paragraphs&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This guide will show you step by step, on how to create a detailed Megatextured Terrain.&lt;br /&gt;
[[Image:AdvMega_Intro.jpg|right]]&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
'''For this tutorial you must:'''&lt;br /&gt;
* Have a modelling package that can export as LWO, ASE or OBJ&lt;br /&gt;
* Have basic modelling skills&lt;br /&gt;
* Have basic mapping skills, as in [[A Simple First Terrain]]&lt;br /&gt;
&lt;br /&gt;
'''This tutorial covers:'''&lt;br /&gt;
* Steps to create a detailed terrain mesh.&lt;br /&gt;
* How to assign the Megatexture&lt;br /&gt;
* How to add the terrain mesh to a map&lt;br /&gt;
* How to make a Megatexture&lt;br /&gt;
* How to compile a Megatexture&lt;br /&gt;
* How to add Water to a map&lt;br /&gt;
&lt;br /&gt;
'''Programs used in this tutorial are:'''&lt;br /&gt;
* Mudbox&lt;br /&gt;
* World Machine&lt;br /&gt;
* Lightwave&lt;br /&gt;
* Maya (only used briefly)&lt;br /&gt;
Other similar programs can be used instead of these, but wont be covered in this tutorial.&lt;br /&gt;
&lt;br /&gt;
'''This tutorial does not cover in detail:'''&lt;br /&gt;
* How to use Mudbox / ZBrush / World Machine / Blender / Lightwave / Maya / 3DSMax&lt;br /&gt;
&lt;br /&gt;
'''If you already have a terrain mesh''', and do not want to use Mudbox and World Machine, skip to [[#Prepare Terrain for Megatexture|Prepare Terrain for Megatexture]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Mudbox: Shape the Terrain =&lt;br /&gt;
[[Image:AdvMega_Mudbox.jpg|thumb|128px|right|Mudbox Layers]]&lt;br /&gt;
These are the basic steps for sculpting a terrain in Mudbox.&lt;br /&gt;
* Create a plane, and subdivide (but still keep a low tessellation).&lt;br /&gt;
* Change any tools you use to have the edit ''Direction'' set to ''Y'' axis.&lt;br /&gt;
* Create a new Layer, and sculpt the rough layout for the terrain.&lt;br /&gt;
* Subdivide again to the level of detail you want (or can).&lt;br /&gt;
* Create another layer, and sculpt more details into the terrain.&lt;br /&gt;
* Export to OBJ.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
= Convert Mesh to Heightmap =&lt;br /&gt;
This step is needed if you want to import your current terrain mesh into World Machine.&lt;br /&gt;
* Firstly, rotate the terrain mesh. In Lightwave, rotate -90° around the X axis. For 3ds Max &amp;amp; Maya, rotate +90° around the X axis.&lt;br /&gt;
* Cap any holes in the mesh, and triangulate the mesh.&lt;br /&gt;
* Using a machine with an nVidia graphics card, run the following command in the ETQW console to get the heightmap (where &amp;lt;model&amp;gt; is the relative path of the ''.lwo'', ''.obj'' or ''.ase'' mesh):&lt;br /&gt;
** {{consolecmd|RenderBumpFlat –floatHeightmap -size 2048 2048 &amp;lt;model&amp;gt;}}&lt;br /&gt;
* An ''.r32'' (raw 32-bit) heightmap will be saved into the same folder as your model, this heightmap can be used in World Machine.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= World Machine: Adding Flow =&lt;br /&gt;
[[Image:AdvMega_WorldMachine.jpg|thumb|320px|right|World Machine Device View]]&lt;br /&gt;
[http://www.world-machine.com World Machine] is used to add erosion flow lines to the terrain.  It's also useful as the flow maps can be exported to help create masks for texture distribution later in [[Terrain_Editor|Terrain Editor]].  These are the basic steps made to build the World Machine device nodes.&lt;br /&gt;
&lt;br /&gt;
* Blend the heightmap made from the Mudbox mesh with ''Perlin Noise'' to help the ''Erosion'' filters.&lt;br /&gt;
* Use a ''Snow'' filter around the rocks (mask used), so rocks look like they are sitting in soil.&lt;br /&gt;
* Pass the heightmap through two ''Erosion'' nodes, which are set up differently, and combined give a natural flowing look.  Both ''Erosion'' nodes are masked around the rocks, so they will keep their shape.  The first ''Erosion'' node is setup as ''Channeled Erosion'' with an ''Inverse Filter'', carving large flow lines into the terrain.  The Second is a ''Channeled Erosion'' set with ''No Filter'' , adding finer detailed flow lines.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
[[Image:AdvMega_WM_Output.jpg|thumb|150px|right|World Machine Heightmap]]&lt;br /&gt;
* The heightmap output of the erosion is split so the heightmap can be saved (and later used to create a mesh), and further filters created (sediment and normal map) to help make masks for texture distribution later.&lt;br /&gt;
&lt;br /&gt;
[[Image:AdvMega_WM_Flow.jpg|thumb|100px|right|Flow Map]]&lt;br /&gt;
* ''Flow'' and ''Deposition'' maps from the Erosion nodes are passed through ''Simple Transformation'' nodes that brighten the output saved.&lt;br /&gt;
* The heightmap saved above is imported and rendered at a lower (usable) resolution to the ''Mesh Output'' node creating an OBJ mesh.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This World Machine example was given using World Machine 2, which is currently in [http://www.world-machine.com/blog/ Beta].  A couple of features show aren't available in World Machine v1.25.  They are the ''Snow'' node (which isn't needed) and ''Mesh Output''. An alternative to creating a mesh from a heightmap [[Making_a_Terrain_Model#Optimising_to_Game_Mesh|can be found here]].&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= High to Low poly =&lt;br /&gt;
=== Optimizing ===&lt;br /&gt;
[[Image:AdvMega Dags.jpg|thumb|320px|right|Dangling border polygons to delete]]&lt;br /&gt;
This stage will briefly explain how the high-poly mesh exported from World Machine can be optimized down to the low poly game mesh.&lt;br /&gt;
* Load the OBJ exported from [[#World Machine: Adding Flow|World Machine]] into your preferred 3d Application.&lt;br /&gt;
* Rotate so it's orientated correctly.&lt;br /&gt;
* The outer mesh border will look like it's been dragged down (an artifact from the mesh being built from a heightmap). So remove this by selecting the mesh border polygons, and delete them.&lt;br /&gt;
* Triangulate the mesh and save out as ''.OBJ'', so it can be loaded into Lightwave.&lt;br /&gt;
* In Lightwave, use a plug-in called [http://amber.rc.arizona.edu/lw/qemloss3.html qemLOSS3] (once installed, found in the Utilities tab) to reduce the polygons to a reasonable amount (ETQW used around 30,000 polygons for the 32,768 unit width terrain).  If you have trouble running qemLOSS3, apply a different material other than the default.&lt;br /&gt;
* Fix edges that are triangulated in the wrong direction.&lt;br /&gt;
* Smooth subdivide the mesh, and run your mesh through qemLOSS3 again (to the same polygon count as before).  This will give a smoother terrain, easier for player movement and with less harsh silhouette angles. Repeat until you're happy with the mesh smoothness.&lt;br /&gt;
* Again fix edges that are triangulated in the wrong direction (these show up most obviously by applying a shiny material, and making sure the mesh has a single smoothing group (all soft edges, 180 degree smoothing angle).&lt;br /&gt;
* If you plan on having water, cut the mesh along the waterline, so no polygons are both above or below the water.  This is so the [[#Water Fog|water fog]] has a clear line to stop at.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== UV the Terrain ===&lt;br /&gt;
[[Image:AdvMega_UV.png|thumb|200px|right|UV Layout]]&lt;br /&gt;
This process is written for Maya, other 3d packages will have to modify the process.&lt;br /&gt;
* To achieve relaxed UV borders use a mel script called worldSpaceUVLine - it can be found on [http://Highend3d.com/maya/downloads/mel_scripts/modeling/poly_tools/4508.html Highend3D]. Copy the .mel into your ''My Documents\maya\#.#\scripts'' folder and run by typing '''''worldSpaceUVLine;''''' in the Maya command line.&lt;br /&gt;
* Snap all 4 corners to the UV 0-1 square.  Select all the edge uv for one side, and in the worldSpaceUVLine tool select the corresponding UV layout direction (U for horizontal, V for vertical), and press the align UV’s on selected line button. Repeat for each side.&lt;br /&gt;
* Make sure all holes in the mesh are capped, and run the Relax UVs tool, with the option ''Edge Weights'' set to ''World Space'', and ''Pin UV Border'' selected.  Keep repeating Relax UVs until you see no more UV movement.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Perturbate Image (Normal Map) ===&lt;br /&gt;
[[Image:AdvMega_Perturbate.jpg|thumb|200px|right|Perturbate Image (Tangent Space Local Map)]]&lt;br /&gt;
The Perturbate Image is an image that is [[#Construct the Megatexture|applied to the megatexture]], and corrects the low poly mesh normal to match that of the high poly.&lt;br /&gt;
* Load the high and low poly mesh into your preferred 3d Application.&lt;br /&gt;
* Use a surface-sampler (also known as baking textures, or render-to-texture, most good 3D applications will have this capability) to render the high poly normals onto the low poly model, with normals set to &amp;quot;tangent space&amp;quot;.&lt;br /&gt;
* You probably will need to fix the normal map channels (red and green) as the 3D Application use normals maps differently to the Game.  Make sure the green channel has white facing down, and red has white facing right.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Convert World Machine masks to UV space ===&lt;br /&gt;
[[Image:AdvMega_LowPoly.jpg|thumb|400px|right|Low Poly Mesh with Local Map]]&lt;br /&gt;
All the masks created created in World Machine (flow, deposition etc.) won't match the new game mesh UV coordinates&lt;br /&gt;
* Load the high and low poly mesh into your preferred 3D application.&lt;br /&gt;
* Duplicate the game mesh and apply a planar UV projection.&lt;br /&gt;
* Apply the masks created in World Machine to the planar mapped mesh.&lt;br /&gt;
* Surface sample the diffuse from the planar mapped mesh, onto the game UV mesh.&lt;br /&gt;
Also render the mesh normals (world space) to an image.  The blue channel will become useful when creating distribution masks, as it represents how vertical a polygon is.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Prepare Terrain for Megatexture =&lt;br /&gt;
Now the mesh is nearly ready for the game, just a couple more steps.&lt;br /&gt;
&lt;br /&gt;
=== Prepare the Mesh ===&lt;br /&gt;
* Scale the game mesh to the correct size, as after converting from a heightmap it probably isn't the right size.  This tutorial mesh is a small 8,192 x 8,192 unit mesh (again the Enemy Territory : Quake Wars terrains are 32,768 x 32,768).&lt;br /&gt;
* Rename the material to ''megatextures/sdk/terrain_mesh_sdk'' (''megatextures/'''&amp;lt;map_name&amp;gt;'''''). Maya will have problems with this naming convention.&lt;br /&gt;
* Set the Mesh normals to be smooth.&lt;br /&gt;
* Save the mesh to ''base/models/terrain/sdk/terrain_mesh_sdk.lwo'' ('''''&amp;lt;map_name&amp;gt;'''.lwo'' or ''.obj'' to ''base/models/terrain'').&lt;br /&gt;
&lt;br /&gt;
=== Setup the Material ===&lt;br /&gt;
* Create ''base/materials/megatextures_sdk.mtr''&lt;br /&gt;
* Add the following text, to create the material, and save:&lt;br /&gt;
 ''material megatextures/sdk/terrain_mesh_sdk	{ useTemplate megatextures/default_ambient&amp;lt; &amp;quot;sdk/terrain_mesh_sdk&amp;quot; &amp;gt; }''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Construct the Megatexture =&lt;br /&gt;
This section will cover the step by step creation of the megatexture using Terrain Editor (an inspector tab in EditWorld).  For Detailed explanation on feilds and setting not discussed here, check out the [[Terrain_Editor|Terrain Editor]]&lt;br /&gt;
&lt;br /&gt;
=== Set up the Map ===&lt;br /&gt;
* Load EditWorld, and create a new map.&lt;br /&gt;
* Bring up the [[Terrain Editor]] inspector.&lt;br /&gt;
* {{accelbtn|RMB}} in the left blank (white) area.  In the pop-up menu select ''New'' | ''Tree...''&lt;br /&gt;
* On the Root node set the model field to ''base/models/terrain/sdk/terrain_mesh_sdk.lwo'', and also set the ST Model to the same model.  If you have holes in your mesh (holes cut for buildings), you'd need to make a separate ST Model version with no mesh holes.&lt;br /&gt;
* Seal the map up by [[A_Simple_First_Terrain#Creating a Caulk Hull|Creating a Caulk Hull]].  Make sure the origin of the terrain mesh is inside this hull.&lt;br /&gt;
*For the area to be lit by the sun, create a brush inside the caulk hull, textured with 'editor/outsideportal'.&lt;br /&gt;
*To set the atmosphere create an Atmosphere entity and set '''atmospheredecl''' to '''Valley01''' (or what ever atmosphere you're using).&lt;br /&gt;
&lt;br /&gt;
=== Detail Textures ===&lt;br /&gt;
Also on the Root node is where the detail textures are assigned. In each of the layers created, you assign which of these 4 detail textures to use. Detail Textures need to be a greyscale 512x512 texture (preferably saved in ''base/textures/detail/'').&lt;br /&gt;
{| cellspacing=&amp;quot;8&amp;quot; border=&amp;quot;0&amp;quot;&lt;br /&gt;
|'''Detail Texture 0'''&lt;br /&gt;
|&lt;br /&gt;
|'''textures/detail/temperate_dirt.tga'''&lt;br /&gt;
|-&lt;br /&gt;
|'''Detail Texture 1'''&lt;br /&gt;
|&lt;br /&gt;
|'''textures/detail/temperate_grass.tga'''&lt;br /&gt;
|-&lt;br /&gt;
|'''Detail Texture 2'''&lt;br /&gt;
|&lt;br /&gt;
|'''textures/detail/temperate_gravel.tga'''&lt;br /&gt;
|-&lt;br /&gt;
|'''Detail Texture 3'''&lt;br /&gt;
|&lt;br /&gt;
|'''textures/detail/temperate_rock.tga'''&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Image Sources ===&lt;br /&gt;
Here we'll start to create the texture layers that build up the Megatexture. The steps will progressively skip repetitive information about the layer setup.&lt;br /&gt;
&lt;br /&gt;
;Ground_Base&lt;br /&gt;
* Create a '''Group node''', {{accelbtn|RMB}} and  with the pop-up menu select ''New'' | '''Group'''. In the right field you can enter a name for the Group, we'll name this one '''Ground_Base'''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;Dirt&lt;br /&gt;
* Now we'll create a base '''Image Source''' node. {{accelbtn|RMB}} over the Group node, and create an '''Image Source''' node, this should create it as a child to the Group.  If you accidently created the Image node under the Root, don't worry as you can drag and release over the Group node to make it a child.  Name the Layer '''Dirt''', same way as the Group node.&lt;br /&gt;
* Apply a Diffuse texture by selecting '''Diffuse''' on the right hand panel of the inspector, then selecting the '''File Name''' field and press the '''...''' button to choose a texture.  For this layer we'll use '''textures/megagen/temperate/dirt_06_d.tga'''&lt;br /&gt;
* Repeat the same process for the '''Local''' image by selecting '''Local''' on the right, and applying the texture '''textures/megagen/temperate/dirt_06_local.tga'''&lt;br /&gt;
* As this is the base layer, the '''Distribution''' needs to cover the whole map.  So apply a full white image the same way as above but to the '''Distribution'''.&lt;br /&gt;
* This layer is a dirt layer so I'll set the the '''Detail Texture Type''' to '''0''', to match the number for the dirt detail texture.&lt;br /&gt;
* Also as this layer is dirt I'll set '''Sur Type Properties''' | '''Type''' to '''dirt'''. For a full list of usable surface types, check the [[Terrain_Editor#Surface_Type|Surface Type]] section.&lt;br /&gt;
* The diffuse texture has the dimensions 1024 x 1024, while the map covers 8192.  To keep the correct texture ratio, set '''Texture Properties''' | '''Scale''' to '''8 8'''.&lt;br /&gt;
* '''Texture Properties''' | '''Rotation''' is set to '''270''' to keep the to match the texture lighting to that of the atmosphere.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:AdvMega_2Layers.png|thumb|300px|right|Blend with Distribution Pattern]]&lt;br /&gt;
;Sand&lt;br /&gt;
* Sand will settle along the flow lines, as it's been washed down with the weather.&lt;br /&gt;
* Create this layer in the same way as the '''Dirt''' layer.  The '''Diffuse''' and '''Local''' can also be set up in the same way except choosing temperate/dirt_07 as the textures.&lt;br /&gt;
* This layer will require a unique '''Distribution''' image.  The flow masks ([[# Convert World Machine masks to UV space|UV corrected]]) created from [[# World Machine: Adding Flow|World Machine]] were used to help create '''textures/megagen/terrain_mesh_sdk/masks/masks_sand.tga''' which is applied as the '''Distribution'''.&lt;br /&gt;
* To make the blend more fitting and unique set the '''Distribution Pattern''' to '''textures/megagen/temperate/dirt_06_mask_inverse.tga'''.  This will blend the '''Sand''' into the cracks of the '''Dirt''' before the peaks (stones).&lt;br /&gt;
* '''Ramp Width''' is changed to '''0.5''' so the blend will become tighter.&lt;br /&gt;
* '''Distribution Pattern Texture Rotation''' and '''Scale''' Should match that of the '''Dirt''' layer, as it's using a Distribution Pattern that matches the dirt.&lt;br /&gt;
* Set the '''Detail Texture Type''' to '''0''' (dirt, as it's the best matching of the four), and the '''Surface Type Properties''' | '''Type''' to '''sand'''.&lt;br /&gt;
* To see how the Megatexture is progressing, render a [[Terrain_Editor#Megatexture_Preview|Megatexture Preview]] [[Image:TerEd_PreviewRender.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;Gravel&lt;br /&gt;
* To give the look off loose stones being scatter from the road.&lt;br /&gt;
* Create in the same way as above.  Was created after the [[#Road_Tool|Road Layer]] being placed.&lt;br /&gt;
* The '''Distribution Pattern''' image for this layer will match it's own gravel diffuse, so the '''Rotation''' and '''Scale''' for the '''Diffuse''' and '''Distribution Pattern''' images should be the same.&lt;br /&gt;
* Set the '''Detail Texture Type''' to '''2''' (textures/detail/temperate_gravel.tga), and the '''Surface Type Properties''' | '''Type''' to '''gravel'''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;Dry_Dirt&lt;br /&gt;
* Gives a dried up cracked earth appearance, were standing water would have once been.&lt;br /&gt;
* Slight transparency given so layer blends smoother over light sand and darker dirt, '''Alpha''' set to '''0.75'''&lt;br /&gt;
* '''Ramp Width''' set to '''0.25''' making the blend even tighter (sharper).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;Sticks&lt;br /&gt;
* Helps the grass blend in with the dirt.&lt;br /&gt;
* Created after the grass, then layer moved above by dragging and releasing between the layers '''Grass_Outer''' and '''Dry_Dirt'''.&lt;br /&gt;
* '''Ramp Width''' set to '''0.75''' so the blend can be softer.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;Grass_Outer&lt;br /&gt;
* Texture used is of a patchy grass, good for grass on the edges of a grass clump.&lt;br /&gt;
* '''Distribution Pattern''' texture carefully made so the dirt parts of the diffuse blend in last.&lt;br /&gt;
* Texture '''Rotation''' set to '''300''', this is to break up the look of textures tiling in the same direction.&lt;br /&gt;
* The '''Detail Texture Type''' is set to '''1''' (textures/detail/temperate_grass.tga), and the '''Surface Type Properties''' | '''Type''' to '''grass'''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;Grass_Inner&lt;br /&gt;
* Dense Grass, blended to cover the dirt of the patchy grass texture ('''Grass_Outer'''), where the mask become more solid (white).&lt;br /&gt;
* Uses the same '''Distribution''' mask as '''Grass_Outer''', as the '''Distribution Pattern''' texture is made so that it is never stronger than that of the patchy grass.&lt;br /&gt;
* Texture '''Rotation''' and '''Scale''' needs to match that of '''Grass_Outer''' as the '''Distribution Pattern''' textures of both grass layers work together, with the same '''Distribution'''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;Stones&lt;br /&gt;
* Create the Stone '''Distribution''' after the solid rock layers, as the rock will look better when it blends to the stones.  To find out where rocks are distributed exactly, [[Terrain_Editor#Megatexture_Preview|Preview Render]] the megatexture with the rocks layer tinted black, and only a white base layer.  The Preview Megatexture will be saved to ''base/imagedump/maps/&amp;lt;map_name&amp;gt;'' and flipped vertically.&lt;br /&gt;
* As well as being concentrated around the solid rock sections, stones should flow down the surrounding slopes.&lt;br /&gt;
* Make the Stones more dense around rocks.&lt;br /&gt;
* The '''Distribution Pattern''' texture has been created so the stones will blend in one by one.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:AdvMega_GroundLayers.png|thumb|300px|right|Ground Base Layers]]&lt;br /&gt;
;Pebbles&lt;br /&gt;
* Pebbles in Mud works well around the waterline.&lt;br /&gt;
* The '''Distribution''' mask is made slightly darker where the sand '''Distribution''' is.  This will give good variation, as the Pebbles will blend in first (due to '''Distribution Pattern'''), making them appear to be on sand instead of mud.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;Rock&lt;br /&gt;
* A new '''Group''' is created under the '''Root''' node to keep the rock elements neatly together.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;Rock_Base&lt;br /&gt;
* Rock should usually be created (distributed) near the start of making a megatexture, as rock usually effects where all other elements will be distributed.&lt;br /&gt;
* Texture '''Rotation''' for both '''Diffuse''' and '''Distribution Pattern''' is set to '''0.45''', this is so the rock diffuse is rotated to match the direction of the rock in the map.  If you have rock in all directions you could make separate rock masks for the different rotations.&lt;br /&gt;
* A '''Heightmap''' image is assigned, '''textures/megagen/temperate/rock_01_h.tga'''.  This will help the '''Rock_Stain_(HeightMap)''' blend into the cracks.&lt;br /&gt;
* Set the '''Propagate Distribution''' to '''true''', by ticking the box.  This will mask any child layers with this layers distribution.&lt;br /&gt;
* The '''Detail Texture Type''' is set to '''3''' (textures/detail/temperate_rock.tga), and the '''Surface Type Properties''' | '''Type''' to '''stone'''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;Rock_Smooth&lt;br /&gt;
* By distributing smooth rock on raised and large flat areas, while not in cracks and around rock edges, will help to give it shape.&lt;br /&gt;
* This layer can be set up in the same way as '''Rock_Base''' (incuding having a heightmap image), except you don't need to '''Propagate Distribution'''.&lt;br /&gt;
* Use the same '''Distribution Pattern''' used in '''Rock_Base''' so the smooth rock will form on the ridges first.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;Rock_Horizontal&lt;br /&gt;
* This layer will use a different technique to create horizontal crack lines in the rock.&lt;br /&gt;
* Most of the settings can be set up in the same way as the previous rock layers.&lt;br /&gt;
* Use the same '''Distribution Pattern''' used in '''Rock_Base''' (including the same scale and rotation).&lt;br /&gt;
* Set the '''Projector Pattern''' image to the horizontal rock distribution pattern ('''textures/megagen/temperate/rock_04_mask.tga''').&lt;br /&gt;
* Set the last value of the '''Blend Parameters''' giving 0 0 0 '''0.75''', this controls the sharpness off the '''Projector Pattern''' blend.&lt;br /&gt;
* The '''Distribution''' mask should only include steep polygons that face the angle of projection (this will prevent texture stretching).&lt;br /&gt;
* Set '''Image Renderer''' | '''UV Type''' to '''Parallel Side'''.  This will force the layer to render has a side projection.  For this to work correctly, the terrain mesh needs to be centered around the grid origin.&lt;br /&gt;
* Set '''Image Renderer''' | '''Projection Angle''' to '''135''', so the projection is in the direction of the vertical rock face (this will rotate the projection around the Z axis).&lt;br /&gt;
* '''Texture Properties''' | '''Scale''' to '''6 2''', as this is a side projection, the number of tiles should match the side profile of the mesh.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:AdvMega_RockLayers.png|thumb|300px|right|Rock with Horizontal Projection]]&lt;br /&gt;
;Rock_Stain(Heightmap)&lt;br /&gt;
* This layer will create darker staining on the rock, by the use of a heightmap blend.&lt;br /&gt;
* The way this blend method works is it renders all the heightmaps from each of the layers first, and then blends the diffuse &amp;amp; local images into the lower (darker) parts of the heightmap.&lt;br /&gt;
* Assign a black texture ('''textures/megagen/black.tga''') to the '''Heightmap''' image, this will help the staining occur stronger based on the '''Distribution''' mask.&lt;br /&gt;
* Set the first 2 values of the '''Blend Parameters''' giving '''0.33 0.25''' 0 0 . The first value (0.33) controls the height at which the blend takes place, while the second (0.25) controls the sharpness of the falloff in the blend.&lt;br /&gt;
* Set the '''Color''' of the layer to '''black''', either by texture or color tinting.&lt;br /&gt;
* No '''Local''' map required&lt;br /&gt;
* '''Alpha''' set to 0.5 so the rock texture underneath shows through.&lt;br /&gt;
* '''Detail Texture Type''' set to -1 , this will disable distributing detail textures for this layer.&lt;br /&gt;
* Leave the '''Surface Type Properties''' | '''Type''' field blank.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;Water_Line&lt;br /&gt;
* A new '''Group''' is created under the '''Root''' node to keep the water line elements neatly together.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;Water_Line_(Geometry_Based)&lt;br /&gt;
* This layer will give a look of wet ground.&lt;br /&gt;
* Set the '''Blend''' mode to '''Multiply (d*s)''', this will darken (multiply) over the textures underneath.&lt;br /&gt;
* Assign the '''Diffuse''' to '''textures/megagen/white.tga''', and '''Color''' tint to '''Hue 0, Saturation 0, Brightness 180'''&lt;br /&gt;
* For the '''Distribution''', change '''Source Type''' to '''geometryBased'''.  '''Enable''' the '''Altitude Upper''', set the '''Value''' to '''800''' (32 units just above the water line), and '''Fuzziness''' to '''0.075''' (the falloff).  '''Resolution''' can be set to '''1024''' (generated texture size of the mask).&lt;br /&gt;
* Again '''Detail Texture Type''' set to -1&lt;br /&gt;
* '''Surface Type Properties''' | '''Type''' set to '''water''', so allow splashes to form on the shoreline.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;Water_Fade_(Geometry_Based)&lt;br /&gt;
* This will help give the water depth (and reduce megatexture size ;)&lt;br /&gt;
* Setup in the same way as '''Water_Line_(Geometry_Based)''' above, except:&lt;br /&gt;
* Set the '''Blend''' mode to '''Blend''', this will cover over the textures underneath (looking similar to fog).&lt;br /&gt;
* '''Color''' tint set to '''Hue 60, Saturation 115, Brightness 22'''&lt;br /&gt;
* With '''Source Type''' set to '''geometryBased''', change the '''Altitude Upper''' | '''Value''' to '''768''' (water height) and '''Fuzziness''' to '''1''' (larger falloff).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;Perturbate&lt;br /&gt;
* Create under the '''Root''' node.  Will bring back the normals to that of the [[#Perturbate Image (Normal Map)|high-res mesh]], improving the baked lighting.&lt;br /&gt;
* Set the '''Blend''' mode to '''Perturbate Normals''', this will add the normals to those already generated by the other layers.&lt;br /&gt;
* Assign no '''Diffuse''' texture.&lt;br /&gt;
* Assign a white texture to the '''Distribution''' (as to cover the whole megatexture).&lt;br /&gt;
* Set the '''Local''' texture to '''textures/megagen/terrain_mesh_sdk/local.tga''' (the mesh's normal map).&lt;br /&gt;
* '''Detail Texture Type''' set to -1&lt;br /&gt;
* Leave the '''Surface Type Properties''' | '''Type''' field blank.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:AdvMega_AmbOcc.jpg|thumb|200px|right|Ambient Occlusion map]]&lt;br /&gt;
;Ambient_Occlusion&lt;br /&gt;
* Also created under the '''Root''' node.  Rendered in ''Maya'' to emulate light being occluded in crevices.&lt;br /&gt;
* Set the '''Blend''' mode to '''Multiply (d*(s*1.6)'''. in this blend mode diffuse image colors darker than 160 will darken the previous layers, while colors brighter than 160 will lighten.&lt;br /&gt;
* Assign '''textures/megagen/terrain_mesh_sdk/ambient_occlusion.tga''' as the Diffuse.  The image is balanced so that areas of no change are around 160 in color brightness.&lt;br /&gt;
* Assign a white texture to the '''Distribution''' (as to cover the whole megatexture).&lt;br /&gt;
* '''Detail Texture Type''' set to -1&lt;br /&gt;
* Leave the '''Surface Type Properties''' | '''Type''' field blank.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Road Tool ===&lt;br /&gt;
Here we'll create a paved road using the [[Terrain_Editor#Road_Node|Road Tool]].&lt;br /&gt;
* First we'll create a '''Road Template (.rtl)''', to assign what textures and surface type to assign to the road.&lt;br /&gt;
* Create a blank file '''base/megagen/roadtemplates/terrain_mesh_sdk.rtl''' and add the needed information:&lt;br /&gt;
 roadTemplate sdk_main_road {&lt;br /&gt;
     {&lt;br /&gt;
         diffuse image sdTextureTGA_Properties {&lt;br /&gt;
             name &amp;quot;textures/megagen/temperate/road_01_d.tga&amp;quot;&lt;br /&gt;
         }&lt;br /&gt;
         local image sdTextureTGA_Properties {&lt;br /&gt;
             name &amp;quot;textures/megagen/temperate/road_01_local.tga&amp;quot;&lt;br /&gt;
         }&lt;br /&gt;
         distribution image sdTextureTGA_Properties {&lt;br /&gt;
             name &amp;quot;textures/megagen/temperate/road_01_mask.tga&amp;quot;&lt;br /&gt;
         }&lt;br /&gt;
         offset ( -1 1 )&lt;br /&gt;
         surfaceType &amp;quot;pavement&amp;quot;&lt;br /&gt;
         detailtexture &amp;quot;textures/detail/temperate_gravel.tga&amp;quot;&lt;br /&gt;
         }&lt;br /&gt;
 }&lt;br /&gt;
Here we've given the road material a name '''sdk_main_road''', and set the '''Diffuse''', '''Local''', and  '''Mask''' textures.  Also setting the '''Surface Type''' to '''pavemant''', and '''Detail Texture''' to '''textures/detail/temperate_gravel.tga''' (which also must be assigned in the '''Root''' node).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:AdvMega_RoadLayer.png|thumb|300px|right|Road Tool]]&lt;br /&gt;
;Main_Road&lt;br /&gt;
* Create the '''Road''' node, {{accelbtn|RMB}} over the Root node, a pop-up menu will appear and select ''New'' | '''Road'''.&lt;br /&gt;
* Set '''Road Template''' to '''sdk_main_road''', this points the road tool to the correct road template.&lt;br /&gt;
* Start placing the road along the map:&lt;br /&gt;
** select the node&lt;br /&gt;
** click on the ''XY Top'' window&lt;br /&gt;
** enter vertex editing mode ({{accelkey|v}})&lt;br /&gt;
** hold {{accelkey|Ctrl}}{{accelkey|Shift}} and {{accelbtn|lmb}} in the ''XY Top'' window to start placing the points that make up the road curve.&lt;br /&gt;
* Now to fix the width and direction of the road.&lt;br /&gt;
** You need to be in vertex editing mode if not already (toggled with {{accelkey|v}}).&lt;br /&gt;
** '''Moving Road Points''' click and drag the blue points.&lt;br /&gt;
** '''Change Points Direction''' click and drag the yellow points.&lt;br /&gt;
** '''Change Width of Road''' click and drag out the red points.  Alternatively you can widen the whole road when outside the vertex editing mode by selecting the Road node, then click and drag beside the road.&lt;br /&gt;
** '''Adding new Points''' hold ''Ctrl Shift'' and ''Left Click'' the area where you want create the new point.&lt;br /&gt;
** '''Deleting Points''' click and hold the blue point you want to delete and press ''Backspace''.&lt;br /&gt;
** Press {{accelkey|Esc}} to exit vertex editing mode.&lt;br /&gt;
* The Road Tool must never cross a mesh border, so make sure you bump in your road by at least one unit.  If it does cross a border the Road Tool will render with an artifact stretching to the mesh corner.&lt;br /&gt;
*Finally move the layer into it's correct place for rendering.  Drag and release the node between the '''Ground_Base''' and '''Rock''' group node.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Projector ===&lt;br /&gt;
Using the projector node, localized texture detail can be projected onto the megatexture.&lt;br /&gt;
&lt;br /&gt;
;Projectors&lt;br /&gt;
Created a groups to keep things nice an neat.&lt;br /&gt;
&lt;br /&gt;
;Cracked_Road&lt;br /&gt;
* To give the look of cracked tar where the crater nears the road.&lt;br /&gt;
* Create the '''Road Node''', {{accelbtn|RMB}} over the '''Projectors''' Group node, a pop-up menu will appear and select ''New'' | '''Projector'''.&lt;br /&gt;
* Setup the '''Projector''' the same way you would a standard '''Image Source''' node, except you only need a '''Distribution''' mask (and not a '''Distributed Pattern), as the texture shouldn't be projected larger than the source textures.&lt;br /&gt;
* To place the projector move/scale/rotate as you would a normal brush (including vertex editing).  The projector should be positioned above the terrain mesh.&lt;br /&gt;
&lt;br /&gt;
;Crater&lt;br /&gt;
* Places the crater scorch marks.&lt;br /&gt;
* Setup the same way as '''Cracked_Road'''.&lt;/div&gt;</summary>
		<author><name>MoP</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.splashdamage.com/index.php?title=A_Simple_First_Megatexture&amp;diff=4019</id>
		<title>A Simple First Megatexture</title>
		<link rel="alternate" type="text/html" href="https://wiki.splashdamage.com/index.php?title=A_Simple_First_Megatexture&amp;diff=4019"/>
		<updated>2007-12-13T17:31:21Z</updated>

		<summary type="html">&lt;p&gt;MoP: Just create a new node, don't step through it&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Image:simplemega_ingame.jpg|right|thumb|500px|A simple MegaTexture, easily created with only 3 texture layers!]]&lt;br /&gt;
So now that you've made [[A Simple First Terrain]], no doubt you'll want to apply a MegaTexture to it! This MegaTexture won't be as detailed or as attractive as an advanced MegaTexture, but will demonstrate the basics of creating a [[Surface Tree]], assigning textures, and compiling it all into a working MegaTexture file.&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
'''For this tutorial you must:'''&lt;br /&gt;
* Have a terrain model UV-mapped in the 0-1 range (covered in the simple first terrain tutorial)&lt;br /&gt;
* Have access to some tiling textures.&lt;br /&gt;
* Have a little understanding the ETQW material system&lt;br /&gt;
&lt;br /&gt;
If you don't have any of the above things, you are not ready to do this tutorial!&lt;br /&gt;
&lt;br /&gt;
'''This tutorial covers:'''&lt;br /&gt;
* How to set up a MegaTexture material&lt;br /&gt;
* How to create a Surface Tree&lt;br /&gt;
* How to add texture nodes in the Terrain Editor&lt;br /&gt;
* How to render and compile a full MegaTexture&lt;br /&gt;
&lt;br /&gt;
'''This tutorial does not cover:'''&lt;br /&gt;
* How to use Blender/Maya/Lightwave/ZBrush/Mudbox/3DSMax/Photoshop&lt;br /&gt;
* How to create tiling textures or heightmaps&lt;br /&gt;
* Anything overly complicated&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Creating a MegaTexture material =&lt;br /&gt;
Firstly you need to create a new material for your terrain to use. If you have never made a new material before, read the article on [[Adding Custom Textures]]. All you need to do is create (or use an existing) ''.mtr'' file and place a material declaration in it, in the manner shown here:&lt;br /&gt;
 material megatextures/mapname		{ useTemplate megatextures/default_ambient&amp;lt; &amp;quot;mapname&amp;quot; &amp;gt; }&lt;br /&gt;
&lt;br /&gt;
This material would automatically search for a MegaTexture called {{filename|mapname.mega}} in the {{filename|/megatextures/}} folder. This example material uses the ''&amp;quot;default_ambient&amp;quot;'' template, which expects a 3-channel RGB MegaTexture. These are generated by the default settings of the [[Generate a MegaTexture|MegaTexture tab in the SDK Launcher]].&lt;br /&gt;
&lt;br /&gt;
Obviously you would want to use the actual name of your map instead of &amp;quot;mapname&amp;quot;, for consistency's sake and ease of reference.&lt;br /&gt;
&lt;br /&gt;
Remember that if you made a new ''.mtr'' file after the game or editor was started, you'll have to restart the whole game and editor before it will read your new file.&lt;br /&gt;
&lt;br /&gt;
=== Assigning the material ===&lt;br /&gt;
You should assign the material you just created by naming a material in your 3D application and applying it to your terrain mesh, then export the model to your preferred format (LWO, ASE or OBJ).&lt;br /&gt;
Tips on this process can be found in the [[A Simple First Terrain|simple first terrain tutorial]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Creating the Surface Tree =&lt;br /&gt;
As described in the Simple First Terrain tutorial, terrain models are set up in the Terrain Editor, accessible via {{accelkey|shift}}{{accelkey|N}} in [[editWorld]]. This tool creates a Surface Tree file ({{filename|.sft}}) that contains all the information about the terrain, including roads, stamps, and detail texture information that MegaGen needs to generate a MegaTexture. The Surface Tree will be saved every time the map is saved, or any time you press the &amp;quot;Save and Unload&amp;quot; button in the Terrain Editor.&lt;br /&gt;
[[Image:simplemega_terrainmodel.png|thumb|300px|Root node set up to use the correct terrain mesh]]&lt;br /&gt;
&lt;br /&gt;
=== Add the terrain mesh ===&lt;br /&gt;
Here's how you bring the terrain mesh into the surface tree:&lt;br /&gt;
* {{accelbtn|RMB}} on the left-hand pane, and choose ''New -&amp;gt; Tree'' via the menu.&lt;br /&gt;
** If you already have a Root node, click the &amp;quot;Begin Editing&amp;quot; button instead.&lt;br /&gt;
* Click on the Root node, and set {{keyname|Model}} to the name of the terrain mesh, in this case {{keyvalue|models/terrain/simpleterrain.obj}}.&lt;br /&gt;
* Press {{accelkey|enter}} to confirm the selection, and the terrain should appear in the 3D view.&lt;br /&gt;
&lt;br /&gt;
Be aware that your terrain model will probably appear bright orange or red.&lt;br /&gt;
The console will probably give you a few WARNING messages, don't worry about these for now, this is because your Megatexture doesn't exist yet!&lt;br /&gt;
&lt;br /&gt;
=== Important note about nodes ===&lt;br /&gt;
When you are editing properties of nodes (names, numbers, texture sources etc.) always remember to hit {{accelkey|enter}} after changing a value, to make sure that the value is stored. If you just type something in and then click somewhere else without pressing {{accelkey|enter}}, your changes may not be applied.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Create the first texture node ==&lt;br /&gt;
[[Image:simplemega_firstnode_diffuse.png|thumb|300px|The first texture node's diffuse texture properties]]&lt;br /&gt;
Now that the model is in place, you can start laying down the texture layers (or &amp;quot;nodes&amp;quot;) that will make up your MegaTexture.&lt;br /&gt;
&lt;br /&gt;
First you need to create a new Image Source node in the Terrain Editor.&lt;br /&gt;
* {{accelbtn|RMB}} on your &amp;quot;Root&amp;quot; node and choose ''New -&amp;gt; Image Source'' (or press {{accelkey|shift}}{{accelkey|i}})&lt;br /&gt;
* This will make a new node called &amp;quot;New Image Renderer&amp;quot;.&lt;br /&gt;
* You can rename this new node using the &amp;quot;Name&amp;quot; property field in the '''Object''' section.&lt;br /&gt;
* Rename the node &amp;quot;Dirt&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You will notice in the top right of the Terrain Editor, a section listing things like &amp;quot;Diffuse&amp;quot;, &amp;quot;Distribution&amp;quot;, &amp;quot;Distribution Pattern&amp;quot; etc. Selecting one of these will list all of the properties for that section of the current node.&lt;br /&gt;
The ones we need to worry about are as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Diffuse'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
This is the colour map of the current node, and it should point to a tiling TGA texture.&lt;br /&gt;
* Make sure the Diffuse section is highlighted in the top right of the Terrain Editor.&lt;br /&gt;
* In the ''File Name'' field of the '''Image Properties''' section, browse to a generic tiling dirt texture. Remember to hit {{accelkey|enter}} afterwards!&lt;br /&gt;
** This example is using {{filename|textures/megagen/temperate/dirt_02_d.tga}}&lt;br /&gt;
* The ''Scale'' field at the very bottom of the property list allows you to choose how much to tile the texture.&lt;br /&gt;
** The default value is 1 1, but you don't want that since it will stretch your texture over the whole mesh, and look really blurry!&lt;br /&gt;
** Instead set the Scale to something like 48 48, this means that the texture will be repeated 48 times across each axis of the terrain. This results in a sharper final output.&lt;br /&gt;
That's all you need to do for the Diffuse settings in this node.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Distribution'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
This is how we control where the layer is drawn (ie. no grass underwater, no sand on angles over 60 degrees etc). It's basically a big mask where ''white = fully shown'' and ''black = fully hidden''.&lt;br /&gt;
* Make sure the Distribution section is highlighted in the top right.&lt;br /&gt;
* Since this is our first node, we want to show over the whole terrain. This means the distribution map should be 100% white.&lt;br /&gt;
* You can either assign a pure white TGA texture, or change the ''Source Type'' to ''geometryBased''.&lt;br /&gt;
** ''geometryBased'' will by default create a fully white map, so if you don't have a white TGA handy, this is faster.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Distribution Pattern'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
This controls how the current node blends into others. Usually this will be set to a tiling TGA heightmap texture that matches the Diffuse texture.&lt;br /&gt;
* We don't need a Distribution Pattern for the first node, since it doesn't blend with anything. Nodes on top of this one will need Distribution Patterns for more interesting and natural blends though!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Local'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
This is the normal-map of the current node. This should be a tiling TGA texture representing the local normal information of the matching Diffuse texture.&lt;br /&gt;
* Make sure the Local section is highlighted in the top right.&lt;br /&gt;
* In the ''File Name'' field of the '''Image Properties''' section, browse to the matching normal map for your tiling dirt texture.&lt;br /&gt;
** This example is using {{filename|textures/megagen/temperate/dirt_02_local.tga}}&lt;br /&gt;
* The Local texture's tiling amount is automatically the same as the Diffuse texture.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Surface Type'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
Your image nodes should all specify a surface type, so that when players walk over or shoot the surface, it gives the correct sound and particle effects.&lt;br /&gt;
* Find the ''Surface Type Properties'' section of the property list.&lt;br /&gt;
* In the '''Type''' field, enter ''dirt''. It should drop down a list of valid surface types as soon as you hit the first letter.&lt;br /&gt;
* Hit {{accelkey|enter}} to accept the surface type.&lt;br /&gt;
&lt;br /&gt;
Your dirt textures will now produce correct &amp;quot;dirt&amp;quot; effects when shot or collided with!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Previewing the result'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
[[Image:simplemega_firstnode_preview.jpg|thumb|300px|The Render mode preview of the first node]]&lt;br /&gt;
Now we can easily check if this is all set up correctly. You should notice a little icon at the top left of your Terrain Editor which looks like this: [[Image:simplemega_previewbutton.png|MegaTexture Render Preview button]]&lt;br /&gt;
&lt;br /&gt;
* Notice the drop-down arrow on the right of the button. Click it, and select ''&amp;quot;Full&amp;quot;'' instead of ''&amp;quot;None&amp;quot;''.&lt;br /&gt;
* Your terrain should change colour to black. This means it's ready for a preview to be rendered onto it.&lt;br /&gt;
* Click the button itself now, instead of the drop-down. An &amp;quot;Active Tasks&amp;quot; window should pop up, and when it's done, you should see your dirt texture appear on your terrain model.&lt;br /&gt;
* You can switch the camera to Render mode too, which will show your terrain model's shading better.&lt;br /&gt;
* If you want a full-resolution preview of a small area, choose ''&amp;quot;Window&amp;quot;'' instead of ''&amp;quot;Full&amp;quot;'' from the drop-down menu.&lt;br /&gt;
** This creates a small window that you can move around using {{accelbtn|LMB}}-drag in the XY Top view. Simply position the window where you want to preview the full-resolution MegaTexture, and hit the Render Preview button.&lt;br /&gt;
&lt;br /&gt;
Now any time you add new nodes, or change a node's properties, you can just click the Render Preview button and the view will update with your changes.&lt;br /&gt;
&lt;br /&gt;
'''Important note:''' Running a 3D application such as Blender, Maya, 3dsmax etc. in the background, may prevent a MegaTexture preview being rendered correctly. If your node is set up correctly but the preview render is appearing as black or patchy, make sure you have closed any 3D applications and try re-rendering the preview.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Adding a second node ==&lt;br /&gt;
Now that the first layer of dirt is in place, we can try putting some grass on top of it!&lt;br /&gt;
* Again, {{accelbtn|RMB}} on your &amp;quot;Root&amp;quot; node and choose ''New -&amp;gt; Image Source'' (or press {{accelkey|shift}}{{accelkey|i}})&lt;br /&gt;
* This will make another new node below your &amp;quot;Dirt&amp;quot; node. &lt;br /&gt;
* Name this new node &amp;quot;Grass&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Surface Tree hierarchy is rendered from the top down, so nodes ''above'' other nodes in the hierarchy will be rendered ''before'' the other nodes. So currently it'll be rendering our Dirt node, and then rendering the Grass node on top of the dirt.&lt;br /&gt;
&lt;br /&gt;
Again, the main map types need to be specified before the node can be rendered:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Diffuse'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
* Make sure the Diffuse section is highlighted in the top right of the Terrain Editor.&lt;br /&gt;
* In the ''File Name'' field of the '''Image Properties''' section, browse to a generic tiling grass texture.&lt;br /&gt;
** This example is using {{filename|textures/megagen/temperate/grass_04_d.tga}}&lt;br /&gt;
* Again you will want to set the ''Scale'' value to something other than 1 1, to tile your texture. Let's use 32 32 for this one.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Distribution'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
This is important now, since we need to control where this layer is visible. Pure white won't work, since that'll just completely cover our underlying Dirt node!&lt;br /&gt;
* Make sure the Distribution section is highlighted in the top right.&lt;br /&gt;
* Change the &amp;quot;Source Type&amp;quot; from ''texture'' to ''geometryBased''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Geometric Texture Distribution'''&lt;br /&gt;
----&lt;br /&gt;
[[Image:simplemega_geometric_distribution.png|thumb|300px|The geometric texture distribution settings of the second node]]&lt;br /&gt;
This is where it gets interesting! There are many settings to alter, and they can have a drastic effect on how different your terrain looks, so try playing around with different values if you're not happy with the initial results.&lt;br /&gt;
&lt;br /&gt;
* '''Altitude Lower''' - Enabling this will limit the lower parts of the terrain from receiving this node's textures.&lt;br /&gt;
** '''Altitude Lower Value''' - The Z height in world units that the node will be drawn above. The default of 0 means that any parts of your terrain mesh below Z=0 will not show any of this node's textures.&lt;br /&gt;
** '''Fuzziness''' - The amount of blur applied to the mask, ranges between 0.0 and 1.0. The higher the value, the more blurry the boundary.&lt;br /&gt;
* '''Altitude Upper''' - Enabling this will limit the higher parts of the terrain from receiving this node's textures.&lt;br /&gt;
** '''Altitude Upper Value''' - The Z height in world units that the node will be drawn below. The default of 0 means that any parts of your terrain mesh above Z=0 will not show any of this node's textures.&lt;br /&gt;
** '''Fuzziness''' - The amount of blur applied to the mask, ranges between 0.0 and 1.0. The higher the value, the more blurry the boundary.&lt;br /&gt;
&lt;br /&gt;
* '''Clamp Distribution To Edge''' - Leave this on Default.&lt;br /&gt;
&lt;br /&gt;
* '''Resolution''' - The size in pixels of the resulting mask. The default value of 256 is fine for nearly any terrain model.&lt;br /&gt;
&lt;br /&gt;
* '''Slope Lower''' - Enabling this will limit shallower angles of the terrain model from receiving this node's textures.&lt;br /&gt;
** '''Slope Lower Value''' - The angle in degrees that the node will be drawn past. The default angle of 0 will result in no change to your mask.&lt;br /&gt;
** '''Fuzziness''' - The amount of blur applied to the mask, ranges between 0.0 and 1.0. The higher the value, the more blurry the boundary.&lt;br /&gt;
* '''Slope Upper''' - Enabling this will limit the steeper angles of the terrain model from receiving this node's textures. This is great for masking out cliffs from your nodes.&lt;br /&gt;
** '''Slope Upper Value''' - The angle in degrees that the node will be hidden past. The default angle of 0 will result in a fully black mask.&lt;br /&gt;
** '''Fuzziness''' - The amount of blur applied to the mask, ranges between 0.0 and 1.0. The higher the value, the more blurry the boundary.&lt;br /&gt;
&lt;br /&gt;
The settings you use for each of these will vary depending on your terrain model, and the type of node you're making. For our Grass node, you can see the settings used for this example in the screenshot above on the right.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Distribution Pattern'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
[[Image:simplemega_dist_ramps.jpg|thumb|300px|The difference between using or not using a Distribution Pattern, and varying Ramp Widths]]&lt;br /&gt;
This controls how the the grass will blend into the dirt. If you don't have a Distribution Pattern texture, the grass will just slowly fade into the dirt, which doesn't look very natural!&lt;br /&gt;
So what we want here is a texture to identify the &amp;quot;height&amp;quot; of the areas of grass. This means that the dirt can blend in based on the height of each clump of grass, so instead of a smooth fade you will get a more natural blend between the grass and the dirt.&lt;br /&gt;
&lt;br /&gt;
If you examine the screenshot to the right, you can see what effect a good Distribution Pattern can have - when the node is rendered with no Distribution Pattern, the blend between the nodes is a simple smooth gradient, which does not look very natural at all. You can also see the difference that the '''Ramp Width''' value makes - this is a very powerful value, so experiment with it until you really understand the effect it has!&lt;br /&gt;
&lt;br /&gt;
* Make sure the Distribution Pattern section is highlighted in the top right.&lt;br /&gt;
* In the ''File Name'' field of the '''Image Properties''' section, browse to the matching heightmap or mask for your tiling grass texture.&lt;br /&gt;
** This example is using {{filename|textures/megagen/temperate/grass_04_mask.tga}}&lt;br /&gt;
* The ''Ramp Width'' should be set to a value lower than the default of 1, since this causes a very blurry blend, which is usually not what you want. Try a value of 0.25 and re-render the preview - try a &amp;quot;Window&amp;quot; preview as described earlier to get a full-resolution preview where you can really see the blend working.&lt;br /&gt;
* '''Important!''' You will also need to set the ''Distribution Pattern Texture Scale'' to the same value as the Diffuse Scale, in this case we just use 32 32 again.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Local'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
Again we want the normal-map which matches the diffuse texture for the grass.&lt;br /&gt;
* Make sure the Local section is highlighted in the top right.&lt;br /&gt;
* In the ''File Name'' field of the '''Image Properties''' section, browse to the matching normal map for your tiling grass texture.&lt;br /&gt;
** This example is using {{filename|textures/megagen/temperate/grass_04_local.tga}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Surface Type'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
Again, you need to specify a surface type, so that when players walk over or shoot the surface, it gives the correct sound and particle effects.&lt;br /&gt;
* Find the ''Surface Type Properties'' section of the property list.&lt;br /&gt;
* In the '''Type''' field, enter ''grass''. It should drop down a list of valid surface types as soon as you hit the first letter.&lt;br /&gt;
* Hit {{accelkey|enter}} to accept the surface type.&lt;br /&gt;
&lt;br /&gt;
Your grass textures should now produce correct &amp;quot;grass&amp;quot; effects when shot or collided with!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Preview again!'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
[[Image:simplemega_secondnode_preview.jpg|thumb|300px|The Render mode preview of the second node blended with the first node]]&lt;br /&gt;
Now that's all set up, you can hit the Render Preview ([[Image:simplemega_previewbutton.png|MegaTexture Render Preview button]]) button again and see what effect the new Grass node has.&lt;br /&gt;
If it's being distributed into the wrong places, you can go back into your Distribution settings and tweak the values for the ''geometryBased'' settings. Then you can preview again until it looks right.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Adding a third node ==&lt;br /&gt;
[[Image:simplemega_thirdnode_preview.jpg|thumb|300px|The Render mode preview of the third node blended with the other two nodes]]&lt;br /&gt;
Now that the grass and dirt are in place, we need some rocks to make the terrain look more natural.&lt;br /&gt;
* Add a new Image node below your &amp;quot;Grass&amp;quot; node.&lt;br /&gt;
* Name this new node &amp;quot;Rock&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Again, the main map types need to be specified before the node can be rendered:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Diffuse'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
* In the ''File Name'' field of the '''Diffuse''' section, browse to a generic tiling rock texture.&lt;br /&gt;
** This example is using {{filename|textures/megagen/temperate/rock_01_d.tga}}&lt;br /&gt;
* Set the ''Scale'' value to 32 32.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Distribution'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
Again we can use Geometric Texture Distribution to easily apply the rock textures only to the cliff-like angles.&lt;br /&gt;
* Make sure the Distribution section is highlighted in the top right.&lt;br /&gt;
* Change the &amp;quot;Source Type&amp;quot; from ''texture'' to ''geometryBased''.&lt;br /&gt;
* To make the rock texture only appear on near vertical surfaces, set the ''Slope Lower Value'' to 23, and the ''Fuzziness'' of Slope Lower to 0.05&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Distribution Pattern'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
Again this will control how the the rocks blend into the other nodes. Again, we want a texture to identify the &amp;quot;height&amp;quot; of the tiling rock texture.&lt;br /&gt;
&lt;br /&gt;
* Make sure the Distribution Pattern section is highlighted in the top right.&lt;br /&gt;
* In the ''File Name'' field of the '''Image Properties''' section, browse to the matching heightmap or mask for your tiling rock texture.&lt;br /&gt;
** This example is using {{filename|textures/megagen/temperate/rock_01_h.tga}}&lt;br /&gt;
* The ''Ramp Width'' should be set to a value much lower than the default of 1, since this causes a very blurry blend, which is not natural for rocks blending with dirt. Try a value of 0.1 here, then render a &amp;quot;Window&amp;quot; preview to see how the blending looks.&lt;br /&gt;
* Remember to set the ''Distribution Pattern Texture Scale'' to the same value as the Diffuse Scale, 32 32.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Local'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
Again we want the normal-map which matches the diffuse texture for the rocks.&lt;br /&gt;
* In the ''File Name'' field of the '''Local''' section, browse to the matching normal map for your tiling rock texture.&lt;br /&gt;
** This example is using {{filename|textures/megagen/temperate/rock_01_local.tga}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Surface Type'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
* Find the ''Surface Type Properties'' section of the property list.&lt;br /&gt;
* In the '''Type''' field, enter ''stone''.&lt;br /&gt;
* Hit {{accelkey|enter}} to accept the surface type.&lt;br /&gt;
&lt;br /&gt;
Your rock textures should now produce correct &amp;quot;stone&amp;quot; effects when shot or collided with.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Preview again!'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
Now that the rocks are set up, you can hit the Render Preview ([[Image:simplemega_previewbutton.png|MegaTexture Render Preview button]]) button again and see what effect the new Rock node has.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Further tweaks ==&lt;br /&gt;
There are other simple changes that can be done in the Terrain Editor to make your MegaTexture look even better.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Node order'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
[[Image:simplemega_node_order.png|frame|Click and drag a node to change the order]]&lt;br /&gt;
You may notice, if you look carefully at the blends between the rock and grass nodes, that some areas of the MegaTexture appear to show the rock texture ''on top'' of the grass! This doesn't look very natural, and it's happening because of the node order.&lt;br /&gt;
&lt;br /&gt;
Since the Rock node is below the Grass node, it will always be rendered on top of the grass. However, there is an easy way to fix this! In the node list of the Terrain Editor, you can click and drag any node to move it above or below existing nodes.&lt;br /&gt;
&lt;br /&gt;
* {{accelbtn|LMB}}-drag the Rock node and move it up in the list until you see a black bar appear between the Dirt and Grass nodes, as shown on the right.&lt;br /&gt;
* Release {{accelbtn|LMB}} when you have positioned the node in the correct place.&lt;br /&gt;
* With the Rock node now positioned between the Dirt and Grass nodes, the grass will appear on top of the rocks as well as the dirt, which looks much more natural!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Color changes'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
Maybe your dirt texture is too bright? Or maybe your grass looks a little ''too'' green?&lt;br /&gt;
You can easily fix this from the Terrain Editor itself! No need to create a new image every time you want to tweak the color or brightness, you can set this up on a per-node basis.&lt;br /&gt;
&lt;br /&gt;
Let's say you want to make the dirt texture darker and a bit more red. Here's how you'd do it:&lt;br /&gt;
* Select your Dirt node.&lt;br /&gt;
* Look under the ''Color Properties'' area in the property list, and {{accelbtn|LMB}} on the '''Color''' swatch (next to where it says 1 1 1, which is white).&lt;br /&gt;
* A color wheel and brightness slider will pop up in a new window. You can use this to darken and tint your texture.&lt;br /&gt;
* Choose a darker brightness, and a color slightly towards red. I used '''RGB Values''' of 225, 220, 220.&lt;br /&gt;
* Hit ''OK'' to accept the color.&lt;br /&gt;
* Re-render your MegaTexture preview. You should notice that the dirt layer looks darker now!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Texture rotation'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
If you're building up a lot of layers of tiling textures, it can sometimes become obvious when a texture tiles in a particular direction. You may see repeating patterns extending into the distance when looking in particular directions, especially if all your nodes have the same orientation.&lt;br /&gt;
&lt;br /&gt;
An easy way to overcome this is to play with the ''Rotation'' value in the Texture Properties section of the Terrain Editor's property list.&lt;br /&gt;
For each node, you should also set the ''Distribution Pattern Texture Rotation'' to match the Rotation value if you want your distribution patterns to line up and work correctly.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Render the MegaTexture =&lt;br /&gt;
=== Save the Surface Tree ===&lt;br /&gt;
Once you're happy with how the preview looks in the editor, you should make sure that your final Surface Tree is saved. Either click the &amp;quot;Save and Unload&amp;quot; button in the Terrain Editor, or save the whole map.&lt;br /&gt;
&lt;br /&gt;
=== Compile Only Entities ===&lt;br /&gt;
At this stage, your MegaTexture material is still technically &amp;quot;broken&amp;quot;, since no ''.mega'' file exists yet. This means that if you try to compile the map, it'll take ages to process the terrain model, since it treats it as a regular model rather than the special case of terrain. Not only will this waste 5-10 minutes of your time, but it'll also produce a broken map.&lt;br /&gt;
&lt;br /&gt;
However, we need to compile the map in order to tell the [[renderLight]] process which atmosphere to use when lighting the MegaTexture!&lt;br /&gt;
&lt;br /&gt;
So the solution is to do an '''Only Entities''' compile. You can find this in the menu ''Compile -&amp;gt; 2 - Only Entities'' in editWorld. This should be done in a few seconds, and compiles all the information that renderLight needs.&lt;br /&gt;
&lt;br /&gt;
Bear in mind that this compile process will not produce a playable map, so you will have to do a full recompile once the MegaTexture is fully rendered.&lt;br /&gt;
&lt;br /&gt;
=== Run the SDK Launcher ===&lt;br /&gt;
Now that your ''.sft'' is saved, go through all the steps outlined in the [[Generate a MegaTexture]] tutorial.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= That's it! =&lt;br /&gt;
[[Image:simplemega_ingame.jpg|thumb|300px|The MegaTexture in-game!]]&lt;br /&gt;
You've now created your very own MegaTexture to use in your map!&lt;br /&gt;
&lt;br /&gt;
Before you even compile the map, you can get an accurate preview of how it will look in-game by pressing {{accelkey|F6}} to toggle &amp;quot;anim&amp;quot; mode while in editWorld's &amp;quot;RENDER&amp;quot; Camera view (toggled with {{accelkey|F3}}).&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
= Troubleshooting =&lt;br /&gt;
If your terrain model still shows as red even after you've compiled the MegaTexture, there are a couple of things you should check first:&lt;br /&gt;
* See if the console gives you any warnings about missing ''.stm'' files. If this is the case, you probably forgot to assign any Surface Types to your texture nodes. Double-check them and make sure it's all set up correctly.&lt;br /&gt;
* Make sure there aren't any spelling mistakes or typos in your ''.mtr'' material file. The 2nd part of the material should have exactly the same name as your map (the ''&amp;lt; &amp;quot;mapname&amp;quot; &amp;gt;'' part described in [[A Simple First Megatexture#Creating a MegaTexture material|this section]]), otherwise it will not be searching for the correct images.&lt;br /&gt;
* Make sure there aren't any spelling mistakes in your ''.rlt'' file (as described in [[RenderLight|this article]]). If any of the names are inconsistent, the Megatexture will not have been compiled fully.&lt;br /&gt;
&lt;br /&gt;
If your map compile is taking ages (ie. over 2-3 minutes for a 32,000 triangle terrain model) then it's probably because the MegaTexture material is broken. Double-check the issues listed above, and make sure you have run the {{consolecmd|reloaddecls}} console command if you changed any ''.mtr'' or ''.rlt'' files.&lt;br /&gt;
&lt;br /&gt;
If your ''.mega'' and ''.stm'' files definitely exist, in the right folders, try closing and re-opening the ''.world'' file in editWorld. This should load and display the MegaTexture properly.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= See Also =&lt;br /&gt;
* [[An Advanced Terrain and Megatexture]] - an advanced guide for complete MegaTexture creation&lt;br /&gt;
* [[Generate a MegaTexture]] - steps for generating a MegaTexture from the SDK launcher.&lt;br /&gt;
&lt;br /&gt;
[[Category:Art]]&lt;br /&gt;
[[Category:Basic Level Design]]&lt;br /&gt;
[[Category:Tutorials]]&lt;/div&gt;</summary>
		<author><name>MoP</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.splashdamage.com/index.php?title=A_Simple_First_Megatexture&amp;diff=4018</id>
		<title>A Simple First Megatexture</title>
		<link rel="alternate" type="text/html" href="https://wiki.splashdamage.com/index.php?title=A_Simple_First_Megatexture&amp;diff=4018"/>
		<updated>2007-12-13T17:09:18Z</updated>

		<summary type="html">&lt;p&gt;MoP: Fuzziness is between 0.0 - 1.0&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Image:simplemega_ingame.jpg|right|thumb|500px|A simple MegaTexture, easily created with only 3 texture layers!]]&lt;br /&gt;
So now that you've made [[A Simple First Terrain]], no doubt you'll want to apply a MegaTexture to it! This MegaTexture won't be as detailed or as attractive as an advanced MegaTexture, but will demonstrate the basics of creating a [[Surface Tree]], assigning textures, and compiling it all into a working MegaTexture file.&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
'''For this tutorial you must:'''&lt;br /&gt;
* Have a terrain model UV-mapped in the 0-1 range (covered in the simple first terrain tutorial)&lt;br /&gt;
* Have access to some tiling textures.&lt;br /&gt;
* Have a little understanding the ETQW material system&lt;br /&gt;
&lt;br /&gt;
If you don't have any of the above things, you are not ready to do this tutorial!&lt;br /&gt;
&lt;br /&gt;
'''This tutorial covers:'''&lt;br /&gt;
* How to set up a MegaTexture material&lt;br /&gt;
* How to create a Surface Tree&lt;br /&gt;
* How to add texture nodes in the Terrain Editor&lt;br /&gt;
* How to render and compile a full MegaTexture&lt;br /&gt;
&lt;br /&gt;
'''This tutorial does not cover:'''&lt;br /&gt;
* How to use Blender/Maya/Lightwave/ZBrush/Mudbox/3DSMax/Photoshop&lt;br /&gt;
* How to create tiling textures or heightmaps&lt;br /&gt;
* Anything overly complicated&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Creating a MegaTexture material =&lt;br /&gt;
Firstly you need to create a new material for your terrain to use. If you have never made a new material before, read the article on [[Adding Custom Textures]]. All you need to do is create (or use an existing) ''.mtr'' file and place a material declaration in it, in the manner shown here:&lt;br /&gt;
 material megatextures/mapname		{ useTemplate megatextures/default_ambient&amp;lt; &amp;quot;mapname&amp;quot; &amp;gt; }&lt;br /&gt;
&lt;br /&gt;
This material would automatically search for a MegaTexture called {{filename|mapname.mega}} in the {{filename|/megatextures/}} folder. This example material uses the ''&amp;quot;default_ambient&amp;quot;'' template, which expects a 3-channel RGB MegaTexture. These are generated by the default settings of the [[Generate a MegaTexture|MegaTexture tab in the SDK Launcher]].&lt;br /&gt;
&lt;br /&gt;
Obviously you would want to use the actual name of your map instead of &amp;quot;mapname&amp;quot;, for consistency's sake and ease of reference.&lt;br /&gt;
&lt;br /&gt;
Remember that if you made a new ''.mtr'' file after the game or editor was started, you'll have to restart the whole game and editor before it will read your new file.&lt;br /&gt;
&lt;br /&gt;
=== Assigning the material ===&lt;br /&gt;
You should assign the material you just created by naming a material in your 3D application and applying it to your terrain mesh, then export the model to your preferred format (LWO, ASE or OBJ).&lt;br /&gt;
Tips on this process can be found in the [[A Simple First Terrain|simple first terrain tutorial]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Creating the Surface Tree =&lt;br /&gt;
As described in the Simple First Terrain tutorial, terrain models are set up in the Terrain Editor, accessible via {{accelkey|shift}}{{accelkey|N}} in [[editWorld]]. This tool creates a Surface Tree file ({{filename|.sft}}) that contains all the information about the terrain, including roads, stamps, and detail texture information that MegaGen needs to generate a MegaTexture. The Surface Tree will be saved every time the map is saved, or any time you press the &amp;quot;Save and Unload&amp;quot; button in the Terrain Editor.&lt;br /&gt;
[[Image:simplemega_terrainmodel.png|thumb|300px|Root node set up to use the correct terrain mesh]]&lt;br /&gt;
&lt;br /&gt;
=== Add the terrain mesh ===&lt;br /&gt;
Here's how you bring the terrain mesh into the surface tree:&lt;br /&gt;
* {{accelbtn|RMB}} on the left-hand pane, and choose ''New -&amp;gt; Tree'' via the menu.&lt;br /&gt;
** If you already have a Root node, click the &amp;quot;Begin Editing&amp;quot; button instead.&lt;br /&gt;
* Click on the Root node, and set {{keyname|Model}} to the name of the terrain mesh, in this case {{keyvalue|models/terrain/simpleterrain.obj}}.&lt;br /&gt;
* Press {{accelkey|enter}} to confirm the selection, and the terrain should appear in the 3D view.&lt;br /&gt;
&lt;br /&gt;
Be aware that your terrain model will probably appear bright orange or red.&lt;br /&gt;
The console will probably give you a few WARNING messages, don't worry about these for now, this is because your Megatexture doesn't exist yet!&lt;br /&gt;
&lt;br /&gt;
=== Important note about nodes ===&lt;br /&gt;
When you are editing properties of nodes (names, numbers, texture sources etc.) always remember to hit {{accelkey|enter}} after changing a value, to make sure that the value is stored. If you just type something in and then click somewhere else without pressing {{accelkey|enter}}, your changes may not be applied.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Create the first texture node ==&lt;br /&gt;
[[Image:simplemega_firstnode_diffuse.png|thumb|300px|The first texture node's diffuse texture properties]]&lt;br /&gt;
Now that the model is in place, you can start laying down the texture layers (or &amp;quot;nodes&amp;quot;) that will make up your MegaTexture.&lt;br /&gt;
&lt;br /&gt;
First you need to create a new Image Source node in the Terrain Editor.&lt;br /&gt;
* {{accelbtn|RMB}} on your &amp;quot;Root&amp;quot; node and choose ''New -&amp;gt; Image Source'' (or press {{accelkey|shift}}{{accelkey|i}})&lt;br /&gt;
* This will make a new node called &amp;quot;New Image Renderer&amp;quot;.&lt;br /&gt;
* You can rename this new node using the &amp;quot;Name&amp;quot; property field in the '''Object''' section.&lt;br /&gt;
* Rename the node &amp;quot;Dirt&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You will notice in the top right of the Terrain Editor, a section listing things like &amp;quot;Diffuse&amp;quot;, &amp;quot;Distribution&amp;quot;, &amp;quot;Distribution Pattern&amp;quot; etc. Selecting one of these will list all of the properties for that section of the current node.&lt;br /&gt;
The ones we need to worry about are as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Diffuse'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
This is the colour map of the current node, and it should point to a tiling TGA texture.&lt;br /&gt;
* Make sure the Diffuse section is highlighted in the top right of the Terrain Editor.&lt;br /&gt;
* In the ''File Name'' field of the '''Image Properties''' section, browse to a generic tiling dirt texture. Remember to hit {{accelkey|enter}} afterwards!&lt;br /&gt;
** This example is using {{filename|textures/megagen/temperate/dirt_02_d.tga}}&lt;br /&gt;
* The ''Scale'' field at the very bottom of the property list allows you to choose how much to tile the texture.&lt;br /&gt;
** The default value is 1 1, but you don't want that since it will stretch your texture over the whole mesh, and look really blurry!&lt;br /&gt;
** Instead set the Scale to something like 48 48, this means that the texture will be repeated 48 times across each axis of the terrain. This results in a sharper final output.&lt;br /&gt;
That's all you need to do for the Diffuse settings in this node.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Distribution'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
This is how we control where the layer is drawn (ie. no grass underwater, no sand on angles over 60 degrees etc). It's basically a big mask where ''white = fully shown'' and ''black = fully hidden''.&lt;br /&gt;
* Make sure the Distribution section is highlighted in the top right.&lt;br /&gt;
* Since this is our first node, we want to show over the whole terrain. This means the distribution map should be 100% white.&lt;br /&gt;
* You can either assign a pure white TGA texture, or change the ''Source Type'' to ''geometryBased''.&lt;br /&gt;
** ''geometryBased'' will by default create a fully white map, so if you don't have a white TGA handy, this is faster.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Distribution Pattern'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
This controls how the current node blends into others. Usually this will be set to a tiling TGA heightmap texture that matches the Diffuse texture.&lt;br /&gt;
* We don't need a Distribution Pattern for the first node, since it doesn't blend with anything. Nodes on top of this one will need Distribution Patterns for more interesting and natural blends though!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Local'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
This is the normal-map of the current node. This should be a tiling TGA texture representing the local normal information of the matching Diffuse texture.&lt;br /&gt;
* Make sure the Local section is highlighted in the top right.&lt;br /&gt;
* In the ''File Name'' field of the '''Image Properties''' section, browse to the matching normal map for your tiling dirt texture.&lt;br /&gt;
** This example is using {{filename|textures/megagen/temperate/dirt_02_local.tga}}&lt;br /&gt;
* The Local texture's tiling amount is automatically the same as the Diffuse texture.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Surface Type'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
Your image nodes should all specify a surface type, so that when players walk over or shoot the surface, it gives the correct sound and particle effects.&lt;br /&gt;
* Find the ''Surface Type Properties'' section of the property list.&lt;br /&gt;
* In the '''Type''' field, enter ''dirt''. It should drop down a list of valid surface types as soon as you hit the first letter.&lt;br /&gt;
* Hit {{accelkey|enter}} to accept the surface type.&lt;br /&gt;
&lt;br /&gt;
Your dirt textures will now produce correct &amp;quot;dirt&amp;quot; effects when shot or collided with!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Previewing the result'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
[[Image:simplemega_firstnode_preview.jpg|thumb|300px|The Render mode preview of the first node]]&lt;br /&gt;
Now we can easily check if this is all set up correctly. You should notice a little icon at the top left of your Terrain Editor which looks like this: [[Image:simplemega_previewbutton.png|MegaTexture Render Preview button]]&lt;br /&gt;
&lt;br /&gt;
* Notice the drop-down arrow on the right of the button. Click it, and select ''&amp;quot;Full&amp;quot;'' instead of ''&amp;quot;None&amp;quot;''.&lt;br /&gt;
* Your terrain should change colour to black. This means it's ready for a preview to be rendered onto it.&lt;br /&gt;
* Click the button itself now, instead of the drop-down. An &amp;quot;Active Tasks&amp;quot; window should pop up, and when it's done, you should see your dirt texture appear on your terrain model.&lt;br /&gt;
* You can switch the camera to Render mode too, which will show your terrain model's shading better.&lt;br /&gt;
* If you want a full-resolution preview of a small area, choose ''&amp;quot;Window&amp;quot;'' instead of ''&amp;quot;Full&amp;quot;'' from the drop-down menu.&lt;br /&gt;
** This creates a small window that you can move around using {{accelbtn|LMB}}-drag in the XY Top view. Simply position the window where you want to preview the full-resolution MegaTexture, and hit the Render Preview button.&lt;br /&gt;
&lt;br /&gt;
Now any time you add new nodes, or change a node's properties, you can just click the Render Preview button and the view will update with your changes.&lt;br /&gt;
&lt;br /&gt;
'''Important note:''' Running a 3D application such as Blender, Maya, 3dsmax etc. in the background, may prevent a MegaTexture preview being rendered correctly. If your node is set up correctly but the preview render is appearing as black or patchy, make sure you have closed any 3D applications and try re-rendering the preview.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Adding a second node ==&lt;br /&gt;
Now that the first layer of dirt is in place, we can try putting some grass on top of it!&lt;br /&gt;
* Again, {{accelbtn|RMB}} on your &amp;quot;Root&amp;quot; node and choose ''New -&amp;gt; Image Source'' (or press {{accelkey|shift}}{{accelkey|i}})&lt;br /&gt;
* This will make another new node below your &amp;quot;Dirt&amp;quot; node. &lt;br /&gt;
* Name this new node &amp;quot;Grass&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Surface Tree hierarchy is rendered from the top down, so nodes ''above'' other nodes in the hierarchy will be rendered ''before'' the other nodes. So currently it'll be rendering our Dirt node, and then rendering the Grass node on top of the dirt.&lt;br /&gt;
&lt;br /&gt;
Again, the main map types need to be specified before the node can be rendered:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Diffuse'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
* Make sure the Diffuse section is highlighted in the top right of the Terrain Editor.&lt;br /&gt;
* In the ''File Name'' field of the '''Image Properties''' section, browse to a generic tiling grass texture.&lt;br /&gt;
** This example is using {{filename|textures/megagen/temperate/grass_04_d.tga}}&lt;br /&gt;
* Again you will want to set the ''Scale'' value to something other than 1 1, to tile your texture. Let's use 32 32 for this one.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Distribution'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
This is important now, since we need to control where this layer is visible. Pure white won't work, since that'll just completely cover our underlying Dirt node!&lt;br /&gt;
* Make sure the Distribution section is highlighted in the top right.&lt;br /&gt;
* Change the &amp;quot;Source Type&amp;quot; from ''texture'' to ''geometryBased''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Geometric Texture Distribution'''&lt;br /&gt;
----&lt;br /&gt;
[[Image:simplemega_geometric_distribution.png|thumb|300px|The geometric texture distribution settings of the second node]]&lt;br /&gt;
This is where it gets interesting! There are many settings to alter, and they can have a drastic effect on how different your terrain looks, so try playing around with different values if you're not happy with the initial results.&lt;br /&gt;
&lt;br /&gt;
* '''Altitude Lower''' - Enabling this will limit the lower parts of the terrain from receiving this node's textures.&lt;br /&gt;
** '''Altitude Lower Value''' - The Z height in world units that the node will be drawn above. The default of 0 means that any parts of your terrain mesh below Z=0 will not show any of this node's textures.&lt;br /&gt;
** '''Fuzziness''' - The amount of blur applied to the mask, ranges between 0.0 and 1.0. The higher the value, the more blurry the boundary.&lt;br /&gt;
* '''Altitude Upper''' - Enabling this will limit the higher parts of the terrain from receiving this node's textures.&lt;br /&gt;
** '''Altitude Upper Value''' - The Z height in world units that the node will be drawn below. The default of 0 means that any parts of your terrain mesh above Z=0 will not show any of this node's textures.&lt;br /&gt;
** '''Fuzziness''' - The amount of blur applied to the mask, ranges between 0.0 and 1.0. The higher the value, the more blurry the boundary.&lt;br /&gt;
&lt;br /&gt;
* '''Clamp Distribution To Edge''' - Leave this on Default.&lt;br /&gt;
&lt;br /&gt;
* '''Resolution''' - The size in pixels of the resulting mask. The default value of 256 is fine for nearly any terrain model.&lt;br /&gt;
&lt;br /&gt;
* '''Slope Lower''' - Enabling this will limit shallower angles of the terrain model from receiving this node's textures.&lt;br /&gt;
** '''Slope Lower Value''' - The angle in degrees that the node will be drawn past. The default angle of 0 will result in no change to your mask.&lt;br /&gt;
** '''Fuzziness''' - The amount of blur applied to the mask, ranges between 0.0 and 1.0. The higher the value, the more blurry the boundary.&lt;br /&gt;
* '''Slope Upper''' - Enabling this will limit the steeper angles of the terrain model from receiving this node's textures. This is great for masking out cliffs from your nodes.&lt;br /&gt;
** '''Slope Upper Value''' - The angle in degrees that the node will be hidden past. The default angle of 0 will result in a fully black mask.&lt;br /&gt;
** '''Fuzziness''' - The amount of blur applied to the mask, ranges between 0.0 and 1.0. The higher the value, the more blurry the boundary.&lt;br /&gt;
&lt;br /&gt;
The settings you use for each of these will vary depending on your terrain model, and the type of node you're making. For our Grass node, you can see the settings used for this example in the screenshot above on the right.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Distribution Pattern'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
[[Image:simplemega_dist_ramps.jpg|thumb|300px|The difference between using or not using a Distribution Pattern, and varying Ramp Widths]]&lt;br /&gt;
This controls how the the grass will blend into the dirt. If you don't have a Distribution Pattern texture, the grass will just slowly fade into the dirt, which doesn't look very natural!&lt;br /&gt;
So what we want here is a texture to identify the &amp;quot;height&amp;quot; of the areas of grass. This means that the dirt can blend in based on the height of each clump of grass, so instead of a smooth fade you will get a more natural blend between the grass and the dirt.&lt;br /&gt;
&lt;br /&gt;
If you examine the screenshot to the right, you can see what effect a good Distribution Pattern can have - when the node is rendered with no Distribution Pattern, the blend between the nodes is a simple smooth gradient, which does not look very natural at all. You can also see the difference that the '''Ramp Width''' value makes - this is a very powerful value, so experiment with it until you really understand the effect it has!&lt;br /&gt;
&lt;br /&gt;
* Make sure the Distribution Pattern section is highlighted in the top right.&lt;br /&gt;
* In the ''File Name'' field of the '''Image Properties''' section, browse to the matching heightmap or mask for your tiling grass texture.&lt;br /&gt;
** This example is using {{filename|textures/megagen/temperate/grass_04_mask.tga}}&lt;br /&gt;
* The ''Ramp Width'' should be set to a value lower than the default of 1, since this causes a very blurry blend, which is usually not what you want. Try a value of 0.25 and re-render the preview - try a &amp;quot;Window&amp;quot; preview as described earlier to get a full-resolution preview where you can really see the blend working.&lt;br /&gt;
* '''Important!''' You will also need to set the ''Distribution Pattern Texture Scale'' to the same value as the Diffuse Scale, in this case we just use 32 32 again.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Local'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
Again we want the normal-map which matches the diffuse texture for the grass.&lt;br /&gt;
* Make sure the Local section is highlighted in the top right.&lt;br /&gt;
* In the ''File Name'' field of the '''Image Properties''' section, browse to the matching normal map for your tiling grass texture.&lt;br /&gt;
** This example is using {{filename|textures/megagen/temperate/grass_04_local.tga}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Surface Type'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
Again, you need to specify a surface type, so that when players walk over or shoot the surface, it gives the correct sound and particle effects.&lt;br /&gt;
* Find the ''Surface Type Properties'' section of the property list.&lt;br /&gt;
* In the '''Type''' field, enter ''grass''. It should drop down a list of valid surface types as soon as you hit the first letter.&lt;br /&gt;
* Hit {{accelkey|enter}} to accept the surface type.&lt;br /&gt;
&lt;br /&gt;
Your grass textures should now produce correct &amp;quot;grass&amp;quot; effects when shot or collided with!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Preview again!'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
[[Image:simplemega_secondnode_preview.jpg|thumb|300px|The Render mode preview of the second node blended with the first node]]&lt;br /&gt;
Now that's all set up, you can hit the Render Preview ([[Image:simplemega_previewbutton.png|MegaTexture Render Preview button]]) button again and see what effect the new Grass node has.&lt;br /&gt;
If it's being distributed into the wrong places, you can go back into your Distribution settings and tweak the values for the ''geometryBased'' settings. Then you can preview again until it looks right.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Adding a third node ==&lt;br /&gt;
[[Image:simplemega_thirdnode_preview.jpg|thumb|300px|The Render mode preview of the third node blended with the other two nodes]]&lt;br /&gt;
Now that the grass and dirt are in place, we need some rocks to make the terrain look more natural.&lt;br /&gt;
* Again, {{accelbtn|RMB}} on your &amp;quot;Root&amp;quot; node and choose ''New -&amp;gt; Image Source'' (or press {{accelkey|shift}}{{accelkey|i}})&lt;br /&gt;
* This will make another new node below your &amp;quot;Grass&amp;quot; node. &lt;br /&gt;
* Name this new node &amp;quot;Rock&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Again, the main map types need to be specified before the node can be rendered:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Diffuse'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
* In the ''File Name'' field of the '''Diffuse''' section, browse to a generic tiling rock texture.&lt;br /&gt;
** This example is using {{filename|textures/megagen/temperate/rock_01_d.tga}}&lt;br /&gt;
* Set the ''Scale'' value to 32 32.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Distribution'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
Again we can use Geometric Texture Distribution to easily apply the rock textures only to the cliff-like angles.&lt;br /&gt;
* Make sure the Distribution section is highlighted in the top right.&lt;br /&gt;
* Change the &amp;quot;Source Type&amp;quot; from ''texture'' to ''geometryBased''.&lt;br /&gt;
* To make the rock texture only appear on near vertical surfaces, set the ''Slope Lower Value'' to 23, and the ''Fuzziness'' of Slope Lower to 0.05&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Distribution Pattern'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
Again this will control how the the rocks blend into the other nodes. Again, we want a texture to identify the &amp;quot;height&amp;quot; of the tiling rock texture.&lt;br /&gt;
&lt;br /&gt;
* Make sure the Distribution Pattern section is highlighted in the top right.&lt;br /&gt;
* In the ''File Name'' field of the '''Image Properties''' section, browse to the matching heightmap or mask for your tiling rock texture.&lt;br /&gt;
** This example is using {{filename|textures/megagen/temperate/rock_01_h.tga}}&lt;br /&gt;
* The ''Ramp Width'' should be set to a value much lower than the default of 1, since this causes a very blurry blend, which is not natural for rocks blending with dirt. Try a value of 0.1 here, then render a &amp;quot;Window&amp;quot; preview to see how the blending looks.&lt;br /&gt;
* Remember to set the ''Distribution Pattern Texture Scale'' to the same value as the Diffuse Scale, 32 32.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Local'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
Again we want the normal-map which matches the diffuse texture for the rocks.&lt;br /&gt;
* In the ''File Name'' field of the '''Local''' section, browse to the matching normal map for your tiling rock texture.&lt;br /&gt;
** This example is using {{filename|textures/megagen/temperate/rock_01_local.tga}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Surface Type'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
* Find the ''Surface Type Properties'' section of the property list.&lt;br /&gt;
* In the '''Type''' field, enter ''stone''.&lt;br /&gt;
* Hit {{accelkey|enter}} to accept the surface type.&lt;br /&gt;
&lt;br /&gt;
Your rock textures should now produce correct &amp;quot;stone&amp;quot; effects when shot or collided with.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Preview again!'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
Now that the rocks are set up, you can hit the Render Preview ([[Image:simplemega_previewbutton.png|MegaTexture Render Preview button]]) button again and see what effect the new Rock node has.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Further tweaks ==&lt;br /&gt;
There are other simple changes that can be done in the Terrain Editor to make your MegaTexture look even better.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Node order'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
[[Image:simplemega_node_order.png|frame|Click and drag a node to change the order]]&lt;br /&gt;
You may notice, if you look carefully at the blends between the rock and grass nodes, that some areas of the MegaTexture appear to show the rock texture ''on top'' of the grass! This doesn't look very natural, and it's happening because of the node order.&lt;br /&gt;
&lt;br /&gt;
Since the Rock node is below the Grass node, it will always be rendered on top of the grass. However, there is an easy way to fix this! In the node list of the Terrain Editor, you can click and drag any node to move it above or below existing nodes.&lt;br /&gt;
&lt;br /&gt;
* {{accelbtn|LMB}}-drag the Rock node and move it up in the list until you see a black bar appear between the Dirt and Grass nodes, as shown on the right.&lt;br /&gt;
* Release {{accelbtn|LMB}} when you have positioned the node in the correct place.&lt;br /&gt;
* With the Rock node now positioned between the Dirt and Grass nodes, the grass will appear on top of the rocks as well as the dirt, which looks much more natural!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Color changes'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
Maybe your dirt texture is too bright? Or maybe your grass looks a little ''too'' green?&lt;br /&gt;
You can easily fix this from the Terrain Editor itself! No need to create a new image every time you want to tweak the color or brightness, you can set this up on a per-node basis.&lt;br /&gt;
&lt;br /&gt;
Let's say you want to make the dirt texture darker and a bit more red. Here's how you'd do it:&lt;br /&gt;
* Select your Dirt node.&lt;br /&gt;
* Look under the ''Color Properties'' area in the property list, and {{accelbtn|LMB}} on the '''Color''' swatch (next to where it says 1 1 1, which is white).&lt;br /&gt;
* A color wheel and brightness slider will pop up in a new window. You can use this to darken and tint your texture.&lt;br /&gt;
* Choose a darker brightness, and a color slightly towards red. I used '''RGB Values''' of 225, 220, 220.&lt;br /&gt;
* Hit ''OK'' to accept the color.&lt;br /&gt;
* Re-render your MegaTexture preview. You should notice that the dirt layer looks darker now!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Texture rotation'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
If you're building up a lot of layers of tiling textures, it can sometimes become obvious when a texture tiles in a particular direction. You may see repeating patterns extending into the distance when looking in particular directions, especially if all your nodes have the same orientation.&lt;br /&gt;
&lt;br /&gt;
An easy way to overcome this is to play with the ''Rotation'' value in the Texture Properties section of the Terrain Editor's property list.&lt;br /&gt;
For each node, you should also set the ''Distribution Pattern Texture Rotation'' to match the Rotation value if you want your distribution patterns to line up and work correctly.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Render the MegaTexture =&lt;br /&gt;
=== Save the Surface Tree ===&lt;br /&gt;
Once you're happy with how the preview looks in the editor, you should make sure that your final Surface Tree is saved. Either click the &amp;quot;Save and Unload&amp;quot; button in the Terrain Editor, or save the whole map.&lt;br /&gt;
&lt;br /&gt;
=== Compile Only Entities ===&lt;br /&gt;
At this stage, your MegaTexture material is still technically &amp;quot;broken&amp;quot;, since no ''.mega'' file exists yet. This means that if you try to compile the map, it'll take ages to process the terrain model, since it treats it as a regular model rather than the special case of terrain. Not only will this waste 5-10 minutes of your time, but it'll also produce a broken map.&lt;br /&gt;
&lt;br /&gt;
However, we need to compile the map in order to tell the [[renderLight]] process which atmosphere to use when lighting the MegaTexture!&lt;br /&gt;
&lt;br /&gt;
So the solution is to do an '''Only Entities''' compile. You can find this in the menu ''Compile -&amp;gt; 2 - Only Entities'' in editWorld. This should be done in a few seconds, and compiles all the information that renderLight needs.&lt;br /&gt;
&lt;br /&gt;
Bear in mind that this compile process will not produce a playable map, so you will have to do a full recompile once the MegaTexture is fully rendered.&lt;br /&gt;
&lt;br /&gt;
=== Run the SDK Launcher ===&lt;br /&gt;
Now that your ''.sft'' is saved, go through all the steps outlined in the [[Generate a MegaTexture]] tutorial.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= That's it! =&lt;br /&gt;
[[Image:simplemega_ingame.jpg|thumb|300px|The MegaTexture in-game!]]&lt;br /&gt;
You've now created your very own MegaTexture to use in your map!&lt;br /&gt;
&lt;br /&gt;
Before you even compile the map, you can get an accurate preview of how it will look in-game by pressing {{accelkey|F6}} to toggle &amp;quot;anim&amp;quot; mode while in editWorld's &amp;quot;RENDER&amp;quot; Camera view (toggled with {{accelkey|F3}}).&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
= Troubleshooting =&lt;br /&gt;
If your terrain model still shows as red even after you've compiled the MegaTexture, there are a couple of things you should check first:&lt;br /&gt;
* See if the console gives you any warnings about missing ''.stm'' files. If this is the case, you probably forgot to assign any Surface Types to your texture nodes. Double-check them and make sure it's all set up correctly.&lt;br /&gt;
* Make sure there aren't any spelling mistakes or typos in your ''.mtr'' material file. The 2nd part of the material should have exactly the same name as your map (the ''&amp;lt; &amp;quot;mapname&amp;quot; &amp;gt;'' part described in [[A Simple First Megatexture#Creating a MegaTexture material|this section]]), otherwise it will not be searching for the correct images.&lt;br /&gt;
* Make sure there aren't any spelling mistakes in your ''.rlt'' file (as described in [[RenderLight|this article]]). If any of the names are inconsistent, the Megatexture will not have been compiled fully.&lt;br /&gt;
&lt;br /&gt;
If your map compile is taking ages (ie. over 2-3 minutes for a 32,000 triangle terrain model) then it's probably because the MegaTexture material is broken. Double-check the issues listed above, and make sure you have run the {{consolecmd|reloaddecls}} console command if you changed any ''.mtr'' or ''.rlt'' files.&lt;br /&gt;
&lt;br /&gt;
If your ''.mega'' and ''.stm'' files definitely exist, in the right folders, try closing and re-opening the ''.world'' file in editWorld. This should load and display the MegaTexture properly.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= See Also =&lt;br /&gt;
* [[An Advanced Terrain and Megatexture]] - an advanced guide for complete MegaTexture creation&lt;br /&gt;
* [[Generate a MegaTexture]] - steps for generating a MegaTexture from the SDK launcher.&lt;br /&gt;
&lt;br /&gt;
[[Category:Art]]&lt;br /&gt;
[[Category:Basic Level Design]]&lt;br /&gt;
[[Category:Tutorials]]&lt;/div&gt;</summary>
		<author><name>MoP</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.splashdamage.com/index.php?title=A_Simple_First_Megatexture&amp;diff=4017</id>
		<title>A Simple First Megatexture</title>
		<link rel="alternate" type="text/html" href="https://wiki.splashdamage.com/index.php?title=A_Simple_First_Megatexture&amp;diff=4017"/>
		<updated>2007-12-13T17:05:50Z</updated>

		<summary type="html">&lt;p&gt;MoP: Name the first node &amp;quot;Dirt&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Image:simplemega_ingame.jpg|right|thumb|500px|A simple MegaTexture, easily created with only 3 texture layers!]]&lt;br /&gt;
So now that you've made [[A Simple First Terrain]], no doubt you'll want to apply a MegaTexture to it! This MegaTexture won't be as detailed or as attractive as an advanced MegaTexture, but will demonstrate the basics of creating a [[Surface Tree]], assigning textures, and compiling it all into a working MegaTexture file.&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
'''For this tutorial you must:'''&lt;br /&gt;
* Have a terrain model UV-mapped in the 0-1 range (covered in the simple first terrain tutorial)&lt;br /&gt;
* Have access to some tiling textures.&lt;br /&gt;
* Have a little understanding the ETQW material system&lt;br /&gt;
&lt;br /&gt;
If you don't have any of the above things, you are not ready to do this tutorial!&lt;br /&gt;
&lt;br /&gt;
'''This tutorial covers:'''&lt;br /&gt;
* How to set up a MegaTexture material&lt;br /&gt;
* How to create a Surface Tree&lt;br /&gt;
* How to add texture nodes in the Terrain Editor&lt;br /&gt;
* How to render and compile a full MegaTexture&lt;br /&gt;
&lt;br /&gt;
'''This tutorial does not cover:'''&lt;br /&gt;
* How to use Blender/Maya/Lightwave/ZBrush/Mudbox/3DSMax/Photoshop&lt;br /&gt;
* How to create tiling textures or heightmaps&lt;br /&gt;
* Anything overly complicated&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Creating a MegaTexture material =&lt;br /&gt;
Firstly you need to create a new material for your terrain to use. If you have never made a new material before, read the article on [[Adding Custom Textures]]. All you need to do is create (or use an existing) ''.mtr'' file and place a material declaration in it, in the manner shown here:&lt;br /&gt;
 material megatextures/mapname		{ useTemplate megatextures/default_ambient&amp;lt; &amp;quot;mapname&amp;quot; &amp;gt; }&lt;br /&gt;
&lt;br /&gt;
This material would automatically search for a MegaTexture called {{filename|mapname.mega}} in the {{filename|/megatextures/}} folder. This example material uses the ''&amp;quot;default_ambient&amp;quot;'' template, which expects a 3-channel RGB MegaTexture. These are generated by the default settings of the [[Generate a MegaTexture|MegaTexture tab in the SDK Launcher]].&lt;br /&gt;
&lt;br /&gt;
Obviously you would want to use the actual name of your map instead of &amp;quot;mapname&amp;quot;, for consistency's sake and ease of reference.&lt;br /&gt;
&lt;br /&gt;
Remember that if you made a new ''.mtr'' file after the game or editor was started, you'll have to restart the whole game and editor before it will read your new file.&lt;br /&gt;
&lt;br /&gt;
=== Assigning the material ===&lt;br /&gt;
You should assign the material you just created by naming a material in your 3D application and applying it to your terrain mesh, then export the model to your preferred format (LWO, ASE or OBJ).&lt;br /&gt;
Tips on this process can be found in the [[A Simple First Terrain|simple first terrain tutorial]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Creating the Surface Tree =&lt;br /&gt;
As described in the Simple First Terrain tutorial, terrain models are set up in the Terrain Editor, accessible via {{accelkey|shift}}{{accelkey|N}} in [[editWorld]]. This tool creates a Surface Tree file ({{filename|.sft}}) that contains all the information about the terrain, including roads, stamps, and detail texture information that MegaGen needs to generate a MegaTexture. The Surface Tree will be saved every time the map is saved, or any time you press the &amp;quot;Save and Unload&amp;quot; button in the Terrain Editor.&lt;br /&gt;
[[Image:simplemega_terrainmodel.png|thumb|300px|Root node set up to use the correct terrain mesh]]&lt;br /&gt;
&lt;br /&gt;
=== Add the terrain mesh ===&lt;br /&gt;
Here's how you bring the terrain mesh into the surface tree:&lt;br /&gt;
* {{accelbtn|RMB}} on the left-hand pane, and choose ''New -&amp;gt; Tree'' via the menu.&lt;br /&gt;
** If you already have a Root node, click the &amp;quot;Begin Editing&amp;quot; button instead.&lt;br /&gt;
* Click on the Root node, and set {{keyname|Model}} to the name of the terrain mesh, in this case {{keyvalue|models/terrain/simpleterrain.obj}}.&lt;br /&gt;
* Press {{accelkey|enter}} to confirm the selection, and the terrain should appear in the 3D view.&lt;br /&gt;
&lt;br /&gt;
Be aware that your terrain model will probably appear bright orange or red.&lt;br /&gt;
The console will probably give you a few WARNING messages, don't worry about these for now, this is because your Megatexture doesn't exist yet!&lt;br /&gt;
&lt;br /&gt;
=== Important note about nodes ===&lt;br /&gt;
When you are editing properties of nodes (names, numbers, texture sources etc.) always remember to hit {{accelkey|enter}} after changing a value, to make sure that the value is stored. If you just type something in and then click somewhere else without pressing {{accelkey|enter}}, your changes may not be applied.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Create the first texture node ==&lt;br /&gt;
[[Image:simplemega_firstnode_diffuse.png|thumb|300px|The first texture node's diffuse texture properties]]&lt;br /&gt;
Now that the model is in place, you can start laying down the texture layers (or &amp;quot;nodes&amp;quot;) that will make up your MegaTexture.&lt;br /&gt;
&lt;br /&gt;
First you need to create a new Image Source node in the Terrain Editor.&lt;br /&gt;
* {{accelbtn|RMB}} on your &amp;quot;Root&amp;quot; node and choose ''New -&amp;gt; Image Source'' (or press {{accelkey|shift}}{{accelkey|i}})&lt;br /&gt;
* This will make a new node called &amp;quot;New Image Renderer&amp;quot;.&lt;br /&gt;
* You can rename this new node using the &amp;quot;Name&amp;quot; property field in the '''Object''' section.&lt;br /&gt;
* Rename the node &amp;quot;Dirt&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You will notice in the top right of the Terrain Editor, a section listing things like &amp;quot;Diffuse&amp;quot;, &amp;quot;Distribution&amp;quot;, &amp;quot;Distribution Pattern&amp;quot; etc. Selecting one of these will list all of the properties for that section of the current node.&lt;br /&gt;
The ones we need to worry about are as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Diffuse'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
This is the colour map of the current node, and it should point to a tiling TGA texture.&lt;br /&gt;
* Make sure the Diffuse section is highlighted in the top right of the Terrain Editor.&lt;br /&gt;
* In the ''File Name'' field of the '''Image Properties''' section, browse to a generic tiling dirt texture. Remember to hit {{accelkey|enter}} afterwards!&lt;br /&gt;
** This example is using {{filename|textures/megagen/temperate/dirt_02_d.tga}}&lt;br /&gt;
* The ''Scale'' field at the very bottom of the property list allows you to choose how much to tile the texture.&lt;br /&gt;
** The default value is 1 1, but you don't want that since it will stretch your texture over the whole mesh, and look really blurry!&lt;br /&gt;
** Instead set the Scale to something like 48 48, this means that the texture will be repeated 48 times across each axis of the terrain. This results in a sharper final output.&lt;br /&gt;
That's all you need to do for the Diffuse settings in this node.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Distribution'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
This is how we control where the layer is drawn (ie. no grass underwater, no sand on angles over 60 degrees etc). It's basically a big mask where ''white = fully shown'' and ''black = fully hidden''.&lt;br /&gt;
* Make sure the Distribution section is highlighted in the top right.&lt;br /&gt;
* Since this is our first node, we want to show over the whole terrain. This means the distribution map should be 100% white.&lt;br /&gt;
* You can either assign a pure white TGA texture, or change the ''Source Type'' to ''geometryBased''.&lt;br /&gt;
** ''geometryBased'' will by default create a fully white map, so if you don't have a white TGA handy, this is faster.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Distribution Pattern'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
This controls how the current node blends into others. Usually this will be set to a tiling TGA heightmap texture that matches the Diffuse texture.&lt;br /&gt;
* We don't need a Distribution Pattern for the first node, since it doesn't blend with anything. Nodes on top of this one will need Distribution Patterns for more interesting and natural blends though!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Local'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
This is the normal-map of the current node. This should be a tiling TGA texture representing the local normal information of the matching Diffuse texture.&lt;br /&gt;
* Make sure the Local section is highlighted in the top right.&lt;br /&gt;
* In the ''File Name'' field of the '''Image Properties''' section, browse to the matching normal map for your tiling dirt texture.&lt;br /&gt;
** This example is using {{filename|textures/megagen/temperate/dirt_02_local.tga}}&lt;br /&gt;
* The Local texture's tiling amount is automatically the same as the Diffuse texture.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Surface Type'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
Your image nodes should all specify a surface type, so that when players walk over or shoot the surface, it gives the correct sound and particle effects.&lt;br /&gt;
* Find the ''Surface Type Properties'' section of the property list.&lt;br /&gt;
* In the '''Type''' field, enter ''dirt''. It should drop down a list of valid surface types as soon as you hit the first letter.&lt;br /&gt;
* Hit {{accelkey|enter}} to accept the surface type.&lt;br /&gt;
&lt;br /&gt;
Your dirt textures will now produce correct &amp;quot;dirt&amp;quot; effects when shot or collided with!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Previewing the result'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
[[Image:simplemega_firstnode_preview.jpg|thumb|300px|The Render mode preview of the first node]]&lt;br /&gt;
Now we can easily check if this is all set up correctly. You should notice a little icon at the top left of your Terrain Editor which looks like this: [[Image:simplemega_previewbutton.png|MegaTexture Render Preview button]]&lt;br /&gt;
&lt;br /&gt;
* Notice the drop-down arrow on the right of the button. Click it, and select ''&amp;quot;Full&amp;quot;'' instead of ''&amp;quot;None&amp;quot;''.&lt;br /&gt;
* Your terrain should change colour to black. This means it's ready for a preview to be rendered onto it.&lt;br /&gt;
* Click the button itself now, instead of the drop-down. An &amp;quot;Active Tasks&amp;quot; window should pop up, and when it's done, you should see your dirt texture appear on your terrain model.&lt;br /&gt;
* You can switch the camera to Render mode too, which will show your terrain model's shading better.&lt;br /&gt;
* If you want a full-resolution preview of a small area, choose ''&amp;quot;Window&amp;quot;'' instead of ''&amp;quot;Full&amp;quot;'' from the drop-down menu.&lt;br /&gt;
** This creates a small window that you can move around using {{accelbtn|LMB}}-drag in the XY Top view. Simply position the window where you want to preview the full-resolution MegaTexture, and hit the Render Preview button.&lt;br /&gt;
&lt;br /&gt;
Now any time you add new nodes, or change a node's properties, you can just click the Render Preview button and the view will update with your changes.&lt;br /&gt;
&lt;br /&gt;
'''Important note:''' Running a 3D application such as Blender, Maya, 3dsmax etc. in the background, may prevent a MegaTexture preview being rendered correctly. If your node is set up correctly but the preview render is appearing as black or patchy, make sure you have closed any 3D applications and try re-rendering the preview.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Adding a second node ==&lt;br /&gt;
Now that the first layer of dirt is in place, we can try putting some grass on top of it!&lt;br /&gt;
* Again, {{accelbtn|RMB}} on your &amp;quot;Root&amp;quot; node and choose ''New -&amp;gt; Image Source'' (or press {{accelkey|shift}}{{accelkey|i}})&lt;br /&gt;
* This will make another new node below your &amp;quot;Dirt&amp;quot; node. &lt;br /&gt;
* Name this new node &amp;quot;Grass&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Surface Tree hierarchy is rendered from the top down, so nodes ''above'' other nodes in the hierarchy will be rendered ''before'' the other nodes. So currently it'll be rendering our Dirt node, and then rendering the Grass node on top of the dirt.&lt;br /&gt;
&lt;br /&gt;
Again, the main map types need to be specified before the node can be rendered:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Diffuse'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
* Make sure the Diffuse section is highlighted in the top right of the Terrain Editor.&lt;br /&gt;
* In the ''File Name'' field of the '''Image Properties''' section, browse to a generic tiling grass texture.&lt;br /&gt;
** This example is using {{filename|textures/megagen/temperate/grass_04_d.tga}}&lt;br /&gt;
* Again you will want to set the ''Scale'' value to something other than 1 1, to tile your texture. Let's use 32 32 for this one.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Distribution'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
This is important now, since we need to control where this layer is visible. Pure white won't work, since that'll just completely cover our underlying Dirt node!&lt;br /&gt;
* Make sure the Distribution section is highlighted in the top right.&lt;br /&gt;
* Change the &amp;quot;Source Type&amp;quot; from ''texture'' to ''geometryBased''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Geometric Texture Distribution'''&lt;br /&gt;
----&lt;br /&gt;
[[Image:simplemega_geometric_distribution.png|thumb|300px|The geometric texture distribution settings of the second node]]&lt;br /&gt;
This is where it gets interesting! There are many settings to alter, and they can have a drastic effect on how different your terrain looks, so try playing around with different values if you're not happy with the initial results.&lt;br /&gt;
&lt;br /&gt;
* '''Altitude Lower''' - Enabling this will limit the lower parts of the terrain from receiving this node's textures.&lt;br /&gt;
** '''Altitude Lower Value''' - The Z height in world units that the node will be drawn above. The default of 0 means that any parts of your terrain mesh below Z=0 will not show any of this node's textures.&lt;br /&gt;
** '''Fuzziness''' - The amount of blur applied to the mask. The higher the value, the more blurry the boundary.&lt;br /&gt;
* '''Altitude Upper''' - Enabling this will limit the higher parts of the terrain from receiving this node's textures.&lt;br /&gt;
** '''Altitude Upper Value''' - The Z height in world units that the node will be drawn below. The default of 0 means that any parts of your terrain mesh above Z=0 will not show any of this node's textures.&lt;br /&gt;
** '''Fuzziness''' - The amount of blur applied to the mask. The higher the value, the more blurry the boundary.&lt;br /&gt;
&lt;br /&gt;
* '''Clamp Distribution To Edge''' - Leave this on Default.&lt;br /&gt;
&lt;br /&gt;
* '''Resolution''' - The size in pixels of the resulting mask. The default value of 256 is fine for nearly any terrain model.&lt;br /&gt;
&lt;br /&gt;
* '''Slope Lower''' - Enabling this will limit shallower angles of the terrain model from receiving this node's textures.&lt;br /&gt;
** '''Slope Lower Value''' - The angle in degrees that the node will be drawn past. The default angle of 0 will result in no change to your mask.&lt;br /&gt;
** '''Fuzziness''' - The amount of blur applied to the mask. The higher the value, the more blurry the boundary.&lt;br /&gt;
* '''Slope Upper''' - Enabling this will limit the steeper angles of the terrain model from receiving this node's textures. This is great for masking out cliffs from your nodes.&lt;br /&gt;
** '''Slope Upper Value''' - The angle in degrees that the node will be hidden past. The default angle of 0 will result in a fully black mask.&lt;br /&gt;
** '''Fuzziness''' - The amount of blur applied to the mask. The higher the value, the more blurry the boundary.&lt;br /&gt;
&lt;br /&gt;
The settings you use for each of these will vary depending on your terrain model, and the type of node you're making. For our Grass node, you can see the settings used for this example in the screenshot above on the right.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Distribution Pattern'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
[[Image:simplemega_dist_ramps.jpg|thumb|300px|The difference between using or not using a Distribution Pattern, and varying Ramp Widths]]&lt;br /&gt;
This controls how the the grass will blend into the dirt. If you don't have a Distribution Pattern texture, the grass will just slowly fade into the dirt, which doesn't look very natural!&lt;br /&gt;
So what we want here is a texture to identify the &amp;quot;height&amp;quot; of the areas of grass. This means that the dirt can blend in based on the height of each clump of grass, so instead of a smooth fade you will get a more natural blend between the grass and the dirt.&lt;br /&gt;
&lt;br /&gt;
If you examine the screenshot to the right, you can see what effect a good Distribution Pattern can have - when the node is rendered with no Distribution Pattern, the blend between the nodes is a simple smooth gradient, which does not look very natural at all. You can also see the difference that the '''Ramp Width''' value makes - this is a very powerful value, so experiment with it until you really understand the effect it has!&lt;br /&gt;
&lt;br /&gt;
* Make sure the Distribution Pattern section is highlighted in the top right.&lt;br /&gt;
* In the ''File Name'' field of the '''Image Properties''' section, browse to the matching heightmap or mask for your tiling grass texture.&lt;br /&gt;
** This example is using {{filename|textures/megagen/temperate/grass_04_mask.tga}}&lt;br /&gt;
* The ''Ramp Width'' should be set to a value lower than the default of 1, since this causes a very blurry blend, which is usually not what you want. Try a value of 0.25 and re-render the preview - try a &amp;quot;Window&amp;quot; preview as described earlier to get a full-resolution preview where you can really see the blend working.&lt;br /&gt;
* '''Important!''' You will also need to set the ''Distribution Pattern Texture Scale'' to the same value as the Diffuse Scale, in this case we just use 32 32 again.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Local'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
Again we want the normal-map which matches the diffuse texture for the grass.&lt;br /&gt;
* Make sure the Local section is highlighted in the top right.&lt;br /&gt;
* In the ''File Name'' field of the '''Image Properties''' section, browse to the matching normal map for your tiling grass texture.&lt;br /&gt;
** This example is using {{filename|textures/megagen/temperate/grass_04_local.tga}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Surface Type'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
Again, you need to specify a surface type, so that when players walk over or shoot the surface, it gives the correct sound and particle effects.&lt;br /&gt;
* Find the ''Surface Type Properties'' section of the property list.&lt;br /&gt;
* In the '''Type''' field, enter ''grass''. It should drop down a list of valid surface types as soon as you hit the first letter.&lt;br /&gt;
* Hit {{accelkey|enter}} to accept the surface type.&lt;br /&gt;
&lt;br /&gt;
Your grass textures should now produce correct &amp;quot;grass&amp;quot; effects when shot or collided with!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Preview again!'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
[[Image:simplemega_secondnode_preview.jpg|thumb|300px|The Render mode preview of the second node blended with the first node]]&lt;br /&gt;
Now that's all set up, you can hit the Render Preview ([[Image:simplemega_previewbutton.png|MegaTexture Render Preview button]]) button again and see what effect the new Grass node has.&lt;br /&gt;
If it's being distributed into the wrong places, you can go back into your Distribution settings and tweak the values for the ''geometryBased'' settings. Then you can preview again until it looks right.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Adding a third node ==&lt;br /&gt;
[[Image:simplemega_thirdnode_preview.jpg|thumb|300px|The Render mode preview of the third node blended with the other two nodes]]&lt;br /&gt;
Now that the grass and dirt are in place, we need some rocks to make the terrain look more natural.&lt;br /&gt;
* Again, {{accelbtn|RMB}} on your &amp;quot;Root&amp;quot; node and choose ''New -&amp;gt; Image Source'' (or press {{accelkey|shift}}{{accelkey|i}})&lt;br /&gt;
* This will make another new node below your &amp;quot;Grass&amp;quot; node. &lt;br /&gt;
* Name this new node &amp;quot;Rock&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Again, the main map types need to be specified before the node can be rendered:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Diffuse'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
* In the ''File Name'' field of the '''Diffuse''' section, browse to a generic tiling rock texture.&lt;br /&gt;
** This example is using {{filename|textures/megagen/temperate/rock_01_d.tga}}&lt;br /&gt;
* Set the ''Scale'' value to 32 32.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Distribution'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
Again we can use Geometric Texture Distribution to easily apply the rock textures only to the cliff-like angles.&lt;br /&gt;
* Make sure the Distribution section is highlighted in the top right.&lt;br /&gt;
* Change the &amp;quot;Source Type&amp;quot; from ''texture'' to ''geometryBased''.&lt;br /&gt;
* To make the rock texture only appear on near vertical surfaces, set the ''Slope Lower Value'' to 23, and the ''Fuzziness'' of Slope Lower to 0.05&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Distribution Pattern'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
Again this will control how the the rocks blend into the other nodes. Again, we want a texture to identify the &amp;quot;height&amp;quot; of the tiling rock texture.&lt;br /&gt;
&lt;br /&gt;
* Make sure the Distribution Pattern section is highlighted in the top right.&lt;br /&gt;
* In the ''File Name'' field of the '''Image Properties''' section, browse to the matching heightmap or mask for your tiling rock texture.&lt;br /&gt;
** This example is using {{filename|textures/megagen/temperate/rock_01_h.tga}}&lt;br /&gt;
* The ''Ramp Width'' should be set to a value much lower than the default of 1, since this causes a very blurry blend, which is not natural for rocks blending with dirt. Try a value of 0.1 here, then render a &amp;quot;Window&amp;quot; preview to see how the blending looks.&lt;br /&gt;
* Remember to set the ''Distribution Pattern Texture Scale'' to the same value as the Diffuse Scale, 32 32.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Local'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
Again we want the normal-map which matches the diffuse texture for the rocks.&lt;br /&gt;
* In the ''File Name'' field of the '''Local''' section, browse to the matching normal map for your tiling rock texture.&lt;br /&gt;
** This example is using {{filename|textures/megagen/temperate/rock_01_local.tga}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Surface Type'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
* Find the ''Surface Type Properties'' section of the property list.&lt;br /&gt;
* In the '''Type''' field, enter ''stone''.&lt;br /&gt;
* Hit {{accelkey|enter}} to accept the surface type.&lt;br /&gt;
&lt;br /&gt;
Your rock textures should now produce correct &amp;quot;stone&amp;quot; effects when shot or collided with.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Preview again!'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
Now that the rocks are set up, you can hit the Render Preview ([[Image:simplemega_previewbutton.png|MegaTexture Render Preview button]]) button again and see what effect the new Rock node has.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Further tweaks ==&lt;br /&gt;
There are other simple changes that can be done in the Terrain Editor to make your MegaTexture look even better.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Node order'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
[[Image:simplemega_node_order.png|frame|Click and drag a node to change the order]]&lt;br /&gt;
You may notice, if you look carefully at the blends between the rock and grass nodes, that some areas of the MegaTexture appear to show the rock texture ''on top'' of the grass! This doesn't look very natural, and it's happening because of the node order.&lt;br /&gt;
&lt;br /&gt;
Since the Rock node is below the Grass node, it will always be rendered on top of the grass. However, there is an easy way to fix this! In the node list of the Terrain Editor, you can click and drag any node to move it above or below existing nodes.&lt;br /&gt;
&lt;br /&gt;
* {{accelbtn|LMB}}-drag the Rock node and move it up in the list until you see a black bar appear between the Dirt and Grass nodes, as shown on the right.&lt;br /&gt;
* Release {{accelbtn|LMB}} when you have positioned the node in the correct place.&lt;br /&gt;
* With the Rock node now positioned between the Dirt and Grass nodes, the grass will appear on top of the rocks as well as the dirt, which looks much more natural!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Color changes'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
Maybe your dirt texture is too bright? Or maybe your grass looks a little ''too'' green?&lt;br /&gt;
You can easily fix this from the Terrain Editor itself! No need to create a new image every time you want to tweak the color or brightness, you can set this up on a per-node basis.&lt;br /&gt;
&lt;br /&gt;
Let's say you want to make the dirt texture darker and a bit more red. Here's how you'd do it:&lt;br /&gt;
* Select your Dirt node.&lt;br /&gt;
* Look under the ''Color Properties'' area in the property list, and {{accelbtn|LMB}} on the '''Color''' swatch (next to where it says 1 1 1, which is white).&lt;br /&gt;
* A color wheel and brightness slider will pop up in a new window. You can use this to darken and tint your texture.&lt;br /&gt;
* Choose a darker brightness, and a color slightly towards red. I used '''RGB Values''' of 225, 220, 220.&lt;br /&gt;
* Hit ''OK'' to accept the color.&lt;br /&gt;
* Re-render your MegaTexture preview. You should notice that the dirt layer looks darker now!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Texture rotation'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
If you're building up a lot of layers of tiling textures, it can sometimes become obvious when a texture tiles in a particular direction. You may see repeating patterns extending into the distance when looking in particular directions, especially if all your nodes have the same orientation.&lt;br /&gt;
&lt;br /&gt;
An easy way to overcome this is to play with the ''Rotation'' value in the Texture Properties section of the Terrain Editor's property list.&lt;br /&gt;
For each node, you should also set the ''Distribution Pattern Texture Rotation'' to match the Rotation value if you want your distribution patterns to line up and work correctly.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Render the MegaTexture =&lt;br /&gt;
=== Save the Surface Tree ===&lt;br /&gt;
Once you're happy with how the preview looks in the editor, you should make sure that your final Surface Tree is saved. Either click the &amp;quot;Save and Unload&amp;quot; button in the Terrain Editor, or save the whole map.&lt;br /&gt;
&lt;br /&gt;
=== Compile Only Entities ===&lt;br /&gt;
At this stage, your MegaTexture material is still technically &amp;quot;broken&amp;quot;, since no ''.mega'' file exists yet. This means that if you try to compile the map, it'll take ages to process the terrain model, since it treats it as a regular model rather than the special case of terrain. Not only will this waste 5-10 minutes of your time, but it'll also produce a broken map.&lt;br /&gt;
&lt;br /&gt;
However, we need to compile the map in order to tell the [[renderLight]] process which atmosphere to use when lighting the MegaTexture!&lt;br /&gt;
&lt;br /&gt;
So the solution is to do an '''Only Entities''' compile. You can find this in the menu ''Compile -&amp;gt; 2 - Only Entities'' in editWorld. This should be done in a few seconds, and compiles all the information that renderLight needs.&lt;br /&gt;
&lt;br /&gt;
Bear in mind that this compile process will not produce a playable map, so you will have to do a full recompile once the MegaTexture is fully rendered.&lt;br /&gt;
&lt;br /&gt;
=== Run the SDK Launcher ===&lt;br /&gt;
Now that your ''.sft'' is saved, go through all the steps outlined in the [[Generate a MegaTexture]] tutorial.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= That's it! =&lt;br /&gt;
[[Image:simplemega_ingame.jpg|thumb|300px|The MegaTexture in-game!]]&lt;br /&gt;
You've now created your very own MegaTexture to use in your map!&lt;br /&gt;
&lt;br /&gt;
Before you even compile the map, you can get an accurate preview of how it will look in-game by pressing {{accelkey|F6}} to toggle &amp;quot;anim&amp;quot; mode while in editWorld's &amp;quot;RENDER&amp;quot; Camera view (toggled with {{accelkey|F3}}).&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
= Troubleshooting =&lt;br /&gt;
If your terrain model still shows as red even after you've compiled the MegaTexture, there are a couple of things you should check first:&lt;br /&gt;
* See if the console gives you any warnings about missing ''.stm'' files. If this is the case, you probably forgot to assign any Surface Types to your texture nodes. Double-check them and make sure it's all set up correctly.&lt;br /&gt;
* Make sure there aren't any spelling mistakes or typos in your ''.mtr'' material file. The 2nd part of the material should have exactly the same name as your map (the ''&amp;lt; &amp;quot;mapname&amp;quot; &amp;gt;'' part described in [[A Simple First Megatexture#Creating a MegaTexture material|this section]]), otherwise it will not be searching for the correct images.&lt;br /&gt;
* Make sure there aren't any spelling mistakes in your ''.rlt'' file (as described in [[RenderLight|this article]]). If any of the names are inconsistent, the Megatexture will not have been compiled fully.&lt;br /&gt;
&lt;br /&gt;
If your map compile is taking ages (ie. over 2-3 minutes for a 32,000 triangle terrain model) then it's probably because the MegaTexture material is broken. Double-check the issues listed above, and make sure you have run the {{consolecmd|reloaddecls}} console command if you changed any ''.mtr'' or ''.rlt'' files.&lt;br /&gt;
&lt;br /&gt;
If your ''.mega'' and ''.stm'' files definitely exist, in the right folders, try closing and re-opening the ''.world'' file in editWorld. This should load and display the MegaTexture properly.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= See Also =&lt;br /&gt;
* [[An Advanced Terrain and Megatexture]] - an advanced guide for complete MegaTexture creation&lt;br /&gt;
* [[Generate a MegaTexture]] - steps for generating a MegaTexture from the SDK launcher.&lt;br /&gt;
&lt;br /&gt;
[[Category:Art]]&lt;br /&gt;
[[Category:Basic Level Design]]&lt;br /&gt;
[[Category:Tutorials]]&lt;/div&gt;</summary>
		<author><name>MoP</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.splashdamage.com/index.php?title=A_Simple_First_Megatexture&amp;diff=4016</id>
		<title>A Simple First Megatexture</title>
		<link rel="alternate" type="text/html" href="https://wiki.splashdamage.com/index.php?title=A_Simple_First_Megatexture&amp;diff=4016"/>
		<updated>2007-12-13T17:04:28Z</updated>

		<summary type="html">&lt;p&gt;MoP: 3d apps running in the background can break the preview&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Image:simplemega_ingame.jpg|right|thumb|500px|A simple MegaTexture, easily created with only 3 texture layers!]]&lt;br /&gt;
So now that you've made [[A Simple First Terrain]], no doubt you'll want to apply a MegaTexture to it! This MegaTexture won't be as detailed or as attractive as an advanced MegaTexture, but will demonstrate the basics of creating a [[Surface Tree]], assigning textures, and compiling it all into a working MegaTexture file.&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
'''For this tutorial you must:'''&lt;br /&gt;
* Have a terrain model UV-mapped in the 0-1 range (covered in the simple first terrain tutorial)&lt;br /&gt;
* Have access to some tiling textures.&lt;br /&gt;
* Have a little understanding the ETQW material system&lt;br /&gt;
&lt;br /&gt;
If you don't have any of the above things, you are not ready to do this tutorial!&lt;br /&gt;
&lt;br /&gt;
'''This tutorial covers:'''&lt;br /&gt;
* How to set up a MegaTexture material&lt;br /&gt;
* How to create a Surface Tree&lt;br /&gt;
* How to add texture nodes in the Terrain Editor&lt;br /&gt;
* How to render and compile a full MegaTexture&lt;br /&gt;
&lt;br /&gt;
'''This tutorial does not cover:'''&lt;br /&gt;
* How to use Blender/Maya/Lightwave/ZBrush/Mudbox/3DSMax/Photoshop&lt;br /&gt;
* How to create tiling textures or heightmaps&lt;br /&gt;
* Anything overly complicated&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Creating a MegaTexture material =&lt;br /&gt;
Firstly you need to create a new material for your terrain to use. If you have never made a new material before, read the article on [[Adding Custom Textures]]. All you need to do is create (or use an existing) ''.mtr'' file and place a material declaration in it, in the manner shown here:&lt;br /&gt;
 material megatextures/mapname		{ useTemplate megatextures/default_ambient&amp;lt; &amp;quot;mapname&amp;quot; &amp;gt; }&lt;br /&gt;
&lt;br /&gt;
This material would automatically search for a MegaTexture called {{filename|mapname.mega}} in the {{filename|/megatextures/}} folder. This example material uses the ''&amp;quot;default_ambient&amp;quot;'' template, which expects a 3-channel RGB MegaTexture. These are generated by the default settings of the [[Generate a MegaTexture|MegaTexture tab in the SDK Launcher]].&lt;br /&gt;
&lt;br /&gt;
Obviously you would want to use the actual name of your map instead of &amp;quot;mapname&amp;quot;, for consistency's sake and ease of reference.&lt;br /&gt;
&lt;br /&gt;
Remember that if you made a new ''.mtr'' file after the game or editor was started, you'll have to restart the whole game and editor before it will read your new file.&lt;br /&gt;
&lt;br /&gt;
=== Assigning the material ===&lt;br /&gt;
You should assign the material you just created by naming a material in your 3D application and applying it to your terrain mesh, then export the model to your preferred format (LWO, ASE or OBJ).&lt;br /&gt;
Tips on this process can be found in the [[A Simple First Terrain|simple first terrain tutorial]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Creating the Surface Tree =&lt;br /&gt;
As described in the Simple First Terrain tutorial, terrain models are set up in the Terrain Editor, accessible via {{accelkey|shift}}{{accelkey|N}} in [[editWorld]]. This tool creates a Surface Tree file ({{filename|.sft}}) that contains all the information about the terrain, including roads, stamps, and detail texture information that MegaGen needs to generate a MegaTexture. The Surface Tree will be saved every time the map is saved, or any time you press the &amp;quot;Save and Unload&amp;quot; button in the Terrain Editor.&lt;br /&gt;
[[Image:simplemega_terrainmodel.png|thumb|300px|Root node set up to use the correct terrain mesh]]&lt;br /&gt;
&lt;br /&gt;
=== Add the terrain mesh ===&lt;br /&gt;
Here's how you bring the terrain mesh into the surface tree:&lt;br /&gt;
* {{accelbtn|RMB}} on the left-hand pane, and choose ''New -&amp;gt; Tree'' via the menu.&lt;br /&gt;
** If you already have a Root node, click the &amp;quot;Begin Editing&amp;quot; button instead.&lt;br /&gt;
* Click on the Root node, and set {{keyname|Model}} to the name of the terrain mesh, in this case {{keyvalue|models/terrain/simpleterrain.obj}}.&lt;br /&gt;
* Press {{accelkey|enter}} to confirm the selection, and the terrain should appear in the 3D view.&lt;br /&gt;
&lt;br /&gt;
Be aware that your terrain model will probably appear bright orange or red.&lt;br /&gt;
The console will probably give you a few WARNING messages, don't worry about these for now, this is because your Megatexture doesn't exist yet!&lt;br /&gt;
&lt;br /&gt;
=== Important note about nodes ===&lt;br /&gt;
When you are editing properties of nodes (names, numbers, texture sources etc.) always remember to hit {{accelkey|enter}} after changing a value, to make sure that the value is stored. If you just type something in and then click somewhere else without pressing {{accelkey|enter}}, your changes may not be applied.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Create the first texture node ==&lt;br /&gt;
[[Image:simplemega_firstnode_diffuse.png|thumb|300px|The first texture node's diffuse texture properties]]&lt;br /&gt;
Now that the model is in place, you can start laying down the texture layers (or &amp;quot;nodes&amp;quot;) that will make up your MegaTexture.&lt;br /&gt;
&lt;br /&gt;
First you need to create a new Image Source node in the Terrain Editor.&lt;br /&gt;
* {{accelbtn|RMB}} on your &amp;quot;Root&amp;quot; node and choose ''New -&amp;gt; Image Source'' (or press {{accelkey|shift}}{{accelkey|i}})&lt;br /&gt;
* This will make a new node called &amp;quot;New Image Renderer&amp;quot;. You can rename this using the &amp;quot;Name&amp;quot; property field in the '''Object''' section.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You will notice in the top right of the Terrain Editor, a section listing things like &amp;quot;Diffuse&amp;quot;, &amp;quot;Distribution&amp;quot;, &amp;quot;Distribution Pattern&amp;quot; etc. Selecting one of these will list all of the properties for that section of the current node.&lt;br /&gt;
The ones we need to worry about are as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Diffuse'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
This is the colour map of the current node, and it should point to a tiling TGA texture.&lt;br /&gt;
* Make sure the Diffuse section is highlighted in the top right of the Terrain Editor.&lt;br /&gt;
* In the ''File Name'' field of the '''Image Properties''' section, browse to a generic tiling dirt texture. Remember to hit {{accelkey|enter}} afterwards!&lt;br /&gt;
** This example is using {{filename|textures/megagen/temperate/dirt_02_d.tga}}&lt;br /&gt;
* The ''Scale'' field at the very bottom of the property list allows you to choose how much to tile the texture.&lt;br /&gt;
** The default value is 1 1, but you don't want that since it will stretch your texture over the whole mesh, and look really blurry!&lt;br /&gt;
** Instead set the Scale to something like 48 48, this means that the texture will be repeated 48 times across each axis of the terrain. This results in a sharper final output.&lt;br /&gt;
That's all you need to do for the Diffuse settings in this node.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Distribution'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
This is how we control where the layer is drawn (ie. no grass underwater, no sand on angles over 60 degrees etc). It's basically a big mask where ''white = fully shown'' and ''black = fully hidden''.&lt;br /&gt;
* Make sure the Distribution section is highlighted in the top right.&lt;br /&gt;
* Since this is our first node, we want to show over the whole terrain. This means the distribution map should be 100% white.&lt;br /&gt;
* You can either assign a pure white TGA texture, or change the ''Source Type'' to ''geometryBased''.&lt;br /&gt;
** ''geometryBased'' will by default create a fully white map, so if you don't have a white TGA handy, this is faster.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Distribution Pattern'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
This controls how the current node blends into others. Usually this will be set to a tiling TGA heightmap texture that matches the Diffuse texture.&lt;br /&gt;
* We don't need a Distribution Pattern for the first node, since it doesn't blend with anything. Nodes on top of this one will need Distribution Patterns for more interesting and natural blends though!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Local'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
This is the normal-map of the current node. This should be a tiling TGA texture representing the local normal information of the matching Diffuse texture.&lt;br /&gt;
* Make sure the Local section is highlighted in the top right.&lt;br /&gt;
* In the ''File Name'' field of the '''Image Properties''' section, browse to the matching normal map for your tiling dirt texture.&lt;br /&gt;
** This example is using {{filename|textures/megagen/temperate/dirt_02_local.tga}}&lt;br /&gt;
* The Local texture's tiling amount is automatically the same as the Diffuse texture.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Surface Type'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
Your image nodes should all specify a surface type, so that when players walk over or shoot the surface, it gives the correct sound and particle effects.&lt;br /&gt;
* Find the ''Surface Type Properties'' section of the property list.&lt;br /&gt;
* In the '''Type''' field, enter ''dirt''. It should drop down a list of valid surface types as soon as you hit the first letter.&lt;br /&gt;
* Hit {{accelkey|enter}} to accept the surface type.&lt;br /&gt;
&lt;br /&gt;
Your dirt textures will now produce correct &amp;quot;dirt&amp;quot; effects when shot or collided with!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Previewing the result'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
[[Image:simplemega_firstnode_preview.jpg|thumb|300px|The Render mode preview of the first node]]&lt;br /&gt;
Now we can easily check if this is all set up correctly. You should notice a little icon at the top left of your Terrain Editor which looks like this: [[Image:simplemega_previewbutton.png|MegaTexture Render Preview button]]&lt;br /&gt;
&lt;br /&gt;
* Notice the drop-down arrow on the right of the button. Click it, and select ''&amp;quot;Full&amp;quot;'' instead of ''&amp;quot;None&amp;quot;''.&lt;br /&gt;
* Your terrain should change colour to black. This means it's ready for a preview to be rendered onto it.&lt;br /&gt;
* Click the button itself now, instead of the drop-down. An &amp;quot;Active Tasks&amp;quot; window should pop up, and when it's done, you should see your dirt texture appear on your terrain model.&lt;br /&gt;
* You can switch the camera to Render mode too, which will show your terrain model's shading better.&lt;br /&gt;
* If you want a full-resolution preview of a small area, choose ''&amp;quot;Window&amp;quot;'' instead of ''&amp;quot;Full&amp;quot;'' from the drop-down menu.&lt;br /&gt;
** This creates a small window that you can move around using {{accelbtn|LMB}}-drag in the XY Top view. Simply position the window where you want to preview the full-resolution MegaTexture, and hit the Render Preview button.&lt;br /&gt;
&lt;br /&gt;
Now any time you add new nodes, or change a node's properties, you can just click the Render Preview button and the view will update with your changes.&lt;br /&gt;
&lt;br /&gt;
'''Important note:''' Running a 3D application such as Blender, Maya, 3dsmax etc. in the background, may prevent a MegaTexture preview being rendered correctly. If your node is set up correctly but the preview render is appearing as black or patchy, make sure you have closed any 3D applications and try re-rendering the preview.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Adding a second node ==&lt;br /&gt;
Now that the first layer of dirt is in place, we can try putting some grass on top of it!&lt;br /&gt;
* Again, {{accelbtn|RMB}} on your &amp;quot;Root&amp;quot; node and choose ''New -&amp;gt; Image Source'' (or press {{accelkey|shift}}{{accelkey|i}})&lt;br /&gt;
* This will make another new node below your &amp;quot;Dirt&amp;quot; node. &lt;br /&gt;
* Name this new node &amp;quot;Grass&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Surface Tree hierarchy is rendered from the top down, so nodes ''above'' other nodes in the hierarchy will be rendered ''before'' the other nodes. So currently it'll be rendering our Dirt node, and then rendering the Grass node on top of the dirt.&lt;br /&gt;
&lt;br /&gt;
Again, the main map types need to be specified before the node can be rendered:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Diffuse'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
* Make sure the Diffuse section is highlighted in the top right of the Terrain Editor.&lt;br /&gt;
* In the ''File Name'' field of the '''Image Properties''' section, browse to a generic tiling grass texture.&lt;br /&gt;
** This example is using {{filename|textures/megagen/temperate/grass_04_d.tga}}&lt;br /&gt;
* Again you will want to set the ''Scale'' value to something other than 1 1, to tile your texture. Let's use 32 32 for this one.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Distribution'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
This is important now, since we need to control where this layer is visible. Pure white won't work, since that'll just completely cover our underlying Dirt node!&lt;br /&gt;
* Make sure the Distribution section is highlighted in the top right.&lt;br /&gt;
* Change the &amp;quot;Source Type&amp;quot; from ''texture'' to ''geometryBased''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Geometric Texture Distribution'''&lt;br /&gt;
----&lt;br /&gt;
[[Image:simplemega_geometric_distribution.png|thumb|300px|The geometric texture distribution settings of the second node]]&lt;br /&gt;
This is where it gets interesting! There are many settings to alter, and they can have a drastic effect on how different your terrain looks, so try playing around with different values if you're not happy with the initial results.&lt;br /&gt;
&lt;br /&gt;
* '''Altitude Lower''' - Enabling this will limit the lower parts of the terrain from receiving this node's textures.&lt;br /&gt;
** '''Altitude Lower Value''' - The Z height in world units that the node will be drawn above. The default of 0 means that any parts of your terrain mesh below Z=0 will not show any of this node's textures.&lt;br /&gt;
** '''Fuzziness''' - The amount of blur applied to the mask. The higher the value, the more blurry the boundary.&lt;br /&gt;
* '''Altitude Upper''' - Enabling this will limit the higher parts of the terrain from receiving this node's textures.&lt;br /&gt;
** '''Altitude Upper Value''' - The Z height in world units that the node will be drawn below. The default of 0 means that any parts of your terrain mesh above Z=0 will not show any of this node's textures.&lt;br /&gt;
** '''Fuzziness''' - The amount of blur applied to the mask. The higher the value, the more blurry the boundary.&lt;br /&gt;
&lt;br /&gt;
* '''Clamp Distribution To Edge''' - Leave this on Default.&lt;br /&gt;
&lt;br /&gt;
* '''Resolution''' - The size in pixels of the resulting mask. The default value of 256 is fine for nearly any terrain model.&lt;br /&gt;
&lt;br /&gt;
* '''Slope Lower''' - Enabling this will limit shallower angles of the terrain model from receiving this node's textures.&lt;br /&gt;
** '''Slope Lower Value''' - The angle in degrees that the node will be drawn past. The default angle of 0 will result in no change to your mask.&lt;br /&gt;
** '''Fuzziness''' - The amount of blur applied to the mask. The higher the value, the more blurry the boundary.&lt;br /&gt;
* '''Slope Upper''' - Enabling this will limit the steeper angles of the terrain model from receiving this node's textures. This is great for masking out cliffs from your nodes.&lt;br /&gt;
** '''Slope Upper Value''' - The angle in degrees that the node will be hidden past. The default angle of 0 will result in a fully black mask.&lt;br /&gt;
** '''Fuzziness''' - The amount of blur applied to the mask. The higher the value, the more blurry the boundary.&lt;br /&gt;
&lt;br /&gt;
The settings you use for each of these will vary depending on your terrain model, and the type of node you're making. For our Grass node, you can see the settings used for this example in the screenshot above on the right.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Distribution Pattern'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
[[Image:simplemega_dist_ramps.jpg|thumb|300px|The difference between using or not using a Distribution Pattern, and varying Ramp Widths]]&lt;br /&gt;
This controls how the the grass will blend into the dirt. If you don't have a Distribution Pattern texture, the grass will just slowly fade into the dirt, which doesn't look very natural!&lt;br /&gt;
So what we want here is a texture to identify the &amp;quot;height&amp;quot; of the areas of grass. This means that the dirt can blend in based on the height of each clump of grass, so instead of a smooth fade you will get a more natural blend between the grass and the dirt.&lt;br /&gt;
&lt;br /&gt;
If you examine the screenshot to the right, you can see what effect a good Distribution Pattern can have - when the node is rendered with no Distribution Pattern, the blend between the nodes is a simple smooth gradient, which does not look very natural at all. You can also see the difference that the '''Ramp Width''' value makes - this is a very powerful value, so experiment with it until you really understand the effect it has!&lt;br /&gt;
&lt;br /&gt;
* Make sure the Distribution Pattern section is highlighted in the top right.&lt;br /&gt;
* In the ''File Name'' field of the '''Image Properties''' section, browse to the matching heightmap or mask for your tiling grass texture.&lt;br /&gt;
** This example is using {{filename|textures/megagen/temperate/grass_04_mask.tga}}&lt;br /&gt;
* The ''Ramp Width'' should be set to a value lower than the default of 1, since this causes a very blurry blend, which is usually not what you want. Try a value of 0.25 and re-render the preview - try a &amp;quot;Window&amp;quot; preview as described earlier to get a full-resolution preview where you can really see the blend working.&lt;br /&gt;
* '''Important!''' You will also need to set the ''Distribution Pattern Texture Scale'' to the same value as the Diffuse Scale, in this case we just use 32 32 again.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Local'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
Again we want the normal-map which matches the diffuse texture for the grass.&lt;br /&gt;
* Make sure the Local section is highlighted in the top right.&lt;br /&gt;
* In the ''File Name'' field of the '''Image Properties''' section, browse to the matching normal map for your tiling grass texture.&lt;br /&gt;
** This example is using {{filename|textures/megagen/temperate/grass_04_local.tga}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Surface Type'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
Again, you need to specify a surface type, so that when players walk over or shoot the surface, it gives the correct sound and particle effects.&lt;br /&gt;
* Find the ''Surface Type Properties'' section of the property list.&lt;br /&gt;
* In the '''Type''' field, enter ''grass''. It should drop down a list of valid surface types as soon as you hit the first letter.&lt;br /&gt;
* Hit {{accelkey|enter}} to accept the surface type.&lt;br /&gt;
&lt;br /&gt;
Your grass textures should now produce correct &amp;quot;grass&amp;quot; effects when shot or collided with!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Preview again!'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
[[Image:simplemega_secondnode_preview.jpg|thumb|300px|The Render mode preview of the second node blended with the first node]]&lt;br /&gt;
Now that's all set up, you can hit the Render Preview ([[Image:simplemega_previewbutton.png|MegaTexture Render Preview button]]) button again and see what effect the new Grass node has.&lt;br /&gt;
If it's being distributed into the wrong places, you can go back into your Distribution settings and tweak the values for the ''geometryBased'' settings. Then you can preview again until it looks right.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Adding a third node ==&lt;br /&gt;
[[Image:simplemega_thirdnode_preview.jpg|thumb|300px|The Render mode preview of the third node blended with the other two nodes]]&lt;br /&gt;
Now that the grass and dirt are in place, we need some rocks to make the terrain look more natural.&lt;br /&gt;
* Again, {{accelbtn|RMB}} on your &amp;quot;Root&amp;quot; node and choose ''New -&amp;gt; Image Source'' (or press {{accelkey|shift}}{{accelkey|i}})&lt;br /&gt;
* This will make another new node below your &amp;quot;Grass&amp;quot; node. &lt;br /&gt;
* Name this new node &amp;quot;Rock&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Again, the main map types need to be specified before the node can be rendered:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Diffuse'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
* In the ''File Name'' field of the '''Diffuse''' section, browse to a generic tiling rock texture.&lt;br /&gt;
** This example is using {{filename|textures/megagen/temperate/rock_01_d.tga}}&lt;br /&gt;
* Set the ''Scale'' value to 32 32.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Distribution'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
Again we can use Geometric Texture Distribution to easily apply the rock textures only to the cliff-like angles.&lt;br /&gt;
* Make sure the Distribution section is highlighted in the top right.&lt;br /&gt;
* Change the &amp;quot;Source Type&amp;quot; from ''texture'' to ''geometryBased''.&lt;br /&gt;
* To make the rock texture only appear on near vertical surfaces, set the ''Slope Lower Value'' to 23, and the ''Fuzziness'' of Slope Lower to 0.05&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Distribution Pattern'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
Again this will control how the the rocks blend into the other nodes. Again, we want a texture to identify the &amp;quot;height&amp;quot; of the tiling rock texture.&lt;br /&gt;
&lt;br /&gt;
* Make sure the Distribution Pattern section is highlighted in the top right.&lt;br /&gt;
* In the ''File Name'' field of the '''Image Properties''' section, browse to the matching heightmap or mask for your tiling rock texture.&lt;br /&gt;
** This example is using {{filename|textures/megagen/temperate/rock_01_h.tga}}&lt;br /&gt;
* The ''Ramp Width'' should be set to a value much lower than the default of 1, since this causes a very blurry blend, which is not natural for rocks blending with dirt. Try a value of 0.1 here, then render a &amp;quot;Window&amp;quot; preview to see how the blending looks.&lt;br /&gt;
* Remember to set the ''Distribution Pattern Texture Scale'' to the same value as the Diffuse Scale, 32 32.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Local'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
Again we want the normal-map which matches the diffuse texture for the rocks.&lt;br /&gt;
* In the ''File Name'' field of the '''Local''' section, browse to the matching normal map for your tiling rock texture.&lt;br /&gt;
** This example is using {{filename|textures/megagen/temperate/rock_01_local.tga}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Surface Type'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
* Find the ''Surface Type Properties'' section of the property list.&lt;br /&gt;
* In the '''Type''' field, enter ''stone''.&lt;br /&gt;
* Hit {{accelkey|enter}} to accept the surface type.&lt;br /&gt;
&lt;br /&gt;
Your rock textures should now produce correct &amp;quot;stone&amp;quot; effects when shot or collided with.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Preview again!'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
Now that the rocks are set up, you can hit the Render Preview ([[Image:simplemega_previewbutton.png|MegaTexture Render Preview button]]) button again and see what effect the new Rock node has.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Further tweaks ==&lt;br /&gt;
There are other simple changes that can be done in the Terrain Editor to make your MegaTexture look even better.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Node order'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
[[Image:simplemega_node_order.png|frame|Click and drag a node to change the order]]&lt;br /&gt;
You may notice, if you look carefully at the blends between the rock and grass nodes, that some areas of the MegaTexture appear to show the rock texture ''on top'' of the grass! This doesn't look very natural, and it's happening because of the node order.&lt;br /&gt;
&lt;br /&gt;
Since the Rock node is below the Grass node, it will always be rendered on top of the grass. However, there is an easy way to fix this! In the node list of the Terrain Editor, you can click and drag any node to move it above or below existing nodes.&lt;br /&gt;
&lt;br /&gt;
* {{accelbtn|LMB}}-drag the Rock node and move it up in the list until you see a black bar appear between the Dirt and Grass nodes, as shown on the right.&lt;br /&gt;
* Release {{accelbtn|LMB}} when you have positioned the node in the correct place.&lt;br /&gt;
* With the Rock node now positioned between the Dirt and Grass nodes, the grass will appear on top of the rocks as well as the dirt, which looks much more natural!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Color changes'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
Maybe your dirt texture is too bright? Or maybe your grass looks a little ''too'' green?&lt;br /&gt;
You can easily fix this from the Terrain Editor itself! No need to create a new image every time you want to tweak the color or brightness, you can set this up on a per-node basis.&lt;br /&gt;
&lt;br /&gt;
Let's say you want to make the dirt texture darker and a bit more red. Here's how you'd do it:&lt;br /&gt;
* Select your Dirt node.&lt;br /&gt;
* Look under the ''Color Properties'' area in the property list, and {{accelbtn|LMB}} on the '''Color''' swatch (next to where it says 1 1 1, which is white).&lt;br /&gt;
* A color wheel and brightness slider will pop up in a new window. You can use this to darken and tint your texture.&lt;br /&gt;
* Choose a darker brightness, and a color slightly towards red. I used '''RGB Values''' of 225, 220, 220.&lt;br /&gt;
* Hit ''OK'' to accept the color.&lt;br /&gt;
* Re-render your MegaTexture preview. You should notice that the dirt layer looks darker now!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Texture rotation'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
If you're building up a lot of layers of tiling textures, it can sometimes become obvious when a texture tiles in a particular direction. You may see repeating patterns extending into the distance when looking in particular directions, especially if all your nodes have the same orientation.&lt;br /&gt;
&lt;br /&gt;
An easy way to overcome this is to play with the ''Rotation'' value in the Texture Properties section of the Terrain Editor's property list.&lt;br /&gt;
For each node, you should also set the ''Distribution Pattern Texture Rotation'' to match the Rotation value if you want your distribution patterns to line up and work correctly.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Render the MegaTexture =&lt;br /&gt;
=== Save the Surface Tree ===&lt;br /&gt;
Once you're happy with how the preview looks in the editor, you should make sure that your final Surface Tree is saved. Either click the &amp;quot;Save and Unload&amp;quot; button in the Terrain Editor, or save the whole map.&lt;br /&gt;
&lt;br /&gt;
=== Compile Only Entities ===&lt;br /&gt;
At this stage, your MegaTexture material is still technically &amp;quot;broken&amp;quot;, since no ''.mega'' file exists yet. This means that if you try to compile the map, it'll take ages to process the terrain model, since it treats it as a regular model rather than the special case of terrain. Not only will this waste 5-10 minutes of your time, but it'll also produce a broken map.&lt;br /&gt;
&lt;br /&gt;
However, we need to compile the map in order to tell the [[renderLight]] process which atmosphere to use when lighting the MegaTexture!&lt;br /&gt;
&lt;br /&gt;
So the solution is to do an '''Only Entities''' compile. You can find this in the menu ''Compile -&amp;gt; 2 - Only Entities'' in editWorld. This should be done in a few seconds, and compiles all the information that renderLight needs.&lt;br /&gt;
&lt;br /&gt;
Bear in mind that this compile process will not produce a playable map, so you will have to do a full recompile once the MegaTexture is fully rendered.&lt;br /&gt;
&lt;br /&gt;
=== Run the SDK Launcher ===&lt;br /&gt;
Now that your ''.sft'' is saved, go through all the steps outlined in the [[Generate a MegaTexture]] tutorial.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= That's it! =&lt;br /&gt;
[[Image:simplemega_ingame.jpg|thumb|300px|The MegaTexture in-game!]]&lt;br /&gt;
You've now created your very own MegaTexture to use in your map!&lt;br /&gt;
&lt;br /&gt;
Before you even compile the map, you can get an accurate preview of how it will look in-game by pressing {{accelkey|F6}} to toggle &amp;quot;anim&amp;quot; mode while in editWorld's &amp;quot;RENDER&amp;quot; Camera view (toggled with {{accelkey|F3}}).&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
= Troubleshooting =&lt;br /&gt;
If your terrain model still shows as red even after you've compiled the MegaTexture, there are a couple of things you should check first:&lt;br /&gt;
* See if the console gives you any warnings about missing ''.stm'' files. If this is the case, you probably forgot to assign any Surface Types to your texture nodes. Double-check them and make sure it's all set up correctly.&lt;br /&gt;
* Make sure there aren't any spelling mistakes or typos in your ''.mtr'' material file. The 2nd part of the material should have exactly the same name as your map (the ''&amp;lt; &amp;quot;mapname&amp;quot; &amp;gt;'' part described in [[A Simple First Megatexture#Creating a MegaTexture material|this section]]), otherwise it will not be searching for the correct images.&lt;br /&gt;
* Make sure there aren't any spelling mistakes in your ''.rlt'' file (as described in [[RenderLight|this article]]). If any of the names are inconsistent, the Megatexture will not have been compiled fully.&lt;br /&gt;
&lt;br /&gt;
If your map compile is taking ages (ie. over 2-3 minutes for a 32,000 triangle terrain model) then it's probably because the MegaTexture material is broken. Double-check the issues listed above, and make sure you have run the {{consolecmd|reloaddecls}} console command if you changed any ''.mtr'' or ''.rlt'' files.&lt;br /&gt;
&lt;br /&gt;
If your ''.mega'' and ''.stm'' files definitely exist, in the right folders, try closing and re-opening the ''.world'' file in editWorld. This should load and display the MegaTexture properly.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= See Also =&lt;br /&gt;
* [[An Advanced Terrain and Megatexture]] - an advanced guide for complete MegaTexture creation&lt;br /&gt;
* [[Generate a MegaTexture]] - steps for generating a MegaTexture from the SDK launcher.&lt;br /&gt;
&lt;br /&gt;
[[Category:Art]]&lt;br /&gt;
[[Category:Basic Level Design]]&lt;br /&gt;
[[Category:Tutorials]]&lt;/div&gt;</summary>
		<author><name>MoP</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.splashdamage.com/index.php?title=Main_Page&amp;diff=4015</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://wiki.splashdamage.com/index.php?title=Main_Page&amp;diff=4015"/>
		<updated>2007-12-13T16:10:27Z</updated>

		<summary type="html">&lt;p&gt;MoP: /* Featured Content */ added simple mega tutorial link&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Welcome to the Splash Damage Editing Wiki. Here you'll find our official editing documentation for Enemy Territory: QUAKE Wars. For the latest Splash Damage news and announcements, please visit [http://www.splashdamage.com www.splashdamage.com]. The latest Enemy Territory: QUAKE Wars news along with the official forums can be found at [http://community.enemyterritory.com community.enemyterritory.com].&lt;br /&gt;
__NOTOC__&lt;br /&gt;
==Enemy Territory: QUAKE Wars==&lt;br /&gt;
{| width=&amp;quot;100%&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background-color: #322923; text-align: right;&amp;quot; | [[Image:Wiki_etqw.jpg]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Getting Started===&lt;br /&gt;
----&lt;br /&gt;
*'''[[Enemy Territory: QUAKE Wars|Index of Enemy Territory: QUAKE Wars Documentation and Tutorials]]'''&lt;br /&gt;
*'''[http://community.enemyterritory.com/index.php?q=node/210 Download the Enemy Territory: QUAKE Wars Software Development Kit]'''&lt;br /&gt;
*'''[http://community.enemyterritory.com/forums/forumdisplay.php?f=24 Enemy Territory: QUAKE Wars Editing Forum]&lt;br /&gt;
*[[Enemy Territory: QUAKE Wars SDK Frequently Asked Questions]]&lt;br /&gt;
*[http://community.enemyterritory.com/forums/showthread.php?t=18905 Enemy Territory: QUAKE Wars SDK Known Issues]&lt;br /&gt;
&lt;br /&gt;
===Featured Content===&lt;br /&gt;
----&lt;br /&gt;
*'''[[A Simple First Map]]''' - Learn how to set up the SDK Launcher, and then get started on mapping out a basic room!&lt;br /&gt;
&lt;br /&gt;
*'''[[A Simple First Terrain]]''' - Follow the steps in this tutorial to build a terrain model for use in your Enemy Territory: QUAKE Wars map!&lt;br /&gt;
&lt;br /&gt;
*'''[[A Simple First Megatexture]]''' - Already got a terrain model? Learn how to quickly apply a simple and natural-looking MegaTexture to your map!&lt;br /&gt;
&lt;br /&gt;
*'''[[Introduction and goals of the tutorial|An Advanced Map]]''' - Familiar with mapping? Learn how to set up more complex scripts and spawn points for an objective-based map!&lt;br /&gt;
&lt;br /&gt;
*'''[[How do I|How do I...?]]''' - Want to learn how to use the map editor more efficiently? Pick up tips and shortcuts in this quick reference guide.&lt;br /&gt;
&lt;br /&gt;
==Wolfenstein: Enemy Territory==&lt;br /&gt;
{| width=&amp;quot;100%&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background-color: #322923; text-align: right;&amp;quot; | [[Image:Wiki_wet.jpg]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Getting Started===&lt;br /&gt;
----&lt;br /&gt;
*'''[[Wolfenstein: Enemy Territory|Index of Wolfenstein: Enemy Territory Documentation and Tutorials]]'''&lt;br /&gt;
*'''[[Wolfenstein: Enemy Territory SDK|Download the Wolfenstein: Enemy Territory Software Development Kit]]'''&lt;/div&gt;</summary>
		<author><name>MoP</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.splashdamage.com/index.php?title=RenderLight&amp;diff=4014</id>
		<title>RenderLight</title>
		<link rel="alternate" type="text/html" href="https://wiki.splashdamage.com/index.php?title=RenderLight&amp;diff=4014"/>
		<updated>2007-12-13T16:08:20Z</updated>

		<summary type="html">&lt;p&gt;MoP: /* RenderLight Template */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;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.&amp;lt;includeonly&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{main|RenderLight}}&amp;lt;/includeonly&amp;gt;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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!&lt;br /&gt;
* The output files can be found in the base game folder, under {{filename|megatextures/&amp;lt;mapname&amp;gt;_lit_x_y.tga}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= RenderLight Template =&lt;br /&gt;
Before using RenderLight, you will need to create a ''.rlt'' template. You can find examples of these in {{filename|base/renderlight/}}.&lt;br /&gt;
&lt;br /&gt;
A RenderLight template looks like this:&lt;br /&gt;
 {&lt;br /&gt;
 	mesh		&amp;quot;models/terrain/&amp;lt;mapname&amp;gt;.lwo&amp;quot;&lt;br /&gt;
 	diffuse		&amp;quot;maps/&amp;lt;mapname&amp;gt;_d.tga&amp;quot;&lt;br /&gt;
 	bump		&amp;quot;maps/&amp;lt;mapname&amp;gt;_local.tga&amp;quot;&lt;br /&gt;
 	out		&amp;quot;megatextures/&amp;lt;mapname&amp;gt;_lit.tga&amp;quot;&lt;br /&gt;
 	map 		&amp;quot;maps/&amp;lt;mapname&amp;gt;.entities&amp;quot;&lt;br /&gt;
 	atmosphere	&amp;quot;&amp;lt;atmosphere name&amp;gt;&amp;quot;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
* '''mesh''' - this should point to the relative path of your terrain model.&lt;br /&gt;
** 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 ''&amp;quot;&amp;lt;mapname&amp;gt;_renderlight&amp;quot;'' 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 ''&amp;quot;_renderlight&amp;quot;'' version is not necessary.&lt;br /&gt;
* '''diffuse''' - this is the path to the output diffuse texture tiles from the previous [[MegaGen]] stage.&lt;br /&gt;
* '''bump''' - this is the path to the output local normal-map texture tiles from the previous [[MegaGen]] stage.&lt;br /&gt;
* '''out''' - this is where RenderLight will output the lit texture tiles.&lt;br /&gt;
* '''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.&lt;br /&gt;
** An ''Only Entities'' compile is sufficient for this to work, and much faster than a full compile.&lt;br /&gt;
* '''atmosphere''' - the name of the atmosphere you want to take lighting information from (for example ''slipgate_desert01'').&lt;br /&gt;
** 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.&lt;br /&gt;
&lt;br /&gt;
= MegaBuild Options =&lt;br /&gt;
*Bake lighting - adds in the sunlight contribution to the output&lt;br /&gt;
** same as '''-preMulLighting''' on the command line&lt;br /&gt;
*Bake ambient - adds in the ambient light color to the output&lt;br /&gt;
** same as '''-preMulAmbient''' on the command line&lt;br /&gt;
&lt;br /&gt;
[[Category:Art]]&lt;br /&gt;
[[Category:Level Design]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>MoP</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.splashdamage.com/index.php?title=A_Simple_First_Megatexture&amp;diff=4013</id>
		<title>A Simple First Megatexture</title>
		<link rel="alternate" type="text/html" href="https://wiki.splashdamage.com/index.php?title=A_Simple_First_Megatexture&amp;diff=4013"/>
		<updated>2007-12-13T16:06:50Z</updated>

		<summary type="html">&lt;p&gt;MoP: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Image:simplemega_ingame.jpg|right|thumb|500px|A simple MegaTexture, easily created with only 3 texture layers!]]&lt;br /&gt;
So now that you've made [[A Simple First Terrain]], no doubt you'll want to apply a MegaTexture to it! This MegaTexture won't be as detailed or as attractive as an advanced MegaTexture, but will demonstrate the basics of creating a [[Surface Tree]], assigning textures, and compiling it all into a working MegaTexture file.&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
'''For this tutorial you must:'''&lt;br /&gt;
* Have a terrain model UV-mapped in the 0-1 range (covered in the simple first terrain tutorial)&lt;br /&gt;
* Have access to some tiling textures.&lt;br /&gt;
* Have a little understanding the ETQW material system&lt;br /&gt;
&lt;br /&gt;
If you don't have any of the above things, you are not ready to do this tutorial!&lt;br /&gt;
&lt;br /&gt;
'''This tutorial covers:'''&lt;br /&gt;
* How to set up a MegaTexture material&lt;br /&gt;
* How to create a Surface Tree&lt;br /&gt;
* How to add texture nodes in the Terrain Editor&lt;br /&gt;
* How to render and compile a full MegaTexture&lt;br /&gt;
&lt;br /&gt;
'''This tutorial does not cover:'''&lt;br /&gt;
* How to use Blender/Maya/Lightwave/ZBrush/Mudbox/3DSMax/Photoshop&lt;br /&gt;
* How to create tiling textures or heightmaps&lt;br /&gt;
* Anything overly complicated&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Creating a MegaTexture material =&lt;br /&gt;
Firstly you need to create a new material for your terrain to use. If you have never made a new material before, read the article on [[Adding Custom Textures]]. All you need to do is create (or use an existing) ''.mtr'' file and place a material declaration in it, in the manner shown here:&lt;br /&gt;
 material megatextures/mapname		{ useTemplate megatextures/default_ambient&amp;lt; &amp;quot;mapname&amp;quot; &amp;gt; }&lt;br /&gt;
&lt;br /&gt;
This material would automatically search for a MegaTexture called {{filename|mapname.mega}} in the {{filename|/megatextures/}} folder. This example material uses the ''&amp;quot;default_ambient&amp;quot;'' template, which expects a 3-channel RGB MegaTexture. These are generated by the default settings of the [[Generate a MegaTexture|MegaTexture tab in the SDK Launcher]].&lt;br /&gt;
&lt;br /&gt;
Obviously you would want to use the actual name of your map instead of &amp;quot;mapname&amp;quot;, for consistency's sake and ease of reference.&lt;br /&gt;
&lt;br /&gt;
Remember that if you made a new ''.mtr'' file after the game or editor was started, you'll have to restart the whole game and editor before it will read your new file.&lt;br /&gt;
&lt;br /&gt;
=== Assigning the material ===&lt;br /&gt;
You should assign the material you just created by naming a material in your 3D application and applying it to your terrain mesh, then export the model to your preferred format (LWO, ASE or OBJ).&lt;br /&gt;
Tips on this process can be found in the [[A Simple First Terrain|simple first terrain tutorial]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Creating the Surface Tree =&lt;br /&gt;
As described in the Simple First Terrain tutorial, terrain models are set up in the Terrain Editor, accessible via {{accelkey|shift}}{{accelkey|N}} in [[editWorld]]. This tool creates a Surface Tree file ({{filename|.sft}}) that contains all the information about the terrain, including roads, stamps, and detail texture information that MegaGen needs to generate a MegaTexture. The Surface Tree will be saved every time the map is saved, or any time you press the &amp;quot;Save and Unload&amp;quot; button in the Terrain Editor.&lt;br /&gt;
[[Image:simplemega_terrainmodel.png|thumb|300px|Root node set up to use the correct terrain mesh]]&lt;br /&gt;
&lt;br /&gt;
=== Add the terrain mesh ===&lt;br /&gt;
Here's how you bring the terrain mesh into the surface tree:&lt;br /&gt;
* {{accelbtn|RMB}} on the left-hand pane, and choose ''New -&amp;gt; Tree'' via the menu.&lt;br /&gt;
** If you already have a Root node, click the &amp;quot;Begin Editing&amp;quot; button instead.&lt;br /&gt;
* Click on the Root node, and set {{keyname|Model}} to the name of the terrain mesh, in this case {{keyvalue|models/terrain/simpleterrain.obj}}.&lt;br /&gt;
* Press {{accelkey|enter}} to confirm the selection, and the terrain should appear in the 3D view.&lt;br /&gt;
&lt;br /&gt;
Be aware that your terrain model will probably appear bright orange or red.&lt;br /&gt;
The console will probably give you a few WARNING messages, don't worry about these for now, this is because your Megatexture doesn't exist yet!&lt;br /&gt;
&lt;br /&gt;
=== Important note about nodes ===&lt;br /&gt;
When you are editing properties of nodes (names, numbers, texture sources etc.) always remember to hit {{accelkey|enter}} after changing a value, to make sure that the value is stored. If you just type something in and then click somewhere else without pressing {{accelkey|enter}}, your changes may not be applied.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Create the first texture node ==&lt;br /&gt;
[[Image:simplemega_firstnode_diffuse.png|thumb|300px|The first texture node's diffuse texture properties]]&lt;br /&gt;
Now that the model is in place, you can start laying down the texture layers (or &amp;quot;nodes&amp;quot;) that will make up your MegaTexture.&lt;br /&gt;
&lt;br /&gt;
First you need to create a new Image Source node in the Terrain Editor.&lt;br /&gt;
* {{accelbtn|RMB}} on your &amp;quot;Root&amp;quot; node and choose ''New -&amp;gt; Image Source'' (or press {{accelkey|shift}}{{accelkey|i}})&lt;br /&gt;
* This will make a new node called &amp;quot;New Image Renderer&amp;quot;. You can rename this using the &amp;quot;Name&amp;quot; property field in the '''Object''' section.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You will notice in the top right of the Terrain Editor, a section listing things like &amp;quot;Diffuse&amp;quot;, &amp;quot;Distribution&amp;quot;, &amp;quot;Distribution Pattern&amp;quot; etc. Selecting one of these will list all of the properties for that section of the current node.&lt;br /&gt;
The ones we need to worry about are as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Diffuse'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
This is the colour map of the current node, and it should point to a tiling TGA texture.&lt;br /&gt;
* Make sure the Diffuse section is highlighted in the top right of the Terrain Editor.&lt;br /&gt;
* In the ''File Name'' field of the '''Image Properties''' section, browse to a generic tiling dirt texture. Remember to hit {{accelkey|enter}} afterwards!&lt;br /&gt;
** This example is using {{filename|textures/megagen/temperate/dirt_02_d.tga}}&lt;br /&gt;
* The ''Scale'' field at the very bottom of the property list allows you to choose how much to tile the texture.&lt;br /&gt;
** The default value is 1 1, but you don't want that since it will stretch your texture over the whole mesh, and look really blurry!&lt;br /&gt;
** Instead set the Scale to something like 48 48, this means that the texture will be repeated 48 times across each axis of the terrain. This results in a sharper final output.&lt;br /&gt;
That's all you need to do for the Diffuse settings in this node.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Distribution'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
This is how we control where the layer is drawn (ie. no grass underwater, no sand on angles over 60 degrees etc). It's basically a big mask where ''white = fully shown'' and ''black = fully hidden''.&lt;br /&gt;
* Make sure the Distribution section is highlighted in the top right.&lt;br /&gt;
* Since this is our first node, we want to show over the whole terrain. This means the distribution map should be 100% white.&lt;br /&gt;
* You can either assign a pure white TGA texture, or change the ''Source Type'' to ''geometryBased''.&lt;br /&gt;
** ''geometryBased'' will by default create a fully white map, so if you don't have a white TGA handy, this is faster.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Distribution Pattern'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
This controls how the current node blends into others. Usually this will be set to a tiling TGA heightmap texture that matches the Diffuse texture.&lt;br /&gt;
* We don't need a Distribution Pattern for the first node, since it doesn't blend with anything. Nodes on top of this one will need Distribution Patterns for more interesting and natural blends though!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Local'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
This is the normal-map of the current node. This should be a tiling TGA texture representing the local normal information of the matching Diffuse texture.&lt;br /&gt;
* Make sure the Local section is highlighted in the top right.&lt;br /&gt;
* In the ''File Name'' field of the '''Image Properties''' section, browse to the matching normal map for your tiling dirt texture.&lt;br /&gt;
** This example is using {{filename|textures/megagen/temperate/dirt_02_local.tga}}&lt;br /&gt;
* The Local texture's tiling amount is automatically the same as the Diffuse texture.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Surface Type'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
Your image nodes should all specify a surface type, so that when players walk over or shoot the surface, it gives the correct sound and particle effects.&lt;br /&gt;
* Find the ''Surface Type Properties'' section of the property list.&lt;br /&gt;
* In the '''Type''' field, enter ''dirt''. It should drop down a list of valid surface types as soon as you hit the first letter.&lt;br /&gt;
* Hit {{accelkey|enter}} to accept the surface type.&lt;br /&gt;
&lt;br /&gt;
Your dirt textures will now produce correct &amp;quot;dirt&amp;quot; effects when shot or collided with!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Previewing the result'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
[[Image:simplemega_firstnode_preview.jpg|thumb|300px|The Render mode preview of the first node]]&lt;br /&gt;
Now we can easily check if this is all set up correctly. You should notice a little icon at the top left of your Terrain Editor which looks like this: [[Image:simplemega_previewbutton.png|MegaTexture Render Preview button]]&lt;br /&gt;
&lt;br /&gt;
* Notice the drop-down arrow on the right of the button. Click it, and select ''&amp;quot;Full&amp;quot;'' instead of ''&amp;quot;None&amp;quot;''.&lt;br /&gt;
* Your terrain should change colour to black. This means it's ready for a preview to be rendered onto it.&lt;br /&gt;
* Click the button itself now, instead of the drop-down. An &amp;quot;Active Tasks&amp;quot; window should pop up, and when it's done, you should see your dirt texture appear on your terrain model.&lt;br /&gt;
* You can switch the camera to Render mode too, which will show your terrain model's shading better.&lt;br /&gt;
* If you want a full-resolution preview of a small area, choose ''&amp;quot;Window&amp;quot;'' instead of ''&amp;quot;Full&amp;quot;'' from the drop-down menu.&lt;br /&gt;
** This creates a small window that you can move around using {{accelbtn|LMB}}-drag in the XY Top view. Simply position the window where you want to preview the full-resolution MegaTexture, and hit the Render Preview button.&lt;br /&gt;
&lt;br /&gt;
Now any time you add new nodes, or change a node's properties, you can just click the Render Preview button and the view will update with your changes.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Adding a second node ==&lt;br /&gt;
Now that the first layer of dirt is in place, we can try putting some grass on top of it!&lt;br /&gt;
* Again, {{accelbtn|RMB}} on your &amp;quot;Root&amp;quot; node and choose ''New -&amp;gt; Image Source'' (or press {{accelkey|shift}}{{accelkey|i}})&lt;br /&gt;
* This will make another new node below your &amp;quot;Dirt&amp;quot; node. &lt;br /&gt;
* Name this new node &amp;quot;Grass&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Surface Tree hierarchy is rendered from the top down, so nodes ''above'' other nodes in the hierarchy will be rendered ''before'' the other nodes. So currently it'll be rendering our Dirt node, and then rendering the Grass node on top of the dirt.&lt;br /&gt;
&lt;br /&gt;
Again, the main map types need to be specified before the node can be rendered:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Diffuse'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
* Make sure the Diffuse section is highlighted in the top right of the Terrain Editor.&lt;br /&gt;
* In the ''File Name'' field of the '''Image Properties''' section, browse to a generic tiling grass texture.&lt;br /&gt;
** This example is using {{filename|textures/megagen/temperate/grass_04_d.tga}}&lt;br /&gt;
* Again you will want to set the ''Scale'' value to something other than 1 1, to tile your texture. Let's use 32 32 for this one.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Distribution'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
This is important now, since we need to control where this layer is visible. Pure white won't work, since that'll just completely cover our underlying Dirt node!&lt;br /&gt;
* Make sure the Distribution section is highlighted in the top right.&lt;br /&gt;
* Change the &amp;quot;Source Type&amp;quot; from ''texture'' to ''geometryBased''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Geometric Texture Distribution'''&lt;br /&gt;
----&lt;br /&gt;
[[Image:simplemega_geometric_distribution.png|thumb|300px|The geometric texture distribution settings of the second node]]&lt;br /&gt;
This is where it gets interesting! There are many settings to alter, and they can have a drastic effect on how different your terrain looks, so try playing around with different values if you're not happy with the initial results.&lt;br /&gt;
&lt;br /&gt;
* '''Altitude Lower''' - Enabling this will limit the lower parts of the terrain from receiving this node's textures.&lt;br /&gt;
** '''Altitude Lower Value''' - The Z height in world units that the node will be drawn above. The default of 0 means that any parts of your terrain mesh below Z=0 will not show any of this node's textures.&lt;br /&gt;
** '''Fuzziness''' - The amount of blur applied to the mask. The higher the value, the more blurry the boundary.&lt;br /&gt;
* '''Altitude Upper''' - Enabling this will limit the higher parts of the terrain from receiving this node's textures.&lt;br /&gt;
** '''Altitude Upper Value''' - The Z height in world units that the node will be drawn below. The default of 0 means that any parts of your terrain mesh above Z=0 will not show any of this node's textures.&lt;br /&gt;
** '''Fuzziness''' - The amount of blur applied to the mask. The higher the value, the more blurry the boundary.&lt;br /&gt;
&lt;br /&gt;
* '''Clamp Distribution To Edge''' - Leave this on Default.&lt;br /&gt;
&lt;br /&gt;
* '''Resolution''' - The size in pixels of the resulting mask. The default value of 256 is fine for nearly any terrain model.&lt;br /&gt;
&lt;br /&gt;
* '''Slope Lower''' - Enabling this will limit shallower angles of the terrain model from receiving this node's textures.&lt;br /&gt;
** '''Slope Lower Value''' - The angle in degrees that the node will be drawn past. The default angle of 0 will result in no change to your mask.&lt;br /&gt;
** '''Fuzziness''' - The amount of blur applied to the mask. The higher the value, the more blurry the boundary.&lt;br /&gt;
* '''Slope Upper''' - Enabling this will limit the steeper angles of the terrain model from receiving this node's textures. This is great for masking out cliffs from your nodes.&lt;br /&gt;
** '''Slope Upper Value''' - The angle in degrees that the node will be hidden past. The default angle of 0 will result in a fully black mask.&lt;br /&gt;
** '''Fuzziness''' - The amount of blur applied to the mask. The higher the value, the more blurry the boundary.&lt;br /&gt;
&lt;br /&gt;
The settings you use for each of these will vary depending on your terrain model, and the type of node you're making. For our Grass node, you can see the settings used for this example in the screenshot above on the right.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Distribution Pattern'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
[[Image:simplemega_dist_ramps.jpg|thumb|300px|The difference between using or not using a Distribution Pattern, and varying Ramp Widths]]&lt;br /&gt;
This controls how the the grass will blend into the dirt. If you don't have a Distribution Pattern texture, the grass will just slowly fade into the dirt, which doesn't look very natural!&lt;br /&gt;
So what we want here is a texture to identify the &amp;quot;height&amp;quot; of the areas of grass. This means that the dirt can blend in based on the height of each clump of grass, so instead of a smooth fade you will get a more natural blend between the grass and the dirt.&lt;br /&gt;
&lt;br /&gt;
If you examine the screenshot to the right, you can see what effect a good Distribution Pattern can have - when the node is rendered with no Distribution Pattern, the blend between the nodes is a simple smooth gradient, which does not look very natural at all. You can also see the difference that the '''Ramp Width''' value makes - this is a very powerful value, so experiment with it until you really understand the effect it has!&lt;br /&gt;
&lt;br /&gt;
* Make sure the Distribution Pattern section is highlighted in the top right.&lt;br /&gt;
* In the ''File Name'' field of the '''Image Properties''' section, browse to the matching heightmap or mask for your tiling grass texture.&lt;br /&gt;
** This example is using {{filename|textures/megagen/temperate/grass_04_mask.tga}}&lt;br /&gt;
* The ''Ramp Width'' should be set to a value lower than the default of 1, since this causes a very blurry blend, which is usually not what you want. Try a value of 0.25 and re-render the preview - try a &amp;quot;Window&amp;quot; preview as described earlier to get a full-resolution preview where you can really see the blend working.&lt;br /&gt;
* '''Important!''' You will also need to set the ''Distribution Pattern Texture Scale'' to the same value as the Diffuse Scale, in this case we just use 32 32 again.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Local'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
Again we want the normal-map which matches the diffuse texture for the grass.&lt;br /&gt;
* Make sure the Local section is highlighted in the top right.&lt;br /&gt;
* In the ''File Name'' field of the '''Image Properties''' section, browse to the matching normal map for your tiling grass texture.&lt;br /&gt;
** This example is using {{filename|textures/megagen/temperate/grass_04_local.tga}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Surface Type'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
Again, you need to specify a surface type, so that when players walk over or shoot the surface, it gives the correct sound and particle effects.&lt;br /&gt;
* Find the ''Surface Type Properties'' section of the property list.&lt;br /&gt;
* In the '''Type''' field, enter ''grass''. It should drop down a list of valid surface types as soon as you hit the first letter.&lt;br /&gt;
* Hit {{accelkey|enter}} to accept the surface type.&lt;br /&gt;
&lt;br /&gt;
Your grass textures should now produce correct &amp;quot;grass&amp;quot; effects when shot or collided with!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Preview again!'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
[[Image:simplemega_secondnode_preview.jpg|thumb|300px|The Render mode preview of the second node blended with the first node]]&lt;br /&gt;
Now that's all set up, you can hit the Render Preview ([[Image:simplemega_previewbutton.png|MegaTexture Render Preview button]]) button again and see what effect the new Grass node has.&lt;br /&gt;
If it's being distributed into the wrong places, you can go back into your Distribution settings and tweak the values for the ''geometryBased'' settings. Then you can preview again until it looks right.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Adding a third node ==&lt;br /&gt;
[[Image:simplemega_thirdnode_preview.jpg|thumb|300px|The Render mode preview of the third node blended with the other two nodes]]&lt;br /&gt;
Now that the grass and dirt are in place, we need some rocks to make the terrain look more natural.&lt;br /&gt;
* Again, {{accelbtn|RMB}} on your &amp;quot;Root&amp;quot; node and choose ''New -&amp;gt; Image Source'' (or press {{accelkey|shift}}{{accelkey|i}})&lt;br /&gt;
* This will make another new node below your &amp;quot;Grass&amp;quot; node. &lt;br /&gt;
* Name this new node &amp;quot;Rock&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Again, the main map types need to be specified before the node can be rendered:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Diffuse'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
* In the ''File Name'' field of the '''Diffuse''' section, browse to a generic tiling rock texture.&lt;br /&gt;
** This example is using {{filename|textures/megagen/temperate/rock_01_d.tga}}&lt;br /&gt;
* Set the ''Scale'' value to 32 32.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Distribution'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
Again we can use Geometric Texture Distribution to easily apply the rock textures only to the cliff-like angles.&lt;br /&gt;
* Make sure the Distribution section is highlighted in the top right.&lt;br /&gt;
* Change the &amp;quot;Source Type&amp;quot; from ''texture'' to ''geometryBased''.&lt;br /&gt;
* To make the rock texture only appear on near vertical surfaces, set the ''Slope Lower Value'' to 23, and the ''Fuzziness'' of Slope Lower to 0.05&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Distribution Pattern'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
Again this will control how the the rocks blend into the other nodes. Again, we want a texture to identify the &amp;quot;height&amp;quot; of the tiling rock texture.&lt;br /&gt;
&lt;br /&gt;
* Make sure the Distribution Pattern section is highlighted in the top right.&lt;br /&gt;
* In the ''File Name'' field of the '''Image Properties''' section, browse to the matching heightmap or mask for your tiling rock texture.&lt;br /&gt;
** This example is using {{filename|textures/megagen/temperate/rock_01_h.tga}}&lt;br /&gt;
* The ''Ramp Width'' should be set to a value much lower than the default of 1, since this causes a very blurry blend, which is not natural for rocks blending with dirt. Try a value of 0.1 here, then render a &amp;quot;Window&amp;quot; preview to see how the blending looks.&lt;br /&gt;
* Remember to set the ''Distribution Pattern Texture Scale'' to the same value as the Diffuse Scale, 32 32.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Local'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
Again we want the normal-map which matches the diffuse texture for the rocks.&lt;br /&gt;
* In the ''File Name'' field of the '''Local''' section, browse to the matching normal map for your tiling rock texture.&lt;br /&gt;
** This example is using {{filename|textures/megagen/temperate/rock_01_local.tga}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Surface Type'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
* Find the ''Surface Type Properties'' section of the property list.&lt;br /&gt;
* In the '''Type''' field, enter ''stone''.&lt;br /&gt;
* Hit {{accelkey|enter}} to accept the surface type.&lt;br /&gt;
&lt;br /&gt;
Your rock textures should now produce correct &amp;quot;stone&amp;quot; effects when shot or collided with.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Preview again!'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
Now that the rocks are set up, you can hit the Render Preview ([[Image:simplemega_previewbutton.png|MegaTexture Render Preview button]]) button again and see what effect the new Rock node has.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Further tweaks ==&lt;br /&gt;
There are other simple changes that can be done in the Terrain Editor to make your MegaTexture look even better.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Node order'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
[[Image:simplemega_node_order.png|frame|Click and drag a node to change the order]]&lt;br /&gt;
You may notice, if you look carefully at the blends between the rock and grass nodes, that some areas of the MegaTexture appear to show the rock texture ''on top'' of the grass! This doesn't look very natural, and it's happening because of the node order.&lt;br /&gt;
&lt;br /&gt;
Since the Rock node is below the Grass node, it will always be rendered on top of the grass. However, there is an easy way to fix this! In the node list of the Terrain Editor, you can click and drag any node to move it above or below existing nodes.&lt;br /&gt;
&lt;br /&gt;
* {{accelbtn|LMB}}-drag the Rock node and move it up in the list until you see a black bar appear between the Dirt and Grass nodes, as shown on the right.&lt;br /&gt;
* Release {{accelbtn|LMB}} when you have positioned the node in the correct place.&lt;br /&gt;
* With the Rock node now positioned between the Dirt and Grass nodes, the grass will appear on top of the rocks as well as the dirt, which looks much more natural!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Color changes'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
Maybe your dirt texture is too bright? Or maybe your grass looks a little ''too'' green?&lt;br /&gt;
You can easily fix this from the Terrain Editor itself! No need to create a new image every time you want to tweak the color or brightness, you can set this up on a per-node basis.&lt;br /&gt;
&lt;br /&gt;
Let's say you want to make the dirt texture darker and a bit more red. Here's how you'd do it:&lt;br /&gt;
* Select your Dirt node.&lt;br /&gt;
* Look under the ''Color Properties'' area in the property list, and {{accelbtn|LMB}} on the '''Color''' swatch (next to where it says 1 1 1, which is white).&lt;br /&gt;
* A color wheel and brightness slider will pop up in a new window. You can use this to darken and tint your texture.&lt;br /&gt;
* Choose a darker brightness, and a color slightly towards red. I used '''RGB Values''' of 225, 220, 220.&lt;br /&gt;
* Hit ''OK'' to accept the color.&lt;br /&gt;
* Re-render your MegaTexture preview. You should notice that the dirt layer looks darker now!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Texture rotation'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
If you're building up a lot of layers of tiling textures, it can sometimes become obvious when a texture tiles in a particular direction. You may see repeating patterns extending into the distance when looking in particular directions, especially if all your nodes have the same orientation.&lt;br /&gt;
&lt;br /&gt;
An easy way to overcome this is to play with the ''Rotation'' value in the Texture Properties section of the Terrain Editor's property list.&lt;br /&gt;
For each node, you should also set the ''Distribution Pattern Texture Rotation'' to match the Rotation value if you want your distribution patterns to line up and work correctly.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Render the MegaTexture =&lt;br /&gt;
=== Save the Surface Tree ===&lt;br /&gt;
Once you're happy with how the preview looks in the editor, you should make sure that your final Surface Tree is saved. Either click the &amp;quot;Save and Unload&amp;quot; button in the Terrain Editor, or save the whole map.&lt;br /&gt;
&lt;br /&gt;
=== Compile Only Entities ===&lt;br /&gt;
At this stage, your MegaTexture material is still technically &amp;quot;broken&amp;quot;, since no ''.mega'' file exists yet. This means that if you try to compile the map, it'll take ages to process the terrain model, since it treats it as a regular model rather than the special case of terrain. Not only will this waste 5-10 minutes of your time, but it'll also produce a broken map.&lt;br /&gt;
&lt;br /&gt;
However, we need to compile the map in order to tell the [[renderLight]] process which atmosphere to use when lighting the MegaTexture!&lt;br /&gt;
&lt;br /&gt;
So the solution is to do an '''Only Entities''' compile. You can find this in the menu ''Compile -&amp;gt; 2 - Only Entities'' in editWorld. This should be done in a few seconds, and compiles all the information that renderLight needs.&lt;br /&gt;
&lt;br /&gt;
Bear in mind that this compile process will not produce a playable map, so you will have to do a full recompile once the MegaTexture is fully rendered.&lt;br /&gt;
&lt;br /&gt;
=== Run the SDK Launcher ===&lt;br /&gt;
Now that your ''.sft'' is saved, go through all the steps outlined in the [[Generate a MegaTexture]] tutorial.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= That's it! =&lt;br /&gt;
[[Image:simplemega_ingame.jpg|thumb|300px|The MegaTexture in-game!]]&lt;br /&gt;
You've now created your very own MegaTexture to use in your map!&lt;br /&gt;
&lt;br /&gt;
Before you even compile the map, you can get an accurate preview of how it will look in-game by pressing {{accelkey|F6}} to toggle &amp;quot;anim&amp;quot; mode while in editWorld's &amp;quot;RENDER&amp;quot; Camera view (toggled with {{accelkey|F3}}).&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
= Troubleshooting =&lt;br /&gt;
If your terrain model still shows as red even after you've compiled the MegaTexture, there are a couple of things you should check first:&lt;br /&gt;
* See if the console gives you any warnings about missing ''.stm'' files. If this is the case, you probably forgot to assign any Surface Types to your texture nodes. Double-check them and make sure it's all set up correctly.&lt;br /&gt;
* Make sure there aren't any spelling mistakes or typos in your ''.mtr'' material file. The 2nd part of the material should have exactly the same name as your map (the ''&amp;lt; &amp;quot;mapname&amp;quot; &amp;gt;'' part described in [[A Simple First Megatexture#Creating a MegaTexture material|this section]]), otherwise it will not be searching for the correct images.&lt;br /&gt;
* Make sure there aren't any spelling mistakes in your ''.rlt'' file (as described in [[RenderLight|this article]]). If any of the names are inconsistent, the Megatexture will not have been compiled fully.&lt;br /&gt;
&lt;br /&gt;
If your map compile is taking ages (ie. over 2-3 minutes for a 32,000 triangle terrain model) then it's probably because the MegaTexture material is broken. Double-check the issues listed above, and make sure you have run the {{consolecmd|reloaddecls}} console command if you changed any ''.mtr'' or ''.rlt'' files.&lt;br /&gt;
&lt;br /&gt;
If your ''.mega'' and ''.stm'' files definitely exist, in the right folders, try closing and re-opening the ''.world'' file in editWorld. This should load and display the MegaTexture properly.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= See Also =&lt;br /&gt;
* [[An Advanced Terrain and Megatexture]] - an advanced guide for complete MegaTexture creation&lt;br /&gt;
* [[Generate a MegaTexture]] - steps for generating a MegaTexture from the SDK launcher.&lt;br /&gt;
&lt;br /&gt;
[[Category:Art]]&lt;br /&gt;
[[Category:Basic Level Design]]&lt;br /&gt;
[[Category:Tutorials]]&lt;/div&gt;</summary>
		<author><name>MoP</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.splashdamage.com/index.php?title=File:Simplemega_ingame.jpg&amp;diff=4012</id>
		<title>File:Simplemega ingame.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.splashdamage.com/index.php?title=File:Simplemega_ingame.jpg&amp;diff=4012"/>
		<updated>2007-12-13T15:42:44Z</updated>

		<summary type="html">&lt;p&gt;MoP: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>MoP</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.splashdamage.com/index.php?title=A_Simple_First_Megatexture&amp;diff=4011</id>
		<title>A Simple First Megatexture</title>
		<link rel="alternate" type="text/html" href="https://wiki.splashdamage.com/index.php?title=A_Simple_First_Megatexture&amp;diff=4011"/>
		<updated>2007-12-12T19:56:57Z</updated>

		<summary type="html">&lt;p&gt;MoP: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;So now that you've made [[A Simple First Terrain]], no doubt you'll want to apply a MegaTexture to it! This MegaTexture won't be as detailed or as attractive as an advanced MegaTexture, but will demonstrate the basics of creating a [[Surface Tree]], assigning textures, and compiling it all into a working MegaTexture file.&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
'''For this tutorial you must:'''&lt;br /&gt;
* Have a terrain model UV-mapped in the 0-1 range (covered in the simple first terrain tutorial)&lt;br /&gt;
* Have access to some tiling textures. TODO: Link to MegaTexture media!&lt;br /&gt;
* Have a little understanding the ETQW material system&lt;br /&gt;
&lt;br /&gt;
If you don't have any of the above things, you are not ready to do this tutorial!&lt;br /&gt;
&lt;br /&gt;
'''This tutorial covers:'''&lt;br /&gt;
* How to set up a MegaTexture material&lt;br /&gt;
* How to create a Surface Tree&lt;br /&gt;
* How to add texture nodes in the Terrain Editor&lt;br /&gt;
* How to render and compile a full MegaTexture&lt;br /&gt;
&lt;br /&gt;
'''This tutorial does not cover:'''&lt;br /&gt;
* How to use Blender/Maya/Lightwave/ZBrush/Mudbox/3DSMax/Photoshop&lt;br /&gt;
* How to create tiling textures or heightmaps&lt;br /&gt;
* Anything overly complicated&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Creating a MegaTexture material =&lt;br /&gt;
Firstly you need to create a new material for your terrain to use. If you have never made a new material before, read the article on [[Adding Custom Textures]]. All you need to do is create (or use an existing) ''.mtr'' file and place a material declaration in it, in the manner shown here:&lt;br /&gt;
 material megatextures/mapname		{ useTemplate megatextures/default_ambient&amp;lt; &amp;quot;mapname&amp;quot; &amp;gt; }&lt;br /&gt;
&lt;br /&gt;
This material would automatically search for a MegaTexture called {{filename|mapname.mega}} in the {{filename|/megatextures/}} folder. This example material uses the ''&amp;quot;default_ambient&amp;quot;'' template, which expects a 3-channel RGB MegaTexture. These are generated by the default settings of the [[Generate a MegaTexture|MegaTexture tab in the SDK Launcher]].&lt;br /&gt;
&lt;br /&gt;
Obviously you would want to use the actual name of your map instead of &amp;quot;mapname&amp;quot;, for consistency's sake and ease of reference.&lt;br /&gt;
&lt;br /&gt;
Remember that if you made a new ''.mtr'' file after the game or editor was started, you'll have to restart the whole game and editor before it will read your new file.&lt;br /&gt;
&lt;br /&gt;
=== Assigning the material ===&lt;br /&gt;
You should assign the material you just created by naming a material in your 3D application and applying it to your terrain mesh, then export the model to your preferred format (LWO, ASE or OBJ).&lt;br /&gt;
Tips on this process can be found in the [[A Simple First Terrain|simple first terrain tutorial]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Creating the Surface Tree =&lt;br /&gt;
As described in the Simple First Terrain tutorial, terrain models are set up in the Terrain Editor, accessible via {{accelkey|shift}}{{accelkey|N}} in [[editWorld]]. This tool creates a Surface Tree file ({{filename|.sft}}) that contains all the information about the terrain, including roads, stamps, and detail texture information that MegaGen needs to generate a MegaTexture. The Surface Tree will be saved every time the map is saved, or any time you press the &amp;quot;Save and Unload&amp;quot; button in the Terrain Editor.&lt;br /&gt;
[[Image:simplemega_terrainmodel.png|thumb|300px|Root node set up to use the correct terrain mesh]]&lt;br /&gt;
&lt;br /&gt;
=== Add the terrain mesh ===&lt;br /&gt;
Here's how you bring the terrain mesh into the surface tree:&lt;br /&gt;
* {{accelbtn|RMB}} on the left-hand pane, and choose ''New -&amp;gt; Tree'' via the menu.&lt;br /&gt;
** If you already have a Root node, click the &amp;quot;Begin Editing&amp;quot; button instead.&lt;br /&gt;
* Click on the Root node, and set {{keyname|Model}} to the name of the terrain mesh, in this case {{keyvalue|models/terrain/simpleterrain.obj}}.&lt;br /&gt;
* Press {{accelkey|enter}} to confirm the selection, and the terrain should appear in the 3D view.&lt;br /&gt;
&lt;br /&gt;
Be aware that your terrain model will probably appear bright orange or red.&lt;br /&gt;
The console will probably give you a few WARNING messages, don't worry about these for now, this is because your Megatexture doesn't exist yet!&lt;br /&gt;
&lt;br /&gt;
=== Important note about nodes ===&lt;br /&gt;
When you are editing properties of nodes (names, numbers, texture sources etc.) always remember to hit {{accelkey|enter}} after changing a value, to make sure that the value is stored. If you just type something in and then click somewhere else without pressing {{accelkey|enter}}, your changes may not be applied.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Create the first texture node ==&lt;br /&gt;
[[Image:simplemega_firstnode_diffuse.png|thumb|300px|The first texture node's diffuse texture properties]]&lt;br /&gt;
Now that the model is in place, you can start laying down the texture layers (or &amp;quot;nodes&amp;quot;) that will make up your MegaTexture.&lt;br /&gt;
&lt;br /&gt;
First you need to create a new Image Source node in the Terrain Editor.&lt;br /&gt;
* {{accelbtn|RMB}} on your &amp;quot;Root&amp;quot; node and choose ''New -&amp;gt; Image Source'' (or press {{accelkey|shift}}{{accelkey|i}})&lt;br /&gt;
* This will make a new node called &amp;quot;New Image Renderer&amp;quot;. You can rename this using the &amp;quot;Name&amp;quot; property field in the '''Object''' section.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You will notice in the top right of the Terrain Editor, a section listing things like &amp;quot;Diffuse&amp;quot;, &amp;quot;Distribution&amp;quot;, &amp;quot;Distribution Pattern&amp;quot; etc. Selecting one of these will list all of the properties for that section of the current node.&lt;br /&gt;
The ones we need to worry about are as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Diffuse'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
This is the colour map of the current node, and it should point to a tiling TGA texture.&lt;br /&gt;
* Make sure the Diffuse section is highlighted in the top right of the Terrain Editor.&lt;br /&gt;
* In the ''File Name'' field of the '''Image Properties''' section, browse to a generic tiling dirt texture. Remember to hit {{accelkey|enter}} afterwards!&lt;br /&gt;
** This example is using {{filename|textures/megagen/temperate/dirt_02_d.tga}}&lt;br /&gt;
* The ''Scale'' field at the very bottom of the property list allows you to choose how much to tile the texture.&lt;br /&gt;
** The default value is 1 1, but you don't want that since it will stretch your texture over the whole mesh, and look really blurry!&lt;br /&gt;
** Instead set the Scale to something like 48 48, this means that the texture will be repeated 48 times across each axis of the terrain. This results in a sharper final output.&lt;br /&gt;
That's all you need to do for the Diffuse settings in this node.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Distribution'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
This is how we control where the layer is drawn (ie. no grass underwater, no sand on angles over 60 degrees etc). It's basically a big mask where ''white = fully shown'' and ''black = fully hidden''.&lt;br /&gt;
* Make sure the Distribution section is highlighted in the top right.&lt;br /&gt;
* Since this is our first node, we want to show over the whole terrain. This means the distribution map should be 100% white.&lt;br /&gt;
* You can either assign a pure white TGA texture, or change the ''Source Type'' to ''geometryBased''.&lt;br /&gt;
** ''geometryBased'' will by default create a fully white map, so if you don't have a white TGA handy, this is faster.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Distribution Pattern'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
This controls how the current node blends into others. Usually this will be set to a tiling TGA heightmap texture that matches the Diffuse texture.&lt;br /&gt;
* We don't need a Distribution Pattern for the first node, since it doesn't blend with anything. Nodes on top of this one will need Distribution Patterns for more interesting and natural blends though!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Local'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
This is the normal-map of the current node. This should be a tiling TGA texture representing the local normal information of the matching Diffuse texture.&lt;br /&gt;
* Make sure the Local section is highlighted in the top right.&lt;br /&gt;
* In the ''File Name'' field of the '''Image Properties''' section, browse to the matching normal map for your tiling dirt texture.&lt;br /&gt;
** This example is using {{filename|textures/megagen/temperate/dirt_02_local.tga}}&lt;br /&gt;
* The Local texture's tiling amount is automatically the same as the Diffuse texture.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Surface Type'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
Your image nodes should all specify a surface type, so that when players walk over or shoot the surface, it gives the correct sound and particle effects.&lt;br /&gt;
* Find the ''Surface Type Properties'' section of the property list.&lt;br /&gt;
* In the '''Type''' field, enter ''dirt''. It should drop down a list of valid surface types as soon as you hit the first letter.&lt;br /&gt;
* Hit {{accelkey|enter}} to accept the surface type.&lt;br /&gt;
&lt;br /&gt;
Your dirt textures will now produce correct &amp;quot;dirt&amp;quot; effects when shot or collided with!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Previewing the result'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
[[Image:simplemega_firstnode_preview.jpg|thumb|300px|The Render mode preview of the first node]]&lt;br /&gt;
Now we can easily check if this is all set up correctly. You should notice a little icon at the top left of your Terrain Editor which looks like this: [[Image:simplemega_previewbutton.png|MegaTexture Render Preview button]]&lt;br /&gt;
&lt;br /&gt;
* Notice the drop-down arrow on the right of the button. Click it, and select ''&amp;quot;Full&amp;quot;'' instead of ''&amp;quot;None&amp;quot;''.&lt;br /&gt;
* Your terrain should change colour to black. This means it's ready for a preview to be rendered onto it.&lt;br /&gt;
* Click the button itself now, instead of the drop-down. An &amp;quot;Active Tasks&amp;quot; window should pop up, and when it's done, you should see your dirt texture appear on your terrain model.&lt;br /&gt;
* You can switch the camera to Render mode too, which will show your terrain model's shading better.&lt;br /&gt;
* If you want a full-resolution preview of a small area, choose ''&amp;quot;Window&amp;quot;'' instead of ''&amp;quot;Full&amp;quot;'' from the drop-down menu.&lt;br /&gt;
** This creates a small window that you can move around using {{accelbtn|LMB}}-drag in the XY Top view. Simply position the window where you want to preview the full-resolution MegaTexture, and hit the Render Preview button.&lt;br /&gt;
&lt;br /&gt;
Now any time you add new nodes, or change a node's properties, you can just click the Render Preview button and the view will update with your changes.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Adding a second node ==&lt;br /&gt;
Now that the first layer of dirt is in place, we can try putting some grass on top of it!&lt;br /&gt;
* Again, {{accelbtn|RMB}} on your &amp;quot;Root&amp;quot; node and choose ''New -&amp;gt; Image Source'' (or press {{accelkey|shift}}{{accelkey|i}})&lt;br /&gt;
* This will make another new node below your &amp;quot;Dirt&amp;quot; node. &lt;br /&gt;
* Name this new node &amp;quot;Grass&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Surface Tree hierarchy is rendered from the top down, so nodes ''above'' other nodes in the hierarchy will be rendered ''before'' the other nodes. So currently it'll be rendering our Dirt node, and then rendering the Grass node on top of the dirt.&lt;br /&gt;
&lt;br /&gt;
Again, the main map types need to be specified before the node can be rendered:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Diffuse'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
* Make sure the Diffuse section is highlighted in the top right of the Terrain Editor.&lt;br /&gt;
* In the ''File Name'' field of the '''Image Properties''' section, browse to a generic tiling grass texture.&lt;br /&gt;
** This example is using {{filename|textures/megagen/temperate/grass_04_d.tga}}&lt;br /&gt;
* Again you will want to set the ''Scale'' value to something other than 1 1, to tile your texture. Let's use 32 32 for this one.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Distribution'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
This is important now, since we need to control where this layer is visible. Pure white won't work, since that'll just completely cover our underlying Dirt node!&lt;br /&gt;
* Make sure the Distribution section is highlighted in the top right.&lt;br /&gt;
* Change the &amp;quot;Source Type&amp;quot; from ''texture'' to ''geometryBased''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Geometric Texture Distribution'''&lt;br /&gt;
----&lt;br /&gt;
[[Image:simplemega_geometric_distribution.png|thumb|300px|The geometric texture distribution settings of the second node]]&lt;br /&gt;
This is where it gets interesting! There are many settings to alter, and they can have a drastic effect on how different your terrain looks, so try playing around with different values if you're not happy with the initial results.&lt;br /&gt;
&lt;br /&gt;
* '''Altitude Lower''' - Enabling this will limit the lower parts of the terrain from receiving this node's textures.&lt;br /&gt;
** '''Altitude Lower Value''' - The Z height in world units that the node will be drawn above. The default of 0 means that any parts of your terrain mesh below Z=0 will not show any of this node's textures.&lt;br /&gt;
** '''Fuzziness''' - The amount of blur applied to the mask. The higher the value, the more blurry the boundary.&lt;br /&gt;
* '''Altitude Upper''' - Enabling this will limit the higher parts of the terrain from receiving this node's textures.&lt;br /&gt;
** '''Altitude Upper Value''' - The Z height in world units that the node will be drawn below. The default of 0 means that any parts of your terrain mesh above Z=0 will not show any of this node's textures.&lt;br /&gt;
** '''Fuzziness''' - The amount of blur applied to the mask. The higher the value, the more blurry the boundary.&lt;br /&gt;
&lt;br /&gt;
* '''Clamp Distribution To Edge''' - Leave this on Default.&lt;br /&gt;
&lt;br /&gt;
* '''Resolution''' - The size in pixels of the resulting mask. The default value of 256 is fine for nearly any terrain model.&lt;br /&gt;
&lt;br /&gt;
* '''Slope Lower''' - Enabling this will limit shallower angles of the terrain model from receiving this node's textures.&lt;br /&gt;
** '''Slope Lower Value''' - The angle in degrees that the node will be drawn past. The default angle of 0 will result in no change to your mask.&lt;br /&gt;
** '''Fuzziness''' - The amount of blur applied to the mask. The higher the value, the more blurry the boundary.&lt;br /&gt;
* '''Slope Upper''' - Enabling this will limit the steeper angles of the terrain model from receiving this node's textures. This is great for masking out cliffs from your nodes.&lt;br /&gt;
** '''Slope Upper Value''' - The angle in degrees that the node will be hidden past. The default angle of 0 will result in a fully black mask.&lt;br /&gt;
** '''Fuzziness''' - The amount of blur applied to the mask. The higher the value, the more blurry the boundary.&lt;br /&gt;
&lt;br /&gt;
The settings you use for each of these will vary depending on your terrain model, and the type of node you're making. For our Grass node, you can see the settings used for this example in the screenshot above on the right.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Distribution Pattern'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
[[Image:simplemega_dist_ramps.jpg|thumb|300px|The difference between using or not using a Distribution Pattern, and varying Ramp Widths]]&lt;br /&gt;
This controls how the the grass will blend into the dirt. If you don't have a Distribution Pattern texture, the grass will just slowly fade into the dirt, which doesn't look very natural!&lt;br /&gt;
So what we want here is a texture to identify the &amp;quot;height&amp;quot; of the areas of grass. This means that the dirt can blend in based on the height of each clump of grass, so instead of a smooth fade you will get a more natural blend between the grass and the dirt.&lt;br /&gt;
&lt;br /&gt;
If you examine the screenshot to the right, you can see what effect a good Distribution Pattern can have - when the node is rendered with no Distribution Pattern, the blend between the nodes is a simple smooth gradient, which does not look very natural at all. You can also see the difference that the '''Ramp Width''' value makes - this is a very powerful value, so experiment with it until you really understand the effect it has!&lt;br /&gt;
&lt;br /&gt;
* Make sure the Distribution Pattern section is highlighted in the top right.&lt;br /&gt;
* In the ''File Name'' field of the '''Image Properties''' section, browse to the matching heightmap or mask for your tiling grass texture.&lt;br /&gt;
** This example is using {{filename|textures/megagen/temperate/grass_04_mask.tga}}&lt;br /&gt;
* The ''Ramp Width'' should be set to a value lower than the default of 1, since this causes a very blurry blend, which is usually not what you want. Try a value of 0.25 and re-render the preview - try a &amp;quot;Window&amp;quot; preview as described earlier to get a full-resolution preview where you can really see the blend working.&lt;br /&gt;
* '''Important!''' You will also need to set the ''Distribution Pattern Texture Scale'' to the same value as the Diffuse Scale, in this case we just use 32 32 again.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Local'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
Again we want the normal-map which matches the diffuse texture for the grass.&lt;br /&gt;
* Make sure the Local section is highlighted in the top right.&lt;br /&gt;
* In the ''File Name'' field of the '''Image Properties''' section, browse to the matching normal map for your tiling grass texture.&lt;br /&gt;
** This example is using {{filename|textures/megagen/temperate/grass_04_local.tga}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Surface Type'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
Again, you need to specify a surface type, so that when players walk over or shoot the surface, it gives the correct sound and particle effects.&lt;br /&gt;
* Find the ''Surface Type Properties'' section of the property list.&lt;br /&gt;
* In the '''Type''' field, enter ''grass''. It should drop down a list of valid surface types as soon as you hit the first letter.&lt;br /&gt;
* Hit {{accelkey|enter}} to accept the surface type.&lt;br /&gt;
&lt;br /&gt;
Your grass textures should now produce correct &amp;quot;grass&amp;quot; effects when shot or collided with!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Preview again!'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
[[Image:simplemega_secondnode_preview.jpg|thumb|300px|The Render mode preview of the second node blended with the first node]]&lt;br /&gt;
Now that's all set up, you can hit the Render Preview ([[Image:simplemega_previewbutton.png|MegaTexture Render Preview button]]) button again and see what effect the new Grass node has.&lt;br /&gt;
If it's being distributed into the wrong places, you can go back into your Distribution settings and tweak the values for the ''geometryBased'' settings. Then you can preview again until it looks right.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Adding a third node ==&lt;br /&gt;
[[Image:simplemega_thirdnode_preview.jpg|thumb|300px|The Render mode preview of the third node blended with the other two nodes]]&lt;br /&gt;
Now that the grass and dirt are in place, we need some rocks to make the terrain look more natural.&lt;br /&gt;
* Again, {{accelbtn|RMB}} on your &amp;quot;Root&amp;quot; node and choose ''New -&amp;gt; Image Source'' (or press {{accelkey|shift}}{{accelkey|i}})&lt;br /&gt;
* This will make another new node below your &amp;quot;Grass&amp;quot; node. &lt;br /&gt;
* Name this new node &amp;quot;Rock&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Again, the main map types need to be specified before the node can be rendered:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Diffuse'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
* In the ''File Name'' field of the '''Diffuse''' section, browse to a generic tiling rock texture.&lt;br /&gt;
** This example is using {{filename|textures/megagen/temperate/rock_01_d.tga}}&lt;br /&gt;
* Set the ''Scale'' value to 32 32.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Distribution'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
Again we can use Geometric Texture Distribution to easily apply the rock textures only to the cliff-like angles.&lt;br /&gt;
* Make sure the Distribution section is highlighted in the top right.&lt;br /&gt;
* Change the &amp;quot;Source Type&amp;quot; from ''texture'' to ''geometryBased''.&lt;br /&gt;
* To make the rock texture only appear on near vertical surfaces, set the ''Slope Lower Value'' to 23, and the ''Fuzziness'' of Slope Lower to 0.05&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Distribution Pattern'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
Again this will control how the the rocks blend into the other nodes. Again, we want a texture to identify the &amp;quot;height&amp;quot; of the tiling rock texture.&lt;br /&gt;
&lt;br /&gt;
* Make sure the Distribution Pattern section is highlighted in the top right.&lt;br /&gt;
* In the ''File Name'' field of the '''Image Properties''' section, browse to the matching heightmap or mask for your tiling rock texture.&lt;br /&gt;
** This example is using {{filename|textures/megagen/temperate/rock_01_h.tga}}&lt;br /&gt;
* The ''Ramp Width'' should be set to a value much lower than the default of 1, since this causes a very blurry blend, which is not natural for rocks blending with dirt. Try a value of 0.1 here, then render a &amp;quot;Window&amp;quot; preview to see how the blending looks.&lt;br /&gt;
* Remember to set the ''Distribution Pattern Texture Scale'' to the same value as the Diffuse Scale, 32 32.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Local'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
Again we want the normal-map which matches the diffuse texture for the rocks.&lt;br /&gt;
* In the ''File Name'' field of the '''Local''' section, browse to the matching normal map for your tiling rock texture.&lt;br /&gt;
** This example is using {{filename|textures/megagen/temperate/rock_01_local.tga}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Surface Type'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
* Find the ''Surface Type Properties'' section of the property list.&lt;br /&gt;
* In the '''Type''' field, enter ''stone''.&lt;br /&gt;
* Hit {{accelkey|enter}} to accept the surface type.&lt;br /&gt;
&lt;br /&gt;
Your rock textures should now produce correct &amp;quot;stone&amp;quot; effects when shot or collided with.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Preview again!'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
Now that the rocks are set up, you can hit the Render Preview ([[Image:simplemega_previewbutton.png|MegaTexture Render Preview button]]) button again and see what effect the new Rock node has.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Further tweaks ==&lt;br /&gt;
There are other simple changes that can be done in the Terrain Editor to make your MegaTexture look even better.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Node order'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
[[Image:simplemega_node_order.png|frame|Click and drag a node to change the order]]&lt;br /&gt;
You may notice, if you look carefully at the blends between the rock and grass nodes, that some areas of the MegaTexture appear to show the rock texture ''on top'' of the grass! This doesn't look very natural, and it's happening because of the node order.&lt;br /&gt;
&lt;br /&gt;
Since the Rock node is below the Grass node, it will always be rendered on top of the grass. However, there is an easy way to fix this! In the node list of the Terrain Editor, you can click and drag any node to move it above or below existing nodes.&lt;br /&gt;
&lt;br /&gt;
* {{accelbtn|LMB}}-drag the Rock node and move it up in the list until you see a black bar appear between the Dirt and Grass nodes, as shown on the right.&lt;br /&gt;
* Release {{accelbtn|LMB}} when you have positioned the node in the correct place.&lt;br /&gt;
* With the Rock node now positioned between the Dirt and Grass nodes, the grass will appear on top of the rocks as well as the dirt, which looks much more natural!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Color changes'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
Maybe your dirt texture is too bright? Or maybe your grass looks a little ''too'' green?&lt;br /&gt;
You can easily fix this from the Terrain Editor itself! No need to create a new image every time you want to tweak the color or brightness, you can set this up on a per-node basis.&lt;br /&gt;
&lt;br /&gt;
Let's say you want to make the dirt texture darker and a bit more red. Here's how you'd do it:&lt;br /&gt;
* Select your Dirt node.&lt;br /&gt;
* Look under the ''Color Properties'' area in the property list, and {{accelbtn|LMB}} on the '''Color''' swatch (next to where it says 1 1 1, which is white).&lt;br /&gt;
* A color wheel and brightness slider will pop up in a new window. You can use this to darken and tint your texture.&lt;br /&gt;
* Choose a darker brightness, and a color slightly towards red. I used '''RGB Values''' of 225, 220, 220.&lt;br /&gt;
* Hit ''OK'' to accept the color.&lt;br /&gt;
* Re-render your MegaTexture preview. You should notice that the dirt layer looks darker now!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Texture rotation'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
If you're building up a lot of layers of tiling textures, it can sometimes become obvious when a texture tiles in a particular direction. You may see repeating patterns extending into the distance when looking in particular directions, especially if all your nodes have the same orientation.&lt;br /&gt;
&lt;br /&gt;
An easy way to overcome this is to play with the ''Rotation'' value in the Texture Properties section of the Terrain Editor's property list.&lt;br /&gt;
For each node, you should also set the ''Distribution Pattern Texture Rotation'' to match the Rotation value if you want your distribution patterns to line up and work correctly.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Render the MegaTexture =&lt;br /&gt;
=== Save the Surface Tree ===&lt;br /&gt;
Once you're happy with how the preview looks in the editor, you should make sure that your final Surface Tree is saved. Either click the &amp;quot;Save and Unload&amp;quot; button in the Terrain Editor or save the map, then close editWorld.&lt;br /&gt;
&lt;br /&gt;
=== Run the SDK Launcher ===&lt;br /&gt;
Now that your ''.sft'' is saved, go through all the steps outlined in the [[Generate a MegaTexture]] tutorial.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= That's it! =&lt;br /&gt;
[[Image:simplemega_ingame.jpg|thumb|300px|The MegaTexture in-game!]]&lt;br /&gt;
You've now created your very own MegaTexture to use in your map!&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
= Troubleshooting =&lt;br /&gt;
If your terrain model still shows as red even after you've compiled the MegaTexture, there are a couple of things you should check first:&lt;br /&gt;
* See if the console gives you any warnings about missing ''.stm'' files. If this is the case, you probably forgot to assign any Surface Types to your texture nodes. Double-check them and make sure it's all set up correctly.&lt;br /&gt;
* Make sure there aren't any spelling mistakes or typos in your ''.mtr'' material file. The 2nd part of the material should have exactly the same name as your map (the ''&amp;lt; &amp;quot;mapname&amp;quot; &amp;gt;'' part described in [[A Simple First Megatexture#Creating a MegaTexture material|this section]]), otherwise it will not be searching for the correct images.&lt;br /&gt;
* Make sure there aren't any spelling mistakes in your ''.rlt'' file (as described in [[RenderLight|this article]]). If any of the names are inconsistent, the Megatexture will not have been compiled fully.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= See Also =&lt;br /&gt;
* [[An Advanced Terrain and Megatexture]] - an advanced guide for complete MegaTexture creation&lt;br /&gt;
* [[Generate a MegaTexture]] - steps for generating a MegaTexture from the SDK launcher.&lt;br /&gt;
&lt;br /&gt;
[[Category:Art]]&lt;br /&gt;
[[Category:Basic Level Design]]&lt;br /&gt;
[[Category:Tutorials]]&lt;/div&gt;</summary>
		<author><name>MoP</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.splashdamage.com/index.php?title=A_Simple_First_Megatexture&amp;diff=4010</id>
		<title>A Simple First Megatexture</title>
		<link rel="alternate" type="text/html" href="https://wiki.splashdamage.com/index.php?title=A_Simple_First_Megatexture&amp;diff=4010"/>
		<updated>2007-12-12T19:44:58Z</updated>

		<summary type="html">&lt;p&gt;MoP: surface type info&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;So now that you've made [[A Simple First Terrain]], no doubt you'll want to apply a MegaTexture to it! This MegaTexture won't be as detailed or as attractive as an advanced MegaTexture, but will demonstrate the basics of creating a [[Surface Tree]], assigning textures, and compiling it all into a working MegaTexture file.&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
'''For this tutorial you must:'''&lt;br /&gt;
* Have a terrain model UV-mapped in the 0-1 range (covered in the simple first terrain tutorial)&lt;br /&gt;
* Have access to some tiling textures. TODO: Link to MegaTexture media!&lt;br /&gt;
* Have a little understanding the ETQW material system&lt;br /&gt;
&lt;br /&gt;
If you don't have any of the above things, you are not ready to do this tutorial!&lt;br /&gt;
&lt;br /&gt;
'''This tutorial covers:'''&lt;br /&gt;
* How to set up a MegaTexture material&lt;br /&gt;
* How to create a Surface Tree&lt;br /&gt;
* How to add texture nodes in the Terrain Editor&lt;br /&gt;
* How to render and compile a full MegaTexture&lt;br /&gt;
&lt;br /&gt;
'''This tutorial does not cover:'''&lt;br /&gt;
* How to use Blender/Maya/Lightwave/ZBrush/Mudbox/3DSMax/Photoshop&lt;br /&gt;
* How to create tiling textures or heightmaps&lt;br /&gt;
* Anything overly complicated&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Creating a MegaTexture material =&lt;br /&gt;
Firstly you need to create a new material for your terrain to use. If you have never made a new material before, read the article on [[Adding Custom Textures]]. All you need to do is create (or use an existing) ''.mtr'' file and place a material declaration in it, in the manner shown here:&lt;br /&gt;
 material megatextures/mapname		{ useTemplate megatextures/default_ambient&amp;lt; &amp;quot;mapname&amp;quot; &amp;gt; }&lt;br /&gt;
&lt;br /&gt;
This material would automatically search for a MegaTexture called {{filename|mapname.mega}} in the {{filename|/megatextures/}} folder. This example material uses the ''&amp;quot;default_ambient&amp;quot;'' template, which expects a 3-channel RGB MegaTexture. These are generated by the default settings of the [[Generate a MegaTexture|MegaTexture tab in the SDK Launcher]].&lt;br /&gt;
&lt;br /&gt;
Obviously you would want to use the actual name of your map instead of &amp;quot;mapname&amp;quot;, for consistency's sake and ease of reference.&lt;br /&gt;
&lt;br /&gt;
Remember that if you made a new ''.mtr'' file after the game or editor was started, you'll have to restart the whole game and editor before it will read your new file.&lt;br /&gt;
&lt;br /&gt;
=== Assigning the material ===&lt;br /&gt;
You should assign the material you just created by naming a material in your 3D application and applying it to your terrain mesh, then export the model to your preferred format (LWO, ASE or OBJ).&lt;br /&gt;
Tips on this process can be found in the [[A Simple First Terrain|simple first terrain tutorial]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Creating the Surface Tree =&lt;br /&gt;
As described in the Simple First Terrain tutorial, terrain models are set up in the Terrain Editor, accessible via {{accelkey|shift}}{{accelkey|N}} in [[editWorld]]. This tool creates a Surface Tree file ({{filename|.sft}}) that contains all the information about the terrain, including roads, stamps, and detail texture information that MegaGen needs to generate a MegaTexture. The Surface Tree will be saved every time the map is saved, or any time you press the &amp;quot;Save and Unload&amp;quot; button in the Terrain Editor.&lt;br /&gt;
[[Image:simplemega_terrainmodel.png|thumb|300px|Root node set up to use the correct terrain mesh]]&lt;br /&gt;
&lt;br /&gt;
=== Add the terrain mesh ===&lt;br /&gt;
Here's how you bring the terrain mesh into the surface tree:&lt;br /&gt;
* {{accelbtn|RMB}} on the left-hand pane, and choose ''New -&amp;gt; Tree'' via the menu.&lt;br /&gt;
** If you already have a Root node, click the &amp;quot;Begin Editing&amp;quot; button instead.&lt;br /&gt;
* Click on the Root node, and set {{keyname|Model}} to the name of the terrain mesh, in this case {{keyvalue|models/terrain/simpleterrain.obj}}.&lt;br /&gt;
* Press {{accelkey|enter}} to confirm the selection, and the terrain should appear in the 3D view.&lt;br /&gt;
&lt;br /&gt;
Be aware that your terrain model will probably appear bright orange or red.&lt;br /&gt;
The console will probably give you a few WARNING messages, don't worry about these for now, this is because your Megatexture doesn't exist yet!&lt;br /&gt;
&lt;br /&gt;
=== Important note about nodes ===&lt;br /&gt;
When you are editing properties of nodes (names, numbers, texture sources etc.) always remember to hit {{accelkey|enter}} after changing a value, to make sure that the value is stored. If you just type something in and then click somewhere else without pressing {{accelkey|enter}}, your changes may not be applied.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Create the first texture node ==&lt;br /&gt;
[[Image:simplemega_firstnode_diffuse.png|thumb|300px|The first texture node's diffuse texture properties]]&lt;br /&gt;
Now that the model is in place, you can start laying down the texture layers (or &amp;quot;nodes&amp;quot;) that will make up your MegaTexture.&lt;br /&gt;
&lt;br /&gt;
First you need to create a new Image Source node in the Terrain Editor.&lt;br /&gt;
* {{accelbtn|RMB}} on your &amp;quot;Root&amp;quot; node and choose ''New -&amp;gt; Image Source'' (or press {{accelkey|shift}}{{accelkey|i}})&lt;br /&gt;
* This will make a new node called &amp;quot;New Image Renderer&amp;quot;. You can rename this using the &amp;quot;Name&amp;quot; property field in the '''Object''' section.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You will notice in the top right of the Terrain Editor, a section listing things like &amp;quot;Diffuse&amp;quot;, &amp;quot;Distribution&amp;quot;, &amp;quot;Distribution Pattern&amp;quot; etc. Selecting one of these will list all of the properties for that section of the current node.&lt;br /&gt;
The ones we need to worry about are as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Diffuse'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
This is the colour map of the current node, and it should point to a tiling TGA texture.&lt;br /&gt;
* Make sure the Diffuse section is highlighted in the top right of the Terrain Editor.&lt;br /&gt;
* In the ''File Name'' field of the '''Image Properties''' section, browse to a generic tiling dirt texture. Remember to hit {{accelkey|enter}} afterwards!&lt;br /&gt;
** This example is using {{filename|textures/megagen/temperate/dirt_02_d.tga}}&lt;br /&gt;
* The ''Scale'' field at the very bottom of the property list allows you to choose how much to tile the texture.&lt;br /&gt;
** The default value is 1 1, but you don't want that since it will stretch your texture over the whole mesh, and look really blurry!&lt;br /&gt;
** Instead set the Scale to something like 48 48, this means that the texture will be repeated 48 times across each axis of the terrain. This results in a sharper final output.&lt;br /&gt;
That's all you need to do for the Diffuse settings in this node.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Distribution'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
This is how we control where the layer is drawn (ie. no grass underwater, no sand on angles over 60 degrees etc). It's basically a big mask where ''white = fully shown'' and ''black = fully hidden''.&lt;br /&gt;
* Make sure the Distribution section is highlighted in the top right.&lt;br /&gt;
* Since this is our first node, we want to show over the whole terrain. This means the distribution map should be 100% white.&lt;br /&gt;
* You can either assign a pure white TGA texture, or change the ''Source Type'' to ''geometryBased''.&lt;br /&gt;
** ''geometryBased'' will by default create a fully white map, so if you don't have a white TGA handy, this is faster.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Distribution Pattern'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
This controls how the current node blends into others. Usually this will be set to a tiling TGA heightmap texture that matches the Diffuse texture.&lt;br /&gt;
* We don't need a Distribution Pattern for the first node, since it doesn't blend with anything. Nodes on top of this one will need Distribution Patterns for more interesting and natural blends though!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Local'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
This is the normal-map of the current node. This should be a tiling TGA texture representing the local normal information of the matching Diffuse texture.&lt;br /&gt;
* Make sure the Local section is highlighted in the top right.&lt;br /&gt;
* In the ''File Name'' field of the '''Image Properties''' section, browse to the matching normal map for your tiling dirt texture.&lt;br /&gt;
** This example is using {{filename|textures/megagen/temperate/dirt_02_local.tga}}&lt;br /&gt;
* The Local texture's tiling amount is automatically the same as the Diffuse texture.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Surface Type'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
Your image nodes should all specify a surface type, so that when players walk over or shoot the surface, it gives the correct sound and particle effects.&lt;br /&gt;
* Find the ''Surface Type Properties'' section of the property list.&lt;br /&gt;
* In the '''Type''' field, enter ''dirt''. It should drop down a list of valid surface types as soon as you hit the first letter.&lt;br /&gt;
* Hit {{accelkey|enter}} to accept the surface type.&lt;br /&gt;
&lt;br /&gt;
Your dirt textures will now produce correct &amp;quot;dirt&amp;quot; effects when shot or collided with!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Previewing the result'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
[[Image:simplemega_firstnode_preview.jpg|thumb|300px|The Render mode preview of the first node]]&lt;br /&gt;
Now we can easily check if this is all set up correctly. You should notice a little icon at the top left of your Terrain Editor which looks like this: [[Image:simplemega_previewbutton.png|MegaTexture Render Preview button]]&lt;br /&gt;
&lt;br /&gt;
* Notice the drop-down arrow on the right of the button. Click it, and select ''&amp;quot;Full&amp;quot;'' instead of ''&amp;quot;None&amp;quot;''.&lt;br /&gt;
* Your terrain should change colour to black. This means it's ready for a preview to be rendered onto it.&lt;br /&gt;
* Click the button itself now, instead of the drop-down. An &amp;quot;Active Tasks&amp;quot; window should pop up, and when it's done, you should see your dirt texture appear on your terrain model.&lt;br /&gt;
* You can switch the camera to Render mode too, which will show your terrain model's shading better.&lt;br /&gt;
* If you want a full-resolution preview of a small area, choose ''&amp;quot;Window&amp;quot;'' instead of ''&amp;quot;Full&amp;quot;'' from the drop-down menu.&lt;br /&gt;
** This creates a small window that you can move around using {{accelbtn|LMB}}-drag in the XY Top view. Simply position the window where you want to preview the full-resolution MegaTexture, and hit the Render Preview button.&lt;br /&gt;
&lt;br /&gt;
Now any time you add new nodes, or change a node's properties, you can just click the Render Preview button and the view will update with your changes.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Adding a second node ==&lt;br /&gt;
Now that the first layer of dirt is in place, we can try putting some grass on top of it!&lt;br /&gt;
* Again, {{accelbtn|RMB}} on your &amp;quot;Root&amp;quot; node and choose ''New -&amp;gt; Image Source'' (or press {{accelkey|shift}}{{accelkey|i}})&lt;br /&gt;
* This will make another new node below your &amp;quot;Dirt&amp;quot; node. &lt;br /&gt;
* Name this new node &amp;quot;Grass&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Surface Tree hierarchy is rendered from the top down, so nodes ''above'' other nodes in the hierarchy will be rendered ''before'' the other nodes. So currently it'll be rendering our Dirt node, and then rendering the Grass node on top of the dirt.&lt;br /&gt;
&lt;br /&gt;
Again, the main map types need to be specified before the node can be rendered:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Diffuse'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
* Make sure the Diffuse section is highlighted in the top right of the Terrain Editor.&lt;br /&gt;
* In the ''File Name'' field of the '''Image Properties''' section, browse to a generic tiling grass texture.&lt;br /&gt;
** This example is using {{filename|textures/megagen/temperate/grass_04_d.tga}}&lt;br /&gt;
* Again you will want to set the ''Scale'' value to something other than 1 1, to tile your texture. Let's use 32 32 for this one.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Distribution'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
This is important now, since we need to control where this layer is visible. Pure white won't work, since that'll just completely cover our underlying Dirt node!&lt;br /&gt;
* Make sure the Distribution section is highlighted in the top right.&lt;br /&gt;
* Change the &amp;quot;Source Type&amp;quot; from ''texture'' to ''geometryBased''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Geometric Texture Distribution'''&lt;br /&gt;
----&lt;br /&gt;
[[Image:simplemega_geometric_distribution.png|thumb|300px|The geometric texture distribution settings of the second node]]&lt;br /&gt;
This is where it gets interesting! There are many settings to alter, and they can have a drastic effect on how different your terrain looks, so try playing around with different values if you're not happy with the initial results.&lt;br /&gt;
&lt;br /&gt;
* '''Altitude Lower''' - Enabling this will limit the lower parts of the terrain from receiving this node's textures.&lt;br /&gt;
** '''Altitude Lower Value''' - The Z height in world units that the node will be drawn above. The default of 0 means that any parts of your terrain mesh below Z=0 will not show any of this node's textures.&lt;br /&gt;
** '''Fuzziness''' - The amount of blur applied to the mask. The higher the value, the more blurry the boundary.&lt;br /&gt;
* '''Altitude Upper''' - Enabling this will limit the higher parts of the terrain from receiving this node's textures.&lt;br /&gt;
** '''Altitude Upper Value''' - The Z height in world units that the node will be drawn below. The default of 0 means that any parts of your terrain mesh above Z=0 will not show any of this node's textures.&lt;br /&gt;
** '''Fuzziness''' - The amount of blur applied to the mask. The higher the value, the more blurry the boundary.&lt;br /&gt;
&lt;br /&gt;
* '''Clamp Distribution To Edge''' - Leave this on Default.&lt;br /&gt;
&lt;br /&gt;
* '''Resolution''' - The size in pixels of the resulting mask. The default value of 256 is fine for nearly any terrain model.&lt;br /&gt;
&lt;br /&gt;
* '''Slope Lower''' - Enabling this will limit shallower angles of the terrain model from receiving this node's textures.&lt;br /&gt;
** '''Slope Lower Value''' - The angle in degrees that the node will be drawn past. The default angle of 0 will result in no change to your mask.&lt;br /&gt;
** '''Fuzziness''' - The amount of blur applied to the mask. The higher the value, the more blurry the boundary.&lt;br /&gt;
* '''Slope Upper''' - Enabling this will limit the steeper angles of the terrain model from receiving this node's textures. This is great for masking out cliffs from your nodes.&lt;br /&gt;
** '''Slope Upper Value''' - The angle in degrees that the node will be hidden past. The default angle of 0 will result in a fully black mask.&lt;br /&gt;
** '''Fuzziness''' - The amount of blur applied to the mask. The higher the value, the more blurry the boundary.&lt;br /&gt;
&lt;br /&gt;
The settings you use for each of these will vary depending on your terrain model, and the type of node you're making. For our Grass node, you can see the settings used for this example in the screenshot above on the right.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Distribution Pattern'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
[[Image:simplemega_dist_ramps.jpg|thumb|300px|The difference between using or not using a Distribution Pattern, and varying Ramp Widths]]&lt;br /&gt;
This controls how the the grass will blend into the dirt. If you don't have a Distribution Pattern texture, the grass will just slowly fade into the dirt, which doesn't look very natural!&lt;br /&gt;
So what we want here is a texture to identify the &amp;quot;height&amp;quot; of the areas of grass. This means that the dirt can blend in based on the height of each clump of grass, so instead of a smooth fade you will get a more natural blend between the grass and the dirt.&lt;br /&gt;
&lt;br /&gt;
If you examine the screenshot to the right, you can see what effect a good Distribution Pattern can have - when the node is rendered with no Distribution Pattern, the blend between the nodes is a simple smooth gradient, which does not look very natural at all. You can also see the difference that the '''Ramp Width''' value makes - this is a very powerful value, so experiment with it until you really understand the effect it has!&lt;br /&gt;
&lt;br /&gt;
* Make sure the Distribution Pattern section is highlighted in the top right.&lt;br /&gt;
* In the ''File Name'' field of the '''Image Properties''' section, browse to the matching heightmap or mask for your tiling grass texture.&lt;br /&gt;
** This example is using {{filename|textures/megagen/temperate/grass_04_mask.tga}}&lt;br /&gt;
* The ''Ramp Width'' should be set to a value lower than the default of 1, since this causes a very blurry blend, which is usually not what you want. Try a value of 0.25 and re-render the preview - try a &amp;quot;Window&amp;quot; preview as described earlier to get a full-resolution preview where you can really see the blend working.&lt;br /&gt;
* '''Important!''' You will also need to set the ''Distribution Pattern Texture Scale'' to the same value as the Diffuse Scale, in this case we just use 32 32 again.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Local'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
Again we want the normal-map which matches the diffuse texture for the grass.&lt;br /&gt;
* Make sure the Local section is highlighted in the top right.&lt;br /&gt;
* In the ''File Name'' field of the '''Image Properties''' section, browse to the matching normal map for your tiling grass texture.&lt;br /&gt;
** This example is using {{filename|textures/megagen/temperate/grass_04_local.tga}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Surface Type'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
Again, you need to specify a surface type, so that when players walk over or shoot the surface, it gives the correct sound and particle effects.&lt;br /&gt;
* Find the ''Surface Type Properties'' section of the property list.&lt;br /&gt;
* In the '''Type''' field, enter ''grass''. It should drop down a list of valid surface types as soon as you hit the first letter.&lt;br /&gt;
* Hit {{accelkey|enter}} to accept the surface type.&lt;br /&gt;
&lt;br /&gt;
Your grass textures should now produce correct &amp;quot;grass&amp;quot; effects when shot or collided with!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Preview again!'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
[[Image:simplemega_secondnode_preview.jpg|thumb|300px|The Render mode preview of the second node blended with the first node]]&lt;br /&gt;
Now that's all set up, you can hit the Render Preview ([[Image:simplemega_previewbutton.png|MegaTexture Render Preview button]]) button again and see what effect the new Grass node has.&lt;br /&gt;
If it's being distributed into the wrong places, you can go back into your Distribution settings and tweak the values for the ''geometryBased'' settings. Then you can preview again until it looks right.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Adding a third node ==&lt;br /&gt;
[[Image:simplemega_thirdnode_preview.jpg|thumb|300px|The Render mode preview of the third node blended with the other two nodes]]&lt;br /&gt;
Now that the grass and dirt are in place, we need some rocks to make the terrain look more natural.&lt;br /&gt;
* Again, {{accelbtn|RMB}} on your &amp;quot;Root&amp;quot; node and choose ''New -&amp;gt; Image Source'' (or press {{accelkey|shift}}{{accelkey|i}})&lt;br /&gt;
* This will make another new node below your &amp;quot;Grass&amp;quot; node. &lt;br /&gt;
* Name this new node &amp;quot;Rock&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Again, the main map types need to be specified before the node can be rendered:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Diffuse'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
* In the ''File Name'' field of the '''Diffuse''' section, browse to a generic tiling rock texture.&lt;br /&gt;
** This example is using {{filename|textures/megagen/temperate/rock_01_d.tga}}&lt;br /&gt;
* Set the ''Scale'' value to 32 32.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Distribution'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
Again we can use Geometric Texture Distribution to easily apply the rock textures only to the cliff-like angles.&lt;br /&gt;
* Make sure the Distribution section is highlighted in the top right.&lt;br /&gt;
* Change the &amp;quot;Source Type&amp;quot; from ''texture'' to ''geometryBased''.&lt;br /&gt;
* To make the rock texture only appear on near vertical surfaces, set the ''Slope Lower Value'' to 23, and the ''Fuzziness'' of Slope Lower to 0.05&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Distribution Pattern'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
Again this will control how the the rocks blend into the other nodes. Again, we want a texture to identify the &amp;quot;height&amp;quot; of the tiling rock texture.&lt;br /&gt;
&lt;br /&gt;
* Make sure the Distribution Pattern section is highlighted in the top right.&lt;br /&gt;
* In the ''File Name'' field of the '''Image Properties''' section, browse to the matching heightmap or mask for your tiling rock texture.&lt;br /&gt;
** This example is using {{filename|textures/megagen/temperate/rock_01_h.tga}}&lt;br /&gt;
* The ''Ramp Width'' should be set to a value much lower than the default of 1, since this causes a very blurry blend, which is not natural for rocks blending with dirt. Try a value of 0.1 here, then render a &amp;quot;Window&amp;quot; preview to see how the blending looks.&lt;br /&gt;
* Remember to set the ''Distribution Pattern Texture Scale'' to the same value as the Diffuse Scale, 32 32.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Local'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
Again we want the normal-map which matches the diffuse texture for the rocks.&lt;br /&gt;
* In the ''File Name'' field of the '''Local''' section, browse to the matching normal map for your tiling rock texture.&lt;br /&gt;
** This example is using {{filename|textures/megagen/temperate/rock_01_local.tga}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Surface Type'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
* Find the ''Surface Type Properties'' section of the property list.&lt;br /&gt;
* In the '''Type''' field, enter ''stone''.&lt;br /&gt;
* Hit {{accelkey|enter}} to accept the surface type.&lt;br /&gt;
&lt;br /&gt;
Your rock textures should now produce correct &amp;quot;stone&amp;quot; effects when shot or collided with.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Preview again!'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
Now that the rocks are set up, you can hit the Render Preview ([[Image:simplemega_previewbutton.png|MegaTexture Render Preview button]]) button again and see what effect the new Rock node has.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Further tweaks ==&lt;br /&gt;
There are other simple changes that can be done in the Terrain Editor to make your MegaTexture look even better.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Node order'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
[[Image:simplemega_node_order.png|frame|Click and drag a node to change the order]]&lt;br /&gt;
You may notice, if you look carefully at the blends between the rock and grass nodes, that some areas of the MegaTexture appear to show the rock texture ''on top'' of the grass! This doesn't look very natural, and it's happening because of the node order.&lt;br /&gt;
&lt;br /&gt;
Since the Rock node is below the Grass node, it will always be rendered on top of the grass. However, there is an easy way to fix this! In the node list of the Terrain Editor, you can click and drag any node to move it above or below existing nodes.&lt;br /&gt;
&lt;br /&gt;
* {{accelbtn|LMB}}-drag the Rock node and move it up in the list until you see a black bar appear between the Dirt and Grass nodes, as shown on the right.&lt;br /&gt;
* Release {{accelbtn|LMB}} when you have positioned the node in the correct place.&lt;br /&gt;
* With the Rock node now positioned between the Dirt and Grass nodes, the grass will appear on top of the rocks as well as the dirt, which looks much more natural!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Color changes'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
Maybe your dirt texture is too bright? Or maybe your grass looks a little ''too'' green?&lt;br /&gt;
You can easily fix this from the Terrain Editor itself! No need to create a new image every time you want to tweak the color or brightness, you can set this up on a per-node basis.&lt;br /&gt;
&lt;br /&gt;
Let's say you want to make the dirt texture darker and a bit more red. Here's how you'd do it:&lt;br /&gt;
* Select your Dirt node.&lt;br /&gt;
* Look under the ''Color Properties'' area in the property list, and {{accelbtn|LMB}} on the '''Color''' swatch (next to where it says 1 1 1, which is white).&lt;br /&gt;
* A color wheel and brightness slider will pop up in a new window. You can use this to darken and tint your texture.&lt;br /&gt;
* Choose a darker brightness, and a color slightly towards red. I used '''RGB Values''' of 225, 220, 220.&lt;br /&gt;
* Hit ''OK'' to accept the color.&lt;br /&gt;
* Re-render your MegaTexture preview. You should notice that the dirt layer looks darker now!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Texture rotation'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
If you're building up a lot of layers of tiling textures, it can sometimes become obvious when a texture tiles in a particular direction. You may see repeating patterns extending into the distance when looking in particular directions, especially if all your nodes have the same orientation.&lt;br /&gt;
&lt;br /&gt;
An easy way to overcome this is to play with the ''Rotation'' value in the Texture Properties section of the Terrain Editor's property list.&lt;br /&gt;
For each node, you should also set the ''Distribution Pattern Texture Rotation'' to match the Rotation value if you want your distribution patterns to line up and work correctly.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Render the MegaTexture =&lt;br /&gt;
=== Save the Surface Tree ===&lt;br /&gt;
Once you're happy with how the preview looks in the editor, you should make sure that your final Surface Tree is saved. Either click the &amp;quot;Save and Unload&amp;quot; button in the Terrain Editor or save the map, then close editWorld.&lt;br /&gt;
&lt;br /&gt;
=== Run the SDK Launcher ===&lt;br /&gt;
Now that your ''.sft'' is saved, go through all the steps outlined in the [[Generate a MegaTexture]] tutorial.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= That's it! =&lt;br /&gt;
[[Image:simplemega_ingame.jpg|thumb|300px|The MegaTexture in-game!]]&lt;br /&gt;
You've now created your very own MegaTexture to use in your map!&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
= See Also =&lt;br /&gt;
* [[An Advanced Terrain and Megatexture]] - an advanced guide for complete MegaTexture creation&lt;br /&gt;
* [[Generate a MegaTexture]] - steps for generating a MegaTexture from the SDK launcher.&lt;br /&gt;
&lt;br /&gt;
[[Category:Art]]&lt;br /&gt;
[[Category:Basic Level Design]]&lt;br /&gt;
[[Category:Tutorials]]&lt;/div&gt;</summary>
		<author><name>MoP</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.splashdamage.com/index.php?title=Generate_a_MegaTexture&amp;diff=4009</id>
		<title>Generate a MegaTexture</title>
		<link rel="alternate" type="text/html" href="https://wiki.splashdamage.com/index.php?title=Generate_a_MegaTexture&amp;diff=4009"/>
		<updated>2007-12-12T18:52:07Z</updated>

		<summary type="html">&lt;p&gt;MoP: .rlt naming is important&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;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!&lt;br /&gt;
&lt;br /&gt;
Each section contains a ''&amp;quot;View Command Line&amp;quot;'' 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.&lt;br /&gt;
&lt;br /&gt;
= Using the tools =&lt;br /&gt;
[[Image:sdk_launcher_paths.png|300px|right|The &amp;quot;Launch The SDK&amp;quot; tab of the ETQW SDK Launcher.]]&lt;br /&gt;
&lt;br /&gt;
=== Paths setup ===&lt;br /&gt;
Firstly you need to select a valid game path, and a valid save path in the main ''&amp;quot;Launch the SDK&amp;quot;'' tab. If you have already set this up to work with your custom maps and mods, you shouldn't have to change anything here.&lt;br /&gt;
&lt;br /&gt;
Just make sure you have the correct ''&amp;quot;Save Path&amp;quot;'' and ''&amp;quot;Mod Name&amp;quot;'' which contain your custom terrains, textures and maps selected.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
== Generate a MegaTexture ==&lt;br /&gt;
[[Image:sdk_launcher_megatexture.png|300px|right|The &amp;quot;Generate a MegaTexture&amp;quot; tab of the ETQW SDK Launcher.]]&lt;br /&gt;
To access the MegaTexture generation tools, run the ETQW SDK Launcher, and go to the ''&amp;quot;Generate a MegaTexture&amp;quot;'' tab.&lt;br /&gt;
&lt;br /&gt;
=== Load a Surface Tree ===&lt;br /&gt;
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.&lt;br /&gt;
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!&lt;br /&gt;
&lt;br /&gt;
* Click the ''&amp;quot;Browse...&amp;quot;'' button next to the &amp;quot;1. Choose a Surface Tree&amp;quot; field.&lt;br /&gt;
* Browse to your save path's ''/maps/'' folder and select your {{filename|&amp;lt;mapname&amp;gt;.sft}} file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Create a RenderLight Template ===&lt;br /&gt;
Before you can compile a full MegaTexture, you will need to create a ''.rlt'' template. You can find examples of these in {{filename|base/renderlight/}}. You can create one by making a blank ''&amp;lt;mapname&amp;gt;.txt'' file and renaming it to ''&amp;lt;mapname&amp;gt;.rlt''.&lt;br /&gt;
'''Important:''' Your ''.rlt'' file must have exactly the same name as your map's ''.world'' file.&lt;br /&gt;
&lt;br /&gt;
A RenderLight template looks like this:&lt;br /&gt;
 {&lt;br /&gt;
 	mesh		&amp;quot;models/terrain/&amp;lt;terrainmodel&amp;gt;.lwo&amp;quot;&lt;br /&gt;
 	diffuse		&amp;quot;maps/&amp;lt;mapname&amp;gt;_d.tga&amp;quot;&lt;br /&gt;
 	bump		&amp;quot;maps/&amp;lt;mapname&amp;gt;_local.tga&amp;quot;&lt;br /&gt;
 	out		&amp;quot;megatextures/&amp;lt;mapname&amp;gt;_lit.tga&amp;quot;&lt;br /&gt;
 	map 		&amp;quot;maps/&amp;lt;mapname&amp;gt;.entities&amp;quot;&lt;br /&gt;
 	atmosphere	&amp;quot;&amp;lt;atmosphere name&amp;gt;&amp;quot;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
* '''mesh''' - this should point to the relative path of your terrain model.&lt;br /&gt;
* '''diffuse''' - this is the path to the output diffuse texture tiles from the MegaGen stage.&lt;br /&gt;
* '''bump''' - this is the path to the output local normal-map texture tiles from the MegaGen stage.&lt;br /&gt;
* '''out''' - this is where RenderLight will output the lit texture tiles.&lt;br /&gt;
* '''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.&lt;br /&gt;
* '''atmosphere''' - specify a different atmosphere name here if you don't want your MegaTexture to be lit using the same light setup as the main map (for example, snow textures tend to get way too bright when lit, so you should make a duplicate of your map's atmosphere with a sunlight color half as bright).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Important notes ===&lt;br /&gt;
* You must have fully compiled your map successfully at least once before these processes will work.&lt;br /&gt;
* Your map's terrain model must have a &amp;quot;MegaTexture material&amp;quot; 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]].&lt;br /&gt;
* 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.&lt;br /&gt;
* Make sure all your paths are set up correctly, otherwise files may be missing.&lt;br /&gt;
* Make sure all of the instances of ''&amp;lt;mapname&amp;gt;'' are replaced with the same filename as your map's ''.world'' file. If they are not named correctly, the process will not work.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= The processes =&lt;br /&gt;
== MegaGen ==&lt;br /&gt;
[[MegaGen]] is the first stage of making a MegaTexture. It scans your ''.sft'' file for textures and then renders them all to flat &amp;quot;tiles&amp;quot;, 4096x4096 pixels across. Each tile comes in two parts, a &amp;quot;diffuse&amp;quot; tile (contains un-lit surface color), and a &amp;quot;local normal&amp;quot; tile (for the bump and directional information).&lt;br /&gt;
&lt;br /&gt;
These tiles will be outputted to your ''/maps'' folder, in the format {{filename|&amp;lt;mapname&amp;gt;_d_0_0.tga}}, and {{filename|&amp;lt;mapname&amp;gt;_local_0_0.tga}}.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Click on the &amp;quot;MegaGen Options &amp;gt;&amp;gt;&amp;quot; button to expand the option list. The settings are fairly straightforward:&lt;br /&gt;
* '''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 &amp;quot;preview&amp;quot; compiles, or for smaller terrain sizes.&lt;br /&gt;
* '''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.&lt;br /&gt;
* '''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.&lt;br /&gt;
* '''Additional Options''' - this is for advanced users to choose specific settings. A more comprehensive guide can be found in the [[MegaGen]] article.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== RenderLight ==&lt;br /&gt;
[[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 &amp;quot;tiles&amp;quot; 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&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Click on the &amp;quot;RenderLight Options &amp;gt;&amp;gt;&amp;quot; button to expand the option list. The settings are as follows:&lt;br /&gt;
* '''Bake lighting''' - when checked, this option will bake the atmospheric sunlight into the MegaTexture.&lt;br /&gt;
* '''Bake ambient''' - when checked, this option will bake the ambient atmospheric light into the MegaTexture.&lt;br /&gt;
* 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}}.&lt;br /&gt;
* '''Additional Options''' - this is for advanced users to choose specific settings. A more comprehensive guide can be found in the [[RenderLight]] article.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Make MegaTexture ==&lt;br /&gt;
[[MakeMegaTexture]] is the process which compiles the tiles output from the RenderLight process into a compressed ''.mega'' file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Click on the &amp;quot;Make MegaTexture Options &amp;gt;&amp;gt;&amp;quot; to expand the option list. The settings are as follows:&lt;br /&gt;
* '''Best Quality''' - denotes using the best quality compression. You should usually leave this enabled.&lt;br /&gt;
* '''Luminance Error''' - controls the brightness compression quality, where lower amounts mean better quality but larger file sizes.&lt;br /&gt;
* '''Chrominance Error''' - controls the colour compression quality, where lower amounts mean better quality but larger file sizes.&lt;br /&gt;
* '''Alpha Error''' - controls the alpha compression quality, where lower amounts mean better quality but larger file sizes.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For our retail Megatextures, we used 3-channel output from RenderLight, with all the MakeMegaTexture Error settings at 1, for best quality.&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Run the processes =&lt;br /&gt;
Once you have set up all of the options for your MegaTexture, you can set the processes running.&lt;br /&gt;
* Each process can be launched individually by clicking the ''&amp;quot;Run&amp;quot;'' button on the right of each section.&lt;br /&gt;
* The ''&amp;quot;Run Selected Tasks&amp;quot;'' button in the bottom right will launch all of the checked processes.&lt;br /&gt;
** If this is the first time you're compiling a MegaTexture, check all 3 boxes for MegaGen, RenderLight and MegaTexture.&lt;br /&gt;
* 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 ''&amp;quot;Run Selected Tasks&amp;quot;''.&lt;br /&gt;
** Alternately, you can just click the ''&amp;quot;Make MegaTexture&amp;quot;'' button in the MegaTexture field.&lt;br /&gt;
&lt;br /&gt;
[[Category:Art]]&lt;br /&gt;
[[Category:Level Design]]&lt;/div&gt;</summary>
		<author><name>MoP</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.splashdamage.com/index.php?title=A_Simple_First_Megatexture&amp;diff=4008</id>
		<title>A Simple First Megatexture</title>
		<link rel="alternate" type="text/html" href="https://wiki.splashdamage.com/index.php?title=A_Simple_First_Megatexture&amp;diff=4008"/>
		<updated>2007-12-12T18:44:01Z</updated>

		<summary type="html">&lt;p&gt;MoP: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;So now that you've made [[A Simple First Terrain]], no doubt you'll want to apply a MegaTexture to it! This MegaTexture won't be as detailed or as attractive as an advanced MegaTexture, but will demonstrate the basics of creating a [[Surface Tree]], assigning textures, and compiling it all into a working MegaTexture file.&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
'''For this tutorial you must:'''&lt;br /&gt;
* Have a terrain model UV-mapped in the 0-1 range (covered in the simple first terrain tutorial)&lt;br /&gt;
* Have access to some tiling textures. TODO: Link to MegaTexture media!&lt;br /&gt;
* Have a little understanding the ETQW material system&lt;br /&gt;
&lt;br /&gt;
If you don't have any of the above things, you are not ready to do this tutorial!&lt;br /&gt;
&lt;br /&gt;
'''This tutorial covers:'''&lt;br /&gt;
* How to set up a MegaTexture material&lt;br /&gt;
* How to create a Surface Tree&lt;br /&gt;
* How to add texture nodes in the Terrain Editor&lt;br /&gt;
* How to render and compile a full MegaTexture&lt;br /&gt;
&lt;br /&gt;
'''This tutorial does not cover:'''&lt;br /&gt;
* How to use Blender/Maya/Lightwave/ZBrush/Mudbox/3DSMax/Photoshop&lt;br /&gt;
* How to create tiling textures or heightmaps&lt;br /&gt;
* Anything overly complicated&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Creating a MegaTexture material =&lt;br /&gt;
Firstly you need to create a new material for your terrain to use. If you have never made a new material before, read the article on [[Adding Custom Textures]]. All you need to do is create (or use an existing) ''.mtr'' file and place a material declaration in it, in the manner shown here:&lt;br /&gt;
 material megatextures/mapname		{ useTemplate megatextures/default_ambient&amp;lt; &amp;quot;mapname&amp;quot; &amp;gt; }&lt;br /&gt;
&lt;br /&gt;
This material would automatically search for a MegaTexture called {{filename|mapname.mega}} in the {{filename|/megatextures/}} folder. This example material uses the ''&amp;quot;default_ambient&amp;quot;'' template, which expects a 3-channel RGB MegaTexture. These are generated by the default settings of the [[Generate a MegaTexture|MegaTexture tab in the SDK Launcher]].&lt;br /&gt;
&lt;br /&gt;
Obviously you would want to use the actual name of your map instead of &amp;quot;mapname&amp;quot;, for consistency's sake and ease of reference.&lt;br /&gt;
&lt;br /&gt;
Remember that if you made a new ''.mtr'' file after the game or editor was started, you'll have to restart the whole game and editor before it will read your new file.&lt;br /&gt;
&lt;br /&gt;
=== Assigning the material ===&lt;br /&gt;
You should assign the material you just created by naming a material in your 3D application and applying it to your terrain mesh, then export the model to your preferred format (LWO, ASE or OBJ).&lt;br /&gt;
Tips on this process can be found in the [[A Simple First Terrain|simple first terrain tutorial]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Creating the Surface Tree =&lt;br /&gt;
As described in the Simple First Terrain tutorial, terrain models are set up in the Terrain Editor, accessible via {{accelkey|shift}}{{accelkey|N}} in [[editWorld]]. This tool creates a Surface Tree file ({{filename|.sft}}) that contains all the information about the terrain, including roads, stamps, and detail texture information that MegaGen needs to generate a MegaTexture. The Surface Tree will be saved every time the map is saved, or any time you press the &amp;quot;Save and Unload&amp;quot; button in the Terrain Editor.&lt;br /&gt;
[[Image:simplemega_terrainmodel.png|thumb|300px|Root node set up to use the correct terrain mesh]]&lt;br /&gt;
&lt;br /&gt;
=== Add the terrain mesh ===&lt;br /&gt;
Here's how you bring the terrain mesh into the surface tree:&lt;br /&gt;
* {{accelbtn|RMB}} on the left-hand pane, and choose ''New -&amp;gt; Tree'' via the menu.&lt;br /&gt;
** If you already have a Root node, click the &amp;quot;Begin Editing&amp;quot; button instead.&lt;br /&gt;
* Click on the Root node, and set {{keyname|Model}} to the name of the terrain mesh, in this case {{keyvalue|models/terrain/simpleterrain.obj}}.&lt;br /&gt;
* Press {{accelkey|enter}} to confirm the selection, and the terrain should appear in the 3D view.&lt;br /&gt;
&lt;br /&gt;
Be aware that your terrain model will probably appear bright orange or red.&lt;br /&gt;
The console will probably give you a few WARNING messages, don't worry about these for now, this is because your Megatexture doesn't exist yet!&lt;br /&gt;
&lt;br /&gt;
=== Important note about nodes ===&lt;br /&gt;
When you are editing properties of nodes (names, numbers, texture sources etc.) always remember to hit {{accelkey|enter}} after changing a value, to make sure that the value is stored. If you just type something in and then click somewhere else without pressing {{accelkey|enter}}, your changes may not be applied.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Create the first texture node ==&lt;br /&gt;
[[Image:simplemega_firstnode_diffuse.png|thumb|300px|The first texture node's diffuse texture properties]]&lt;br /&gt;
Now that the model is in place, you can start laying down the texture layers (or &amp;quot;nodes&amp;quot;) that will make up your MegaTexture.&lt;br /&gt;
&lt;br /&gt;
First you need to create a new Image Source node in the Terrain Editor.&lt;br /&gt;
* {{accelbtn|RMB}} on your &amp;quot;Root&amp;quot; node and choose ''New -&amp;gt; Image Source'' (or press {{accelkey|shift}}{{accelkey|i}})&lt;br /&gt;
* This will make a new node called &amp;quot;New Image Renderer&amp;quot;. You can rename this using the &amp;quot;Name&amp;quot; property field in the '''Object''' section.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You will notice in the top right of the Terrain Editor, a section listing things like &amp;quot;Diffuse&amp;quot;, &amp;quot;Distribution&amp;quot;, &amp;quot;Distribution Pattern&amp;quot; etc. Selecting one of these will list all of the properties for that section of the current node.&lt;br /&gt;
The ones we need to worry about are as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Diffuse'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
This is the colour map of the current node, and it should point to a tiling TGA texture.&lt;br /&gt;
* Make sure the Diffuse section is highlighted in the top right of the Terrain Editor.&lt;br /&gt;
* In the ''File Name'' field of the '''Image Properties''' section, browse to a generic tiling dirt texture. Remember to hit {{accelkey|enter}} afterwards!&lt;br /&gt;
** This example is using {{filename|textures/megagen/temperate/dirt_02_d.tga}}&lt;br /&gt;
* The ''Scale'' field at the very bottom of the property list allows you to choose how much to tile the texture.&lt;br /&gt;
** The default value is 1 1, but you don't want that since it will stretch your texture over the whole mesh, and look really blurry!&lt;br /&gt;
** Instead set the Scale to something like 48 48, this means that the texture will be repeated 48 times across each axis of the terrain. This results in a sharper final output.&lt;br /&gt;
That's all you need to do for the Diffuse settings in this node.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Distribution'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
This is how we control where the layer is drawn (ie. no grass underwater, no sand on angles over 60 degrees etc). It's basically a big mask where ''white = fully shown'' and ''black = fully hidden''.&lt;br /&gt;
* Make sure the Distribution section is highlighted in the top right.&lt;br /&gt;
* Since this is our first node, we want to show over the whole terrain. This means the distribution map should be 100% white.&lt;br /&gt;
* You can either assign a pure white TGA texture, or change the ''Source Type'' to ''geometryBased''.&lt;br /&gt;
** ''geometryBased'' will by default create a fully white map, so if you don't have a white TGA handy, this is faster.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Distribution Pattern'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
This controls how the current node blends into others. Usually this will be set to a tiling TGA heightmap texture that matches the Diffuse texture.&lt;br /&gt;
* We don't need a Distribution Pattern for the first node, since it doesn't blend with anything. Nodes on top of this one will need Distribution Patterns for more interesting and natural blends though!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Local'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
This is the normal-map of the current node. This should be a tiling TGA texture representing the local normal information of the matching Diffuse texture.&lt;br /&gt;
* Make sure the Local section is highlighted in the top right.&lt;br /&gt;
* In the ''File Name'' field of the '''Image Properties''' section, browse to the matching normal map for your tiling dirt texture.&lt;br /&gt;
** This example is using {{filename|textures/megagen/temperate/dirt_02_local.tga}}&lt;br /&gt;
* The Local texture's tiling amount is automatically the same as the Diffuse texture.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Previewing the result'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
[[Image:simplemega_firstnode_preview.jpg|thumb|300px|The Render mode preview of the first node]]&lt;br /&gt;
Now we can easily check if this is all set up correctly. You should notice a little icon at the top left of your Terrain Editor which looks like this: [[Image:simplemega_previewbutton.png|MegaTexture Render Preview button]]&lt;br /&gt;
&lt;br /&gt;
* Notice the drop-down arrow on the right of the button. Click it, and select ''&amp;quot;Full&amp;quot;'' instead of ''&amp;quot;None&amp;quot;''.&lt;br /&gt;
* Your terrain should change colour to black. This means it's ready for a preview to be rendered onto it.&lt;br /&gt;
* Click the button itself now, instead of the drop-down. An &amp;quot;Active Tasks&amp;quot; window should pop up, and when it's done, you should see your dirt texture appear on your terrain model.&lt;br /&gt;
* You can switch the camera to Render mode too, which will show your terrain model's shading better.&lt;br /&gt;
* If you want a full-resolution preview of a small area, choose ''&amp;quot;Window&amp;quot;'' instead of ''&amp;quot;Full&amp;quot;'' from the drop-down menu.&lt;br /&gt;
** This creates a small window that you can move around using {{accelbtn|LMB}}-drag in the XY Top view. Simply position the window where you want to preview the full-resolution MegaTexture, and hit the Render Preview button.&lt;br /&gt;
&lt;br /&gt;
Now any time you add new nodes, or change a node's properties, you can just click the Render Preview button and the view will update with your changes.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Adding a second node ==&lt;br /&gt;
Now that the first layer of dirt is in place, we can try putting some grass on top of it!&lt;br /&gt;
* Again, {{accelbtn|RMB}} on your &amp;quot;Root&amp;quot; node and choose ''New -&amp;gt; Image Source'' (or press {{accelkey|shift}}{{accelkey|i}})&lt;br /&gt;
* This will make another new node below your &amp;quot;Dirt&amp;quot; node. &lt;br /&gt;
* Name this new node &amp;quot;Grass&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Surface Tree hierarchy is rendered from the top down, so nodes ''above'' other nodes in the hierarchy will be rendered ''before'' the other nodes. So currently it'll be rendering our Dirt node, and then rendering the Grass node on top of the dirt.&lt;br /&gt;
&lt;br /&gt;
Again, the main map types need to be specified before the node can be rendered:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Diffuse'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
* Make sure the Diffuse section is highlighted in the top right of the Terrain Editor.&lt;br /&gt;
* In the ''File Name'' field of the '''Image Properties''' section, browse to a generic tiling grass texture.&lt;br /&gt;
** This example is using {{filename|textures/megagen/temperate/grass_04_d.tga}}&lt;br /&gt;
* Again you will want to set the ''Scale'' value to something other than 1 1, to tile your texture. Let's use 32 32 for this one.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Distribution'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
This is important now, since we need to control where this layer is visible. Pure white won't work, since that'll just completely cover our underlying Dirt node!&lt;br /&gt;
* Make sure the Distribution section is highlighted in the top right.&lt;br /&gt;
* Change the &amp;quot;Source Type&amp;quot; from ''texture'' to ''geometryBased''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Geometric Texture Distribution'''&lt;br /&gt;
----&lt;br /&gt;
[[Image:simplemega_geometric_distribution.png|thumb|300px|The geometric texture distribution settings of the second node]]&lt;br /&gt;
This is where it gets interesting! There are many settings to alter, and they can have a drastic effect on how different your terrain looks, so try playing around with different values if you're not happy with the initial results.&lt;br /&gt;
&lt;br /&gt;
* '''Altitude Lower''' - Enabling this will limit the lower parts of the terrain from receiving this node's textures.&lt;br /&gt;
** '''Altitude Lower Value''' - The Z height in world units that the node will be drawn above. The default of 0 means that any parts of your terrain mesh below Z=0 will not show any of this node's textures.&lt;br /&gt;
** '''Fuzziness''' - The amount of blur applied to the mask. The higher the value, the more blurry the boundary.&lt;br /&gt;
* '''Altitude Upper''' - Enabling this will limit the higher parts of the terrain from receiving this node's textures.&lt;br /&gt;
** '''Altitude Upper Value''' - The Z height in world units that the node will be drawn below. The default of 0 means that any parts of your terrain mesh above Z=0 will not show any of this node's textures.&lt;br /&gt;
** '''Fuzziness''' - The amount of blur applied to the mask. The higher the value, the more blurry the boundary.&lt;br /&gt;
&lt;br /&gt;
* '''Clamp Distribution To Edge''' - Leave this on Default.&lt;br /&gt;
&lt;br /&gt;
* '''Resolution''' - The size in pixels of the resulting mask. The default value of 256 is fine for nearly any terrain model.&lt;br /&gt;
&lt;br /&gt;
* '''Slope Lower''' - Enabling this will limit shallower angles of the terrain model from receiving this node's textures.&lt;br /&gt;
** '''Slope Lower Value''' - The angle in degrees that the node will be drawn past. The default angle of 0 will result in no change to your mask.&lt;br /&gt;
** '''Fuzziness''' - The amount of blur applied to the mask. The higher the value, the more blurry the boundary.&lt;br /&gt;
* '''Slope Upper''' - Enabling this will limit the steeper angles of the terrain model from receiving this node's textures. This is great for masking out cliffs from your nodes.&lt;br /&gt;
** '''Slope Upper Value''' - The angle in degrees that the node will be hidden past. The default angle of 0 will result in a fully black mask.&lt;br /&gt;
** '''Fuzziness''' - The amount of blur applied to the mask. The higher the value, the more blurry the boundary.&lt;br /&gt;
&lt;br /&gt;
The settings you use for each of these will vary depending on your terrain model, and the type of node you're making. For our Grass node, you can see the settings used for this example in the screenshot above on the right.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Distribution Pattern'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
[[Image:simplemega_dist_ramps.jpg|thumb|300px|The difference between using or not using a Distribution Pattern, and varying Ramp Widths]]&lt;br /&gt;
This controls how the the grass will blend into the dirt. If you don't have a Distribution Pattern texture, the grass will just slowly fade into the dirt, which doesn't look very natural!&lt;br /&gt;
So what we want here is a texture to identify the &amp;quot;height&amp;quot; of the areas of grass. This means that the dirt can blend in based on the height of each clump of grass, so instead of a smooth fade you will get a more natural blend between the grass and the dirt.&lt;br /&gt;
&lt;br /&gt;
If you examine the screenshot to the right, you can see what effect a good Distribution Pattern can have - when the node is rendered with no Distribution Pattern, the blend between the nodes is a simple smooth gradient, which does not look very natural at all. You can also see the difference that the '''Ramp Width''' value makes - this is a very powerful value, so experiment with it until you really understand the effect it has!&lt;br /&gt;
&lt;br /&gt;
* Make sure the Distribution Pattern section is highlighted in the top right.&lt;br /&gt;
* In the ''File Name'' field of the '''Image Properties''' section, browse to the matching heightmap or mask for your tiling grass texture.&lt;br /&gt;
** This example is using {{filename|textures/megagen/temperate/grass_04_mask.tga}}&lt;br /&gt;
* The ''Ramp Width'' should be set to a value lower than the default of 1, since this causes a very blurry blend, which is usually not what you want. Try a value of 0.25 and re-render the preview - try a &amp;quot;Window&amp;quot; preview as described earlier to get a full-resolution preview where you can really see the blend working.&lt;br /&gt;
* '''Important!''' You will also need to set the ''Distribution Pattern Texture Scale'' to the same value as the Diffuse Scale, in this case we just use 32 32 again.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Local'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
Again we want the normal-map which matches the diffuse texture for the grass.&lt;br /&gt;
* Make sure the Local section is highlighted in the top right.&lt;br /&gt;
* In the ''File Name'' field of the '''Image Properties''' section, browse to the matching normal map for your tiling grass texture.&lt;br /&gt;
** This example is using {{filename|textures/megagen/temperate/grass_04_local.tga}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Preview again!'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
[[Image:simplemega_secondnode_preview.jpg|thumb|300px|The Render mode preview of the second node blended with the first node]]&lt;br /&gt;
Now that's all set up, you can hit the Render Preview ([[Image:simplemega_previewbutton.png|MegaTexture Render Preview button]]) button again and see what effect the new Grass node has.&lt;br /&gt;
If it's being distributed into the wrong places, you can go back into your Distribution settings and tweak the values for the ''geometryBased'' settings. Then you can preview again until it looks right.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Adding a third node ==&lt;br /&gt;
[[Image:simplemega_thirdnode_preview.jpg|thumb|300px|The Render mode preview of the third node blended with the other two nodes]]&lt;br /&gt;
Now that the grass and dirt are in place, we need some rocks to make the terrain look more natural.&lt;br /&gt;
* Again, {{accelbtn|RMB}} on your &amp;quot;Root&amp;quot; node and choose ''New -&amp;gt; Image Source'' (or press {{accelkey|shift}}{{accelkey|i}})&lt;br /&gt;
* This will make another new node below your &amp;quot;Grass&amp;quot; node. &lt;br /&gt;
* Name this new node &amp;quot;Rock&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Again, the main map types need to be specified before the node can be rendered:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Diffuse'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
* In the ''File Name'' field of the '''Diffuse''' section, browse to a generic tiling rock texture.&lt;br /&gt;
** This example is using {{filename|textures/megagen/temperate/rock_01_d.tga}}&lt;br /&gt;
* Set the ''Scale'' value to 32 32.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Distribution'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
Again we can use Geometric Texture Distribution to easily apply the rock textures only to the cliff-like angles.&lt;br /&gt;
* Make sure the Distribution section is highlighted in the top right.&lt;br /&gt;
* Change the &amp;quot;Source Type&amp;quot; from ''texture'' to ''geometryBased''.&lt;br /&gt;
* To make the rock texture only appear on near vertical surfaces, set the ''Slope Lower Value'' to 23, and the ''Fuzziness'' of Slope Lower to 0.05&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Distribution Pattern'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
Again this will control how the the rocks blend into the other nodes. Again, we want a texture to identify the &amp;quot;height&amp;quot; of the tiling rock texture.&lt;br /&gt;
&lt;br /&gt;
* Make sure the Distribution Pattern section is highlighted in the top right.&lt;br /&gt;
* In the ''File Name'' field of the '''Image Properties''' section, browse to the matching heightmap or mask for your tiling rock texture.&lt;br /&gt;
** This example is using {{filename|textures/megagen/temperate/rock_01_h.tga}}&lt;br /&gt;
* The ''Ramp Width'' should be set to a value much lower than the default of 1, since this causes a very blurry blend, which is not natural for rocks blending with dirt. Try a value of 0.1 here, then render a &amp;quot;Window&amp;quot; preview to see how the blending looks.&lt;br /&gt;
* Remember to set the ''Distribution Pattern Texture Scale'' to the same value as the Diffuse Scale, 32 32.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Local'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
Again we want the normal-map which matches the diffuse texture for the rocks.&lt;br /&gt;
* In the ''File Name'' field of the '''Local''' section, browse to the matching normal map for your tiling rock texture.&lt;br /&gt;
** This example is using {{filename|textures/megagen/temperate/rock_01_local.tga}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Preview again!'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
Now that the rocks are set up, you can hit the Render Preview ([[Image:simplemega_previewbutton.png|MegaTexture Render Preview button]]) button again and see what effect the new Rock node has.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Further tweaks ==&lt;br /&gt;
There are other simple changes that can be done in the Terrain Editor to make your MegaTexture look even better.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Node order'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
[[Image:simplemega_node_order.png|frame|Click and drag a node to change the order]]&lt;br /&gt;
You may notice, if you look carefully at the blends between the rock and grass nodes, that some areas of the MegaTexture appear to show the rock texture ''on top'' of the grass! This doesn't look very natural, and it's happening because of the node order.&lt;br /&gt;
&lt;br /&gt;
Since the Rock node is below the Grass node, it will always be rendered on top of the grass. However, there is an easy way to fix this! In the node list of the Terrain Editor, you can click and drag any node to move it above or below existing nodes.&lt;br /&gt;
&lt;br /&gt;
* {{accelbtn|LMB}}-drag the Rock node and move it up in the list until you see a black bar appear between the Dirt and Grass nodes, as shown on the right.&lt;br /&gt;
* Release {{accelbtn|LMB}} when you have positioned the node in the correct place.&lt;br /&gt;
* With the Rock node now positioned between the Dirt and Grass nodes, the grass will appear on top of the rocks as well as the dirt, which looks much more natural!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Color changes'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
Maybe your dirt texture is too bright? Or maybe your grass looks a little ''too'' green?&lt;br /&gt;
You can easily fix this from the Terrain Editor itself! No need to create a new image every time you want to tweak the color or brightness, you can set this up on a per-node basis.&lt;br /&gt;
&lt;br /&gt;
Let's say you want to make the dirt texture darker and a bit more red. Here's how you'd do it:&lt;br /&gt;
* Select your Dirt node.&lt;br /&gt;
* Look under the ''Color Properties'' area in the property list, and {{accelbtn|LMB}} on the '''Color''' swatch (next to where it says 1 1 1, which is white).&lt;br /&gt;
* A color wheel and brightness slider will pop up in a new window. You can use this to darken and tint your texture.&lt;br /&gt;
* Choose a darker brightness, and a color slightly towards red. I used '''RGB Values''' of 225, 220, 220.&lt;br /&gt;
* Hit ''OK'' to accept the color.&lt;br /&gt;
* Re-render your MegaTexture preview. You should notice that the dirt layer looks darker now!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Texture rotation'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
If you're building up a lot of layers of tiling textures, it can sometimes become obvious when a texture tiles in a particular direction. You may see repeating patterns extending into the distance when looking in particular directions, especially if all your nodes have the same orientation.&lt;br /&gt;
&lt;br /&gt;
An easy way to overcome this is to play with the ''Rotation'' value in the Texture Properties section of the Terrain Editor's property list.&lt;br /&gt;
For each node, you should also set the ''Distribution Pattern Texture Rotation'' to match the Rotation value if you want your distribution patterns to line up and work correctly.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Render the MegaTexture =&lt;br /&gt;
=== Save the Surface Tree ===&lt;br /&gt;
Once you're happy with how the preview looks in the editor, you should make sure that your final Surface Tree is saved. Either click the &amp;quot;Save and Unload&amp;quot; button in the Terrain Editor or save the map, then close editWorld.&lt;br /&gt;
&lt;br /&gt;
=== Run the SDK Launcher ===&lt;br /&gt;
Now that your ''.sft'' is saved, go through all the steps outlined in the [[Generate a MegaTexture]] tutorial.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= That's it! =&lt;br /&gt;
[[Image:simplemega_ingame.jpg|thumb|300px|The MegaTexture in-game!]]&lt;br /&gt;
You've now created your very own MegaTexture to use in your map!&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
= See Also =&lt;br /&gt;
* [[An Advanced Terrain and Megatexture]] - an advanced guide for complete MegaTexture creation&lt;br /&gt;
* [[Generate a MegaTexture]] - steps for generating a MegaTexture from the SDK launcher.&lt;br /&gt;
&lt;br /&gt;
[[Category:Art]]&lt;br /&gt;
[[Category:Basic Level Design]]&lt;br /&gt;
[[Category:Tutorials]]&lt;/div&gt;</summary>
		<author><name>MoP</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.splashdamage.com/index.php?title=Generate_a_MegaTexture&amp;diff=4007</id>
		<title>Generate a MegaTexture</title>
		<link rel="alternate" type="text/html" href="https://wiki.splashdamage.com/index.php?title=Generate_a_MegaTexture&amp;diff=4007"/>
		<updated>2007-12-12T18:43:31Z</updated>

		<summary type="html">&lt;p&gt;MoP: added atmosphere rlt info&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;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!&lt;br /&gt;
&lt;br /&gt;
Each section contains a ''&amp;quot;View Command Line&amp;quot;'' 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.&lt;br /&gt;
&lt;br /&gt;
= Using the tools =&lt;br /&gt;
[[Image:sdk_launcher_paths.png|300px|right|The &amp;quot;Launch The SDK&amp;quot; tab of the ETQW SDK Launcher.]]&lt;br /&gt;
&lt;br /&gt;
=== Paths setup ===&lt;br /&gt;
Firstly you need to select a valid game path, and a valid save path in the main ''&amp;quot;Launch the SDK&amp;quot;'' tab. If you have already set this up to work with your custom maps and mods, you shouldn't have to change anything here.&lt;br /&gt;
&lt;br /&gt;
Just make sure you have the correct ''&amp;quot;Save Path&amp;quot;'' and ''&amp;quot;Mod Name&amp;quot;'' which contain your custom terrains, textures and maps selected.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
== Generate a MegaTexture ==&lt;br /&gt;
[[Image:sdk_launcher_megatexture.png|300px|right|The &amp;quot;Generate a MegaTexture&amp;quot; tab of the ETQW SDK Launcher.]]&lt;br /&gt;
To access the MegaTexture generation tools, run the ETQW SDK Launcher, and go to the ''&amp;quot;Generate a MegaTexture&amp;quot;'' tab.&lt;br /&gt;
&lt;br /&gt;
=== Load a Surface Tree ===&lt;br /&gt;
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.&lt;br /&gt;
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!&lt;br /&gt;
&lt;br /&gt;
* Click the ''&amp;quot;Browse...&amp;quot;'' button next to the &amp;quot;1. Choose a Surface Tree&amp;quot; field.&lt;br /&gt;
* Browse to your save path's ''/maps/'' folder and select your {{filename|&amp;lt;mapname&amp;gt;.sft}} file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Create a RenderLight Template ===&lt;br /&gt;
Before you can compile a full MegaTexture, you will need to create a ''.rlt'' template. You can find examples of these in {{filename|base/renderlight/}}. You can create one by making a blank ''.txt'' file and renaming the extension to ''.rlt''.&lt;br /&gt;
&lt;br /&gt;
A RenderLight template looks like this:&lt;br /&gt;
 {&lt;br /&gt;
 	mesh		&amp;quot;models/terrain/&amp;lt;mapname&amp;gt;.lwo&amp;quot;&lt;br /&gt;
 	diffuse		&amp;quot;maps/&amp;lt;mapname&amp;gt;_d.tga&amp;quot;&lt;br /&gt;
 	bump		&amp;quot;maps/&amp;lt;mapname&amp;gt;_local.tga&amp;quot;&lt;br /&gt;
 	out		&amp;quot;megatextures/&amp;lt;mapname&amp;gt;_lit.tga&amp;quot;&lt;br /&gt;
 	map 		&amp;quot;maps/&amp;lt;mapname&amp;gt;.entities&amp;quot;&lt;br /&gt;
 	atmosphere	&amp;quot;&amp;lt;atmosphere name&amp;gt;&amp;quot;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
* '''mesh''' - this should point to the relative path of your terrain model.&lt;br /&gt;
* '''diffuse''' - this is the path to the output diffuse texture tiles from the MegaGen stage.&lt;br /&gt;
* '''bump''' - this is the path to the output local normal-map texture tiles from the MegaGen stage.&lt;br /&gt;
* '''out''' - this is where RenderLight will output the lit texture tiles.&lt;br /&gt;
* '''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.&lt;br /&gt;
* '''atmosphere''' - specify a different atmosphere name here if you don't want your MegaTexture to be lit using the same light setup as the main map (for example, snow textures tend to get way too bright when lit, so you should make a duplicate of your map's atmosphere with a sunlight color half as bright).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Important notes ===&lt;br /&gt;
* You must have fully compiled your map successfully at least once before these processes will work.&lt;br /&gt;
* Your map's terrain model must have a &amp;quot;MegaTexture material&amp;quot; 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]].&lt;br /&gt;
* 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.&lt;br /&gt;
* Make sure all your paths are set up correctly, otherwise files may be missing.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= The processes =&lt;br /&gt;
== MegaGen ==&lt;br /&gt;
[[MegaGen]] is the first stage of making a MegaTexture. It scans your ''.sft'' file for textures and then renders them all to flat &amp;quot;tiles&amp;quot;, 4096x4096 pixels across. Each tile comes in two parts, a &amp;quot;diffuse&amp;quot; tile (contains un-lit surface color), and a &amp;quot;local normal&amp;quot; tile (for the bump and directional information).&lt;br /&gt;
&lt;br /&gt;
These tiles will be outputted to your ''/maps'' folder, in the format {{filename|&amp;lt;mapname&amp;gt;_d_0_0.tga}}, and {{filename|&amp;lt;mapname&amp;gt;_local_0_0.tga}}.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Click on the &amp;quot;MegaGen Options &amp;gt;&amp;gt;&amp;quot; button to expand the option list. The settings are fairly straightforward:&lt;br /&gt;
* '''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 &amp;quot;preview&amp;quot; compiles, or for smaller terrain sizes.&lt;br /&gt;
* '''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.&lt;br /&gt;
* '''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.&lt;br /&gt;
* '''Additional Options''' - this is for advanced users to choose specific settings. A more comprehensive guide can be found in the [[MegaGen]] article.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== RenderLight ==&lt;br /&gt;
[[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 &amp;quot;tiles&amp;quot; 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&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Click on the &amp;quot;RenderLight Options &amp;gt;&amp;gt;&amp;quot; button to expand the option list. The settings are as follows:&lt;br /&gt;
* '''Bake lighting''' - when checked, this option will bake the atmospheric sunlight into the MegaTexture.&lt;br /&gt;
* '''Bake ambient''' - when checked, this option will bake the ambient atmospheric light into the MegaTexture.&lt;br /&gt;
* 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}}.&lt;br /&gt;
* '''Additional Options''' - this is for advanced users to choose specific settings. A more comprehensive guide can be found in the [[RenderLight]] article.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Make MegaTexture ==&lt;br /&gt;
[[MakeMegaTexture]] is the process which compiles the tiles output from the RenderLight process into a compressed ''.mega'' file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Click on the &amp;quot;Make MegaTexture Options &amp;gt;&amp;gt;&amp;quot; to expand the option list. The settings are as follows:&lt;br /&gt;
* '''Best Quality''' - denotes using the best quality compression. You should usually leave this enabled.&lt;br /&gt;
* '''Luminance Error''' - controls the brightness compression quality, where lower amounts mean better quality but larger file sizes.&lt;br /&gt;
* '''Chrominance Error''' - controls the colour compression quality, where lower amounts mean better quality but larger file sizes.&lt;br /&gt;
* '''Alpha Error''' - controls the alpha compression quality, where lower amounts mean better quality but larger file sizes.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For our retail Megatextures, we used 3-channel output from RenderLight, with all the MakeMegaTexture Error settings at 1, for best quality.&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Run the processes =&lt;br /&gt;
Once you have set up all of the options for your MegaTexture, you can set the processes running.&lt;br /&gt;
* Each process can be launched individually by clicking the ''&amp;quot;Run&amp;quot;'' button on the right of each section.&lt;br /&gt;
* The ''&amp;quot;Run Selected Tasks&amp;quot;'' button in the bottom right will launch all of the checked processes.&lt;br /&gt;
** If this is the first time you're compiling a MegaTexture, check all 3 boxes for MegaGen, RenderLight and MegaTexture.&lt;br /&gt;
* 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 ''&amp;quot;Run Selected Tasks&amp;quot;''.&lt;br /&gt;
** Alternately, you can just click the ''&amp;quot;Make MegaTexture&amp;quot;'' button in the MegaTexture field.&lt;br /&gt;
&lt;br /&gt;
[[Category:Art]]&lt;br /&gt;
[[Category:Level Design]]&lt;/div&gt;</summary>
		<author><name>MoP</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.splashdamage.com/index.php?title=A_Simple_First_Megatexture&amp;diff=4005</id>
		<title>A Simple First Megatexture</title>
		<link rel="alternate" type="text/html" href="https://wiki.splashdamage.com/index.php?title=A_Simple_First_Megatexture&amp;diff=4005"/>
		<updated>2007-12-12T18:32:52Z</updated>

		<summary type="html">&lt;p&gt;MoP: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;So now that you've made [[A Simple First Terrain]], no doubt you'll want to apply a MegaTexture to it! This MegaTexture won't be as detailed or as attractive as an advanced MegaTexture, but will demonstrate the basics of creating a [[Surface Tree]], assigning textures, and compiling it all into a working MegaTexture file.&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
'''For this tutorial you must:'''&lt;br /&gt;
* Have a terrain model UV-mapped in the 0-1 range (covered in the simple first terrain tutorial)&lt;br /&gt;
* Have access to some tiling textures. TODO: Link to MegaTexture media!&lt;br /&gt;
* Have a little understanding the ETQW material system&lt;br /&gt;
&lt;br /&gt;
If you don't have any of the above things, you are not ready to do this tutorial!&lt;br /&gt;
&lt;br /&gt;
'''This tutorial covers:'''&lt;br /&gt;
* How to set up a MegaTexture material&lt;br /&gt;
* How to create a Surface Tree&lt;br /&gt;
* How to add texture nodes in the Terrain Editor&lt;br /&gt;
* How to render and compile a full MegaTexture&lt;br /&gt;
&lt;br /&gt;
'''This tutorial does not cover:'''&lt;br /&gt;
* How to use Blender/Maya/Lightwave/ZBrush/Mudbox/3DSMax/Photoshop&lt;br /&gt;
* How to create tiling textures or heightmaps&lt;br /&gt;
* Anything overly complicated&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Creating a MegaTexture material =&lt;br /&gt;
Firstly you need to create a new material for your terrain to use. If you have never made a new material before, read the article on [[Adding Custom Textures]]. All you need to do is create (or use an existing) ''.mtr'' file and place a material declaration in it, in the manner shown here:&lt;br /&gt;
 material megatextures/mapname		{ useTemplate megatextures/default_ambient&amp;lt; &amp;quot;mapname&amp;quot; &amp;gt; }&lt;br /&gt;
&lt;br /&gt;
This material would automatically search for a MegaTexture called {{filename|mapname.mega}} in the {{filename|/megatextures/}} folder. This example material uses the ''&amp;quot;default_ambient&amp;quot;'' template, which expects a 3-channel RGB MegaTexture. These are generated by the default settings of the [[Generate a MegaTexture|MegaTexture tab in the SDK Launcher]].&lt;br /&gt;
&lt;br /&gt;
Obviously you would want to use the actual name of your map instead of &amp;quot;mapname&amp;quot;, for consistency's sake and ease of reference.&lt;br /&gt;
&lt;br /&gt;
Remember that if you made a new ''.mtr'' file after the game or editor was started, you'll have to restart the whole game and editor before it will read your new file.&lt;br /&gt;
&lt;br /&gt;
=== Assigning the material ===&lt;br /&gt;
You should assign the material you just created by naming a material in your 3D application and applying it to your terrain mesh, then export the model to your preferred format (LWO, ASE or OBJ).&lt;br /&gt;
Tips on this process can be found in the [[A Simple First Terrain|simple first terrain tutorial]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Creating the Surface Tree =&lt;br /&gt;
As described in the Simple First Terrain tutorial, terrain models are set up in the Terrain Editor, accessible via {{accelkey|shift}}{{accelkey|N}} in [[editWorld]]. This tool creates a Surface Tree file ({{filename|.sft}}) that contains all the information about the terrain, including roads, stamps, and detail texture information that MegaGen needs to generate a MegaTexture.&lt;br /&gt;
[[Image:simplemega_terrainmodel.png|thumb|300px|Root node set up to use the correct terrain mesh]]&lt;br /&gt;
&lt;br /&gt;
=== Add the terrain mesh ===&lt;br /&gt;
Here's how you bring the terrain mesh into the surface tree:&lt;br /&gt;
* {{accelbtn|RMB}} on the left-hand pane, and choose ''New -&amp;gt; Tree'' via the menu.&lt;br /&gt;
** If you already have a Root node, click the &amp;quot;Begin Editing&amp;quot; button instead.&lt;br /&gt;
* Click on the Root node, and set {{keyname|Model}} to the name of the terrain mesh, in this case {{keyvalue|models/terrain/simpleterrain.obj}}.&lt;br /&gt;
* Press {{accelkey|enter}} to confirm the selection, and the terrain should appear in the 3D view.&lt;br /&gt;
&lt;br /&gt;
Be aware that your terrain model will probably appear bright orange or red.&lt;br /&gt;
The console will probably give you a few WARNING messages, don't worry about these for now, this is because your Megatexture doesn't exist yet!&lt;br /&gt;
&lt;br /&gt;
=== Important note about nodes ===&lt;br /&gt;
When you are editing properties of nodes (names, numbers, texture sources etc.) always remember to hit {{accelkey|enter}} after changing a value, to make sure that the value is stored. If you just type something in and then click somewhere else without pressing {{accelkey|enter}}, your changes may not be applied.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Create the first texture node ==&lt;br /&gt;
[[Image:simplemega_firstnode_diffuse.png|thumb|300px|The first texture node's diffuse texture properties]]&lt;br /&gt;
Now that the model is in place, you can start laying down the texture layers (or &amp;quot;nodes&amp;quot;) that will make up your MegaTexture.&lt;br /&gt;
&lt;br /&gt;
First you need to create a new Image Source node in the Terrain Editor.&lt;br /&gt;
* {{accelbtn|RMB}} on your &amp;quot;Root&amp;quot; node and choose ''New -&amp;gt; Image Source'' (or press {{accelkey|shift}}{{accelkey|i}})&lt;br /&gt;
* This will make a new node called &amp;quot;New Image Renderer&amp;quot;. You can rename this using the &amp;quot;Name&amp;quot; property field in the '''Object''' section.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You will notice in the top right of the Terrain Editor, a section listing things like &amp;quot;Diffuse&amp;quot;, &amp;quot;Distribution&amp;quot;, &amp;quot;Distribution Pattern&amp;quot; etc. Selecting one of these will list all of the properties for that section of the current node.&lt;br /&gt;
The ones we need to worry about are as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Diffuse'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
This is the colour map of the current node, and it should point to a tiling TGA texture.&lt;br /&gt;
* Make sure the Diffuse section is highlighted in the top right of the Terrain Editor.&lt;br /&gt;
* In the ''File Name'' field of the '''Image Properties''' section, browse to a generic tiling dirt texture. Remember to hit {{accelkey|enter}} afterwards!&lt;br /&gt;
** This example is using {{filename|textures/megagen/temperate/dirt_02_d.tga}}&lt;br /&gt;
* The ''Scale'' field at the very bottom of the property list allows you to choose how much to tile the texture.&lt;br /&gt;
** The default value is 1 1, but you don't want that since it will stretch your texture over the whole mesh, and look really blurry!&lt;br /&gt;
** Instead set the Scale to something like 48 48, this means that the texture will be repeated 48 times across each axis of the terrain. This results in a sharper final output.&lt;br /&gt;
That's all you need to do for the Diffuse settings in this node.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Distribution'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
This is how we control where the layer is drawn (ie. no grass underwater, no sand on angles over 60 degrees etc). It's basically a big mask where ''white = fully shown'' and ''black = fully hidden''.&lt;br /&gt;
* Make sure the Distribution section is highlighted in the top right.&lt;br /&gt;
* Since this is our first node, we want to show over the whole terrain. This means the distribution map should be 100% white.&lt;br /&gt;
* You can either assign a pure white TGA texture, or change the ''Source Type'' to ''geometryBased''.&lt;br /&gt;
** ''geometryBased'' will by default create a fully white map, so if you don't have a white TGA handy, this is faster.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Distribution Pattern'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
This controls how the current node blends into others. Usually this will be set to a tiling TGA heightmap texture that matches the Diffuse texture.&lt;br /&gt;
* We don't need a Distribution Pattern for the first node, since it doesn't blend with anything. Nodes on top of this one will need Distribution Patterns for more interesting and natural blends though!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Local'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
This is the normal-map of the current node. This should be a tiling TGA texture representing the local normal information of the matching Diffuse texture.&lt;br /&gt;
* Make sure the Local section is highlighted in the top right.&lt;br /&gt;
* In the ''File Name'' field of the '''Image Properties''' section, browse to the matching normal map for your tiling dirt texture.&lt;br /&gt;
** This example is using {{filename|textures/megagen/temperate/dirt_02_local.tga}}&lt;br /&gt;
* The Local texture's tiling amount is automatically the same as the Diffuse texture.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Previewing the result'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
[[Image:simplemega_firstnode_preview.jpg|thumb|300px|The Render mode preview of the first node]]&lt;br /&gt;
Now we can easily check if this is all set up correctly. You should notice a little icon at the top left of your Terrain Editor which looks like this: [[Image:simplemega_previewbutton.png|MegaTexture Render Preview button]]&lt;br /&gt;
&lt;br /&gt;
* Notice the drop-down arrow on the right of the button. Click it, and select ''&amp;quot;Full&amp;quot;'' instead of ''&amp;quot;None&amp;quot;''.&lt;br /&gt;
* Your terrain should change colour to black. This means it's ready for a preview to be rendered onto it.&lt;br /&gt;
* Click the button itself now, instead of the drop-down. An &amp;quot;Active Tasks&amp;quot; window should pop up, and when it's done, you should see your dirt texture appear on your terrain model.&lt;br /&gt;
* You can switch the camera to Render mode too, which will show your terrain model's shading better.&lt;br /&gt;
* If you want a full-resolution preview of a small area, choose ''&amp;quot;Window&amp;quot;'' instead of ''&amp;quot;Full&amp;quot;'' from the drop-down menu.&lt;br /&gt;
** This creates a small window that you can move around using {{accelbtn|LMB}}-drag in the XY Top view. Simply position the window where you want to preview the full-resolution MegaTexture, and hit the Render Preview button.&lt;br /&gt;
&lt;br /&gt;
Now any time you add new nodes, or change a node's properties, you can just click the Render Preview button and the view will update with your changes.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Adding a second node ==&lt;br /&gt;
Now that the first layer of dirt is in place, we can try putting some grass on top of it!&lt;br /&gt;
* Again, {{accelbtn|RMB}} on your &amp;quot;Root&amp;quot; node and choose ''New -&amp;gt; Image Source'' (or press {{accelkey|shift}}{{accelkey|i}})&lt;br /&gt;
* This will make another new node below your &amp;quot;Dirt&amp;quot; node. &lt;br /&gt;
* Name this new node &amp;quot;Grass&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Surface Tree hierarchy is rendered from the top down, so nodes ''above'' other nodes in the hierarchy will be rendered ''before'' the other nodes. So currently it'll be rendering our Dirt node, and then rendering the Grass node on top of the dirt.&lt;br /&gt;
&lt;br /&gt;
Again, the main map types need to be specified before the node can be rendered:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Diffuse'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
* Make sure the Diffuse section is highlighted in the top right of the Terrain Editor.&lt;br /&gt;
* In the ''File Name'' field of the '''Image Properties''' section, browse to a generic tiling grass texture.&lt;br /&gt;
** This example is using {{filename|textures/megagen/temperate/grass_04_d.tga}}&lt;br /&gt;
* Again you will want to set the ''Scale'' value to something other than 1 1, to tile your texture. Let's use 32 32 for this one.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Distribution'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
This is important now, since we need to control where this layer is visible. Pure white won't work, since that'll just completely cover our underlying Dirt node!&lt;br /&gt;
* Make sure the Distribution section is highlighted in the top right.&lt;br /&gt;
* Change the &amp;quot;Source Type&amp;quot; from ''texture'' to ''geometryBased''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Geometric Texture Distribution'''&lt;br /&gt;
----&lt;br /&gt;
[[Image:simplemega_geometric_distribution.png|thumb|300px|The geometric texture distribution settings of the second node]]&lt;br /&gt;
This is where it gets interesting! There are many settings to alter, and they can have a drastic effect on how different your terrain looks, so try playing around with different values if you're not happy with the initial results.&lt;br /&gt;
&lt;br /&gt;
* '''Altitude Lower''' - Enabling this will limit the lower parts of the terrain from receiving this node's textures.&lt;br /&gt;
** '''Altitude Lower Value''' - The Z height in world units that the node will be drawn above. The default of 0 means that any parts of your terrain mesh below Z=0 will not show any of this node's textures.&lt;br /&gt;
** '''Fuzziness''' - The amount of blur applied to the mask. The higher the value, the more blurry the boundary.&lt;br /&gt;
* '''Altitude Upper''' - Enabling this will limit the higher parts of the terrain from receiving this node's textures.&lt;br /&gt;
** '''Altitude Upper Value''' - The Z height in world units that the node will be drawn below. The default of 0 means that any parts of your terrain mesh above Z=0 will not show any of this node's textures.&lt;br /&gt;
** '''Fuzziness''' - The amount of blur applied to the mask. The higher the value, the more blurry the boundary.&lt;br /&gt;
&lt;br /&gt;
* '''Clamp Distribution To Edge''' - Leave this on Default.&lt;br /&gt;
&lt;br /&gt;
* '''Resolution''' - The size in pixels of the resulting mask. The default value of 256 is fine for nearly any terrain model.&lt;br /&gt;
&lt;br /&gt;
* '''Slope Lower''' - Enabling this will limit shallower angles of the terrain model from receiving this node's textures.&lt;br /&gt;
** '''Slope Lower Value''' - The angle in degrees that the node will be drawn past. The default angle of 0 will result in no change to your mask.&lt;br /&gt;
** '''Fuzziness''' - The amount of blur applied to the mask. The higher the value, the more blurry the boundary.&lt;br /&gt;
* '''Slope Upper''' - Enabling this will limit the steeper angles of the terrain model from receiving this node's textures. This is great for masking out cliffs from your nodes.&lt;br /&gt;
** '''Slope Upper Value''' - The angle in degrees that the node will be hidden past. The default angle of 0 will result in a fully black mask.&lt;br /&gt;
** '''Fuzziness''' - The amount of blur applied to the mask. The higher the value, the more blurry the boundary.&lt;br /&gt;
&lt;br /&gt;
The settings you use for each of these will vary depending on your terrain model, and the type of node you're making. For our Grass node, you can see the settings used for this example in the screenshot above on the right.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Distribution Pattern'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
[[Image:simplemega_dist_ramps.jpg|thumb|300px|The difference between using or not using a Distribution Pattern, and varying Ramp Widths]]&lt;br /&gt;
This controls how the the grass will blend into the dirt. If you don't have a Distribution Pattern texture, the grass will just slowly fade into the dirt, which doesn't look very natural!&lt;br /&gt;
So what we want here is a texture to identify the &amp;quot;height&amp;quot; of the areas of grass. This means that the dirt can blend in based on the height of each clump of grass, so instead of a smooth fade you will get a more natural blend between the grass and the dirt.&lt;br /&gt;
&lt;br /&gt;
If you examine the screenshot to the right, you can see what effect a good Distribution Pattern can have - when the node is rendered with no Distribution Pattern, the blend between the nodes is a simple smooth gradient, which does not look very natural at all. You can also see the difference that the '''Ramp Width''' value makes - this is a very powerful value, so experiment with it until you really understand the effect it has!&lt;br /&gt;
&lt;br /&gt;
* Make sure the Distribution Pattern section is highlighted in the top right.&lt;br /&gt;
* In the ''File Name'' field of the '''Image Properties''' section, browse to the matching heightmap or mask for your tiling grass texture.&lt;br /&gt;
** This example is using {{filename|textures/megagen/temperate/grass_04_mask.tga}}&lt;br /&gt;
* The ''Ramp Width'' should be set to a value lower than the default of 1, since this causes a very blurry blend, which is usually not what you want. Try a value of 0.25 and re-render the preview - try a &amp;quot;Window&amp;quot; preview as described earlier to get a full-resolution preview where you can really see the blend working.&lt;br /&gt;
* '''Important!''' You will also need to set the ''Distribution Pattern Texture Scale'' to the same value as the Diffuse Scale, in this case we just use 32 32 again.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Local'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
Again we want the normal-map which matches the diffuse texture for the grass.&lt;br /&gt;
* Make sure the Local section is highlighted in the top right.&lt;br /&gt;
* In the ''File Name'' field of the '''Image Properties''' section, browse to the matching normal map for your tiling grass texture.&lt;br /&gt;
** This example is using {{filename|textures/megagen/temperate/grass_04_local.tga}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Preview again!'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
[[Image:simplemega_secondnode_preview.jpg|thumb|300px|The Render mode preview of the second node blended with the first node]]&lt;br /&gt;
Now that's all set up, you can hit the Render Preview ([[Image:simplemega_previewbutton.png|MegaTexture Render Preview button]]) button again and see what effect the new Grass node has.&lt;br /&gt;
If it's being distributed into the wrong places, you can go back into your Distribution settings and tweak the values for the ''geometryBased'' settings. Then you can preview again until it looks right.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Adding a third node ==&lt;br /&gt;
[[Image:simplemega_thirdnode_preview.jpg|thumb|300px|The Render mode preview of the third node blended with the other two nodes]]&lt;br /&gt;
Now that the grass and dirt are in place, we need some rocks to make the terrain look more natural.&lt;br /&gt;
* Again, {{accelbtn|RMB}} on your &amp;quot;Root&amp;quot; node and choose ''New -&amp;gt; Image Source'' (or press {{accelkey|shift}}{{accelkey|i}})&lt;br /&gt;
* This will make another new node below your &amp;quot;Grass&amp;quot; node. &lt;br /&gt;
* Name this new node &amp;quot;Rock&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Again, the main map types need to be specified before the node can be rendered:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Diffuse'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
* In the ''File Name'' field of the '''Diffuse''' section, browse to a generic tiling rock texture.&lt;br /&gt;
** This example is using {{filename|textures/megagen/temperate/rock_01_d.tga}}&lt;br /&gt;
* Set the ''Scale'' value to 32 32.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Distribution'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
Again we can use Geometric Texture Distribution to easily apply the rock textures only to the cliff-like angles.&lt;br /&gt;
* Make sure the Distribution section is highlighted in the top right.&lt;br /&gt;
* Change the &amp;quot;Source Type&amp;quot; from ''texture'' to ''geometryBased''.&lt;br /&gt;
* To make the rock texture only appear on near vertical surfaces, set the ''Slope Lower Value'' to 23, and the ''Fuzziness'' of Slope Lower to 0.05&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Distribution Pattern'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
Again this will control how the the rocks blend into the other nodes. Again, we want a texture to identify the &amp;quot;height&amp;quot; of the tiling rock texture.&lt;br /&gt;
&lt;br /&gt;
* Make sure the Distribution Pattern section is highlighted in the top right.&lt;br /&gt;
* In the ''File Name'' field of the '''Image Properties''' section, browse to the matching heightmap or mask for your tiling rock texture.&lt;br /&gt;
** This example is using {{filename|textures/megagen/temperate/rock_01_h.tga}}&lt;br /&gt;
* The ''Ramp Width'' should be set to a value much lower than the default of 1, since this causes a very blurry blend, which is not natural for rocks blending with dirt. Try a value of 0.1 here, then render a &amp;quot;Window&amp;quot; preview to see how the blending looks.&lt;br /&gt;
* Remember to set the ''Distribution Pattern Texture Scale'' to the same value as the Diffuse Scale, 32 32.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Local'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
Again we want the normal-map which matches the diffuse texture for the rocks.&lt;br /&gt;
* In the ''File Name'' field of the '''Local''' section, browse to the matching normal map for your tiling rock texture.&lt;br /&gt;
** This example is using {{filename|textures/megagen/temperate/rock_01_local.tga}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Preview again!'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
Now that the rocks are set up, you can hit the Render Preview ([[Image:simplemega_previewbutton.png|MegaTexture Render Preview button]]) button again and see what effect the new Rock node has.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Further tweaks ==&lt;br /&gt;
There are other simple changes that can be done in the Terrain Editor to make your MegaTexture look even better.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Node order'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
[[Image:simplemega_node_order.png|frame|Click and drag a node to change the order]]&lt;br /&gt;
You may notice, if you look carefully at the blends between the rock and grass nodes, that some areas of the MegaTexture appear to show the rock texture ''on top'' of the grass! This doesn't look very natural, and it's happening because of the node order.&lt;br /&gt;
&lt;br /&gt;
Since the Rock node is below the Grass node, it will always be rendered on top of the grass. However, there is an easy way to fix this! In the node list of the Terrain Editor, you can click and drag any node to move it above or below existing nodes.&lt;br /&gt;
&lt;br /&gt;
* {{accelbtn|LMB}}-drag the Rock node and move it up in the list until you see a black bar appear between the Dirt and Grass nodes, as shown on the right.&lt;br /&gt;
* Release {{accelbtn|LMB}} when you have positioned the node in the correct place.&lt;br /&gt;
* With the Rock node now positioned between the Dirt and Grass nodes, the grass will appear on top of the rocks as well as the dirt, which looks much more natural!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Color changes'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
Maybe your dirt texture is too bright? Or maybe your grass looks a little ''too'' green?&lt;br /&gt;
You can easily fix this from the Terrain Editor itself! No need to create a new image every time you want to tweak the color or brightness, you can set this up on a per-node basis.&lt;br /&gt;
&lt;br /&gt;
Let's say you want to make the dirt texture darker and a bit more red. Here's how you'd do it:&lt;br /&gt;
* Select your Dirt node.&lt;br /&gt;
* Look under the ''Color Properties'' area in the property list, and {{accelbtn|LMB}} on the '''Color''' swatch (next to where it says 1 1 1, which is white).&lt;br /&gt;
* A color wheel and brightness slider will pop up in a new window. You can use this to darken and tint your texture.&lt;br /&gt;
* Choose a darker brightness, and a color slightly towards red. I used '''RGB Values''' of 225, 220, 220.&lt;br /&gt;
* Hit ''OK'' to accept the color.&lt;br /&gt;
* Re-render your MegaTexture preview. You should notice that the dirt layer looks darker now!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Texture rotation'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
If you're building up a lot of layers of tiling textures, it can sometimes become obvious when a texture tiles in a particular direction. You may see repeating patterns extending into the distance when looking in particular directions, especially if all your nodes have the same orientation.&lt;br /&gt;
&lt;br /&gt;
An easy way to overcome this is to play with the ''Rotation'' value in the Texture Properties section of the Terrain Editor's property list.&lt;br /&gt;
For each node, you should also set the ''Distribution Pattern Texture Rotation'' to match the Rotation value if you want your distribution patterns to line up and work correctly.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= That's it! =&lt;br /&gt;
[[Image:simplemega_ingame.jpg|thumb|300px|The MegaTexture in-game!]]&lt;br /&gt;
You've now created your very own MegaTexture to use in your map!&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
= See Also =&lt;br /&gt;
* [[An Advanced Terrain and Megatexture]] - an advanced guide for complete MegaTexture creation&lt;br /&gt;
* [[Generate a MegaTexture]] - steps for generating a MegaTexture from the SDK launcher.&lt;br /&gt;
&lt;br /&gt;
[[Category:Art]]&lt;br /&gt;
[[Category:Basic Level Design]]&lt;br /&gt;
[[Category:Tutorials]]&lt;/div&gt;</summary>
		<author><name>MoP</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.splashdamage.com/index.php?title=A_Simple_First_Megatexture&amp;diff=4004</id>
		<title>A Simple First Megatexture</title>
		<link rel="alternate" type="text/html" href="https://wiki.splashdamage.com/index.php?title=A_Simple_First_Megatexture&amp;diff=4004"/>
		<updated>2007-12-12T16:55:11Z</updated>

		<summary type="html">&lt;p&gt;MoP: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;So now that you've made [[A Simple First Terrain]], no doubt you'll want to apply a MegaTexture to it! This MegaTexture won't be as detailed or as attractive as an advanced MegaTexture, but will demonstrate the basics of creating a [[Surface Tree]], assigning textures, and compiling it all into a working MegaTexture file.&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
'''For this tutorial you must:'''&lt;br /&gt;
* Have a terrain model UV-mapped in the 0-1 range (covered in the simple first terrain tutorial)&lt;br /&gt;
* Have access to some tiling textures. TODO: Link to MegaTexture media!&lt;br /&gt;
* Have a little understanding the ETQW material system&lt;br /&gt;
&lt;br /&gt;
If you don't have any of the above things, you are not ready to do this tutorial!&lt;br /&gt;
&lt;br /&gt;
'''This tutorial covers:'''&lt;br /&gt;
* How to set up a MegaTexture material&lt;br /&gt;
* How to create a Surface Tree&lt;br /&gt;
* How to add texture nodes in the Terrain Editor&lt;br /&gt;
* How to render and compile a full MegaTexture&lt;br /&gt;
&lt;br /&gt;
'''This tutorial does not cover:'''&lt;br /&gt;
* How to use Blender/Maya/Lightwave/ZBrush/Mudbox/3DSMax/Photoshop&lt;br /&gt;
* How to create tiling textures or heightmaps&lt;br /&gt;
* Anything overly complicated&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Creating a MegaTexture material =&lt;br /&gt;
Firstly you need to create a new material for your terrain to use. If you have never made a new material before, read the article on [[Adding Custom Textures]]. All you need to do is create (or use an existing) ''.mtr'' file and place a material declaration in it, in the manner shown here:&lt;br /&gt;
 material megatextures/mapname		{ useTemplate megatextures/default_ambient&amp;lt; &amp;quot;mapname&amp;quot; &amp;gt; }&lt;br /&gt;
&lt;br /&gt;
This material would automatically search for a MegaTexture called {{filename|mapname.mega}} in the {{filename|/megatextures/}} folder. This example material uses the ''&amp;quot;default_ambient&amp;quot;'' template, which expects a 3-channel RGB MegaTexture. These are generated by the default settings of the [[Generate a MegaTexture|MegaTexture tab in the SDK Launcher]].&lt;br /&gt;
&lt;br /&gt;
Obviously you would want to use the actual name of your map instead of &amp;quot;mapname&amp;quot;, for consistency's sake and ease of reference.&lt;br /&gt;
&lt;br /&gt;
Remember that if you made a new ''.mtr'' file after the game or editor was started, you'll have to restart the whole game and editor before it will read your new file.&lt;br /&gt;
&lt;br /&gt;
=== Assigning the material ===&lt;br /&gt;
You should assign the material you just created by naming a material in your 3D application and applying it to your terrain mesh, then export the model to your preferred format (LWO, ASE or OBJ).&lt;br /&gt;
Tips on this process can be found in the [[A Simple First Terrain|simple first terrain tutorial]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Creating the Surface Tree =&lt;br /&gt;
As described in the Simple First Terrain tutorial, terrain models are set up in the Terrain Editor, accessible via {{accelkey|shift}}{{accelkey|N}} in [[editWorld]]. This tool creates a Surface Tree file ({{filename|.sft}}) that contains all the information about the terrain, including roads, stamps, and detail texture information that MegaGen needs to generate a MegaTexture.&lt;br /&gt;
[[Image:simplemega_terrainmodel.png|thumb|300px|Root node set up to use the correct terrain mesh]]&lt;br /&gt;
&lt;br /&gt;
=== Add the terrain mesh ===&lt;br /&gt;
Here's how you bring the terrain mesh into the surface tree:&lt;br /&gt;
* {{accelbtn|RMB}} on the left-hand pane, and choose ''New -&amp;gt; Tree'' via the menu.&lt;br /&gt;
** If you already have a Root node, click the &amp;quot;Begin Editing&amp;quot; button instead.&lt;br /&gt;
* Click on the Root node, and set {{keyname|Model}} to the name of the terrain mesh, in this case {{keyvalue|models/terrain/simpleterrain.obj}}.&lt;br /&gt;
* Press {{accelkey|enter}} to confirm the selection, and the terrain should appear in the 3D view.&lt;br /&gt;
&lt;br /&gt;
Be aware that your terrain model will probably appear bright orange or red.&lt;br /&gt;
The console will probably give you a few WARNING messages, don't worry about these for now, this is because your Megatexture doesn't exist yet!&lt;br /&gt;
&lt;br /&gt;
=== Important note about nodes ===&lt;br /&gt;
When you are editing properties of nodes (names, numbers, texture sources etc.) always remember to hit {{accelkey|enter}} after changing a value, to make sure that the value is stored. If you just type something in and then click somewhere else without pressing {{accelkey|enter}}, your changes may not be applied.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Create the first texture node ==&lt;br /&gt;
[[Image:simplemega_firstnode_diffuse.png|thumb|300px|The first texture node's diffuse texture properties]]&lt;br /&gt;
Now that the model is in place, you can start laying down the texture layers (or &amp;quot;nodes&amp;quot;) that will make up your MegaTexture.&lt;br /&gt;
&lt;br /&gt;
First you need to create a new Image Source node in the Terrain Editor.&lt;br /&gt;
* {{accelbtn|RMB}} on your &amp;quot;Root&amp;quot; node and choose ''New -&amp;gt; Image Source'' (or press {{accelkey|shift}}{{accelkey|i}})&lt;br /&gt;
* This will make a new node called &amp;quot;New Image Renderer&amp;quot;. You can rename this using the &amp;quot;Name&amp;quot; property field in the '''Object''' section.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You will notice in the top right of the Terrain Editor, a section listing things like &amp;quot;Diffuse&amp;quot;, &amp;quot;Distribution&amp;quot;, &amp;quot;Distribution Pattern&amp;quot; etc. Selecting one of these will list all of the properties for that section of the current node.&lt;br /&gt;
The ones we need to worry about are as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Diffuse'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
This is the colour map of the current node, and it should point to a tiling TGA texture.&lt;br /&gt;
* Make sure the Diffuse section is highlighted in the top right of the Terrain Editor.&lt;br /&gt;
* In the ''File Name'' field of the '''Image Properties''' section, browse to a generic tiling dirt texture. Remember to hit {{accelkey|enter}} afterwards!&lt;br /&gt;
** This example is using {{filename|textures/megagen/temperate/dirt_02_d.tga}}&lt;br /&gt;
* The ''Scale'' field at the very bottom of the property list allows you to choose how much to tile the texture.&lt;br /&gt;
** The default value is 1 1, but you don't want that since it will stretch your texture over the whole mesh, and look really blurry!&lt;br /&gt;
** Instead set the Scale to something like 48 48, this means that the texture will be repeated 48 times across each axis of the terrain. This results in a sharper final output.&lt;br /&gt;
That's all you need to do for the Diffuse settings in this node.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Distribution'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
This is how we control where the layer is drawn (ie. no grass underwater, no sand on angles over 60 degrees etc). It's basically a big mask where ''white = fully shown'' and ''black = fully hidden''.&lt;br /&gt;
* Make sure the Distribution section is highlighted in the top right.&lt;br /&gt;
* Since this is our first node, we want to show over the whole terrain. This means the distribution map should be 100% white.&lt;br /&gt;
* You can either assign a pure white TGA texture, or change the ''Source Type'' to ''geometryBased''.&lt;br /&gt;
** ''geometryBased'' will by default create a fully white map, so if you don't have a white TGA handy, this is faster.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Distribution Pattern'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
This controls how the current node blends into others. Usually this will be set to a tiling TGA heightmap texture that matches the Diffuse texture.&lt;br /&gt;
* We don't need a Distribution Pattern for the first node, since it doesn't blend with anything. Nodes on top of this one will need Distribution Patterns for more interesting and natural blends though!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Local'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
This is the normal-map of the current node. This should be a tiling TGA texture representing the local normal information of the matching Diffuse texture.&lt;br /&gt;
* Make sure the Local section is highlighted in the top right.&lt;br /&gt;
* In the ''File Name'' field of the '''Image Properties''' section, browse to the matching normal map for your tiling dirt texture.&lt;br /&gt;
** This example is using {{filename|textures/megagen/temperate/dirt_02_local.tga}}&lt;br /&gt;
* The Local texture's tiling amount is automatically the same as the Diffuse texture.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Previewing the result'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
[[Image:simplemega_firstnode_preview.jpg|thumb|300px|The Render mode preview of the first node]]&lt;br /&gt;
Now we can easily check if this is all set up correctly. You should notice a little icon at the top left of your Terrain Editor which looks like this: [[Image:simplemega_previewbutton.png|MegaTexture Render Preview button]]&lt;br /&gt;
&lt;br /&gt;
* Notice the drop-down arrow on the right of the button. Click it, and select ''&amp;quot;Full&amp;quot;'' instead of ''&amp;quot;None&amp;quot;''.&lt;br /&gt;
* Your terrain should change colour to black. This means it's ready for a preview to be rendered onto it.&lt;br /&gt;
* Click the button itself now, instead of the drop-down. An &amp;quot;Active Tasks&amp;quot; window should pop up, and when it's done, you should see your dirt texture appear on your terrain model.&lt;br /&gt;
* You can switch the camera to Render mode too, which will show your terrain model's shading better.&lt;br /&gt;
* If you want a full-resolution preview of a small area, choose ''&amp;quot;Window&amp;quot;'' instead of ''&amp;quot;Full&amp;quot;'' from the drop-down menu.&lt;br /&gt;
** This creates a small window that you can move around using {{accelbtn|LMB}}-drag in the XY Top view. Simply position the window where you want to preview the full-resolution MegaTexture, and hit the Render Preview button.&lt;br /&gt;
&lt;br /&gt;
Now any time you add new nodes, or change a node's properties, you can just click the Render Preview button and the view will update with your changes.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Adding a second node ==&lt;br /&gt;
Now that the first layer of dirt is in place, we can try putting some grass on top of it!&lt;br /&gt;
* Again, {{accelbtn|RMB}} on your &amp;quot;Root&amp;quot; node and choose ''New -&amp;gt; Image Source'' (or press {{accelkey|shift}}{{accelkey|i}})&lt;br /&gt;
* This will make another new node below your &amp;quot;Dirt&amp;quot; node. &lt;br /&gt;
* Name this new node &amp;quot;Grass&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Surface Tree hierarchy is rendered from the top down, so nodes ''above'' other nodes in the hierarchy will be rendered ''before'' the other nodes. So currently it'll be rendering our Dirt node, and then rendering the Grass node on top of the dirt.&lt;br /&gt;
&lt;br /&gt;
Again, the main map types need to be specified before the node can be rendered:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Diffuse'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
* Make sure the Diffuse section is highlighted in the top right of the Terrain Editor.&lt;br /&gt;
* In the ''File Name'' field of the '''Image Properties''' section, browse to a generic tiling grass texture.&lt;br /&gt;
** This example is using {{filename|textures/megagen/temperate/grass_04_d.tga}}&lt;br /&gt;
* Again you will want to set the ''Scale'' value to something other than 1 1, to tile your texture. Let's use 32 32 for this one.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Distribution'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
This is important now, since we need to control where this layer is visible. Pure white won't work, since that'll just completely cover our underlying Dirt node!&lt;br /&gt;
* Make sure the Distribution section is highlighted in the top right.&lt;br /&gt;
* Change the &amp;quot;Source Type&amp;quot; from ''texture'' to ''geometryBased''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Geometric Texture Distribution'''&lt;br /&gt;
----&lt;br /&gt;
[[Image:simplemega_geometric_distribution.png|thumb|300px|The geometric texture distribution settings of the second node]]&lt;br /&gt;
This is where it gets interesting! There are many settings to alter, and they can have a drastic effect on how different your terrain looks, so try playing around with different values if you're not happy with the initial results.&lt;br /&gt;
&lt;br /&gt;
* '''Altitude Lower''' - Enabling this will limit the lower parts of the terrain from receiving this node's textures.&lt;br /&gt;
** '''Altitude Lower Value''' - The Z height in world units that the node will be drawn above. The default of 0 means that any parts of your terrain mesh below Z=0 will not show any of this node's textures.&lt;br /&gt;
** '''Fuzziness''' - The amount of blur applied to the mask. The higher the value, the more blurry the boundary.&lt;br /&gt;
* '''Altitude Upper''' - Enabling this will limit the higher parts of the terrain from receiving this node's textures.&lt;br /&gt;
** '''Altitude Upper Value''' - The Z height in world units that the node will be drawn below. The default of 0 means that any parts of your terrain mesh above Z=0 will not show any of this node's textures.&lt;br /&gt;
** '''Fuzziness''' - The amount of blur applied to the mask. The higher the value, the more blurry the boundary.&lt;br /&gt;
&lt;br /&gt;
* '''Clamp Distribution To Edge''' - Leave this on Default.&lt;br /&gt;
&lt;br /&gt;
* '''Resolution''' - The size in pixels of the resulting mask. The default value of 256 is fine for nearly any terrain model.&lt;br /&gt;
&lt;br /&gt;
* '''Slope Lower''' - Enabling this will limit shallower angles of the terrain model from receiving this node's textures.&lt;br /&gt;
** '''Slope Lower Value''' - The angle in degrees that the node will be drawn past. The default angle of 0 will result in no change to your mask.&lt;br /&gt;
** '''Fuzziness''' - The amount of blur applied to the mask. The higher the value, the more blurry the boundary.&lt;br /&gt;
* '''Slope Upper''' - Enabling this will limit the steeper angles of the terrain model from receiving this node's textures. This is great for masking out cliffs from your nodes.&lt;br /&gt;
** '''Slope Upper Value''' - The angle in degrees that the node will be hidden past. The default angle of 0 will result in a fully black mask.&lt;br /&gt;
** '''Fuzziness''' - The amount of blur applied to the mask. The higher the value, the more blurry the boundary.&lt;br /&gt;
&lt;br /&gt;
The settings you use for each of these will vary depending on your terrain model, and the type of node you're making. For our Grass node, you can see the settings used for this example in the screenshot above on the right.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Distribution Pattern'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
[[Image:simplemega_dist_ramps.jpg|thumb|300px|The difference between using or not using a Distribution Pattern, and varying Ramp Widths]]&lt;br /&gt;
This controls how the the grass will blend into the dirt. If you don't have a Distribution Pattern texture, the grass will just slowly fade into the dirt, which doesn't look very natural!&lt;br /&gt;
So what we want here is a texture to identify the &amp;quot;height&amp;quot; of the areas of grass. This means that the dirt can blend in based on the height of each clump of grass, so instead of a smooth fade you will get a more natural blend between the grass and the dirt.&lt;br /&gt;
&lt;br /&gt;
If you examine the screenshot to the right, you can see what effect a good Distribution Pattern can have - when the node is rendered with no Distribution Pattern, the blend between the nodes is a simple smooth gradient, which does not look very natural at all. You can also see the difference that the '''Ramp Width''' value makes - this is a very powerful value, so experiment with it until you really understand the effect it has!&lt;br /&gt;
&lt;br /&gt;
* Make sure the Distribution Pattern section is highlighted in the top right.&lt;br /&gt;
* In the ''File Name'' field of the '''Image Properties''' section, browse to the matching heightmap or mask for your tiling grass texture.&lt;br /&gt;
** This example is using {{filename|textures/megagen/temperate/grass_04_mask.tga}}&lt;br /&gt;
* The ''Ramp Width'' should be set to a value lower than the default of 1, since this causes a very blurry blend, which is usually not what you want. Try a value of 0.25 and re-render the preview - try a &amp;quot;Window&amp;quot; preview as described earlier to get a full-resolution preview where you can really see the blend working.&lt;br /&gt;
* '''Important!''' You will also need to set the ''Distribution Pattern Texture Scale'' to the same value as the Diffuse Scale, in this case we just use 32 32 again.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Local'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
Again we want the normal-map which matches the diffuse texture for the grass.&lt;br /&gt;
* Make sure the Local section is highlighted in the top right.&lt;br /&gt;
* In the ''File Name'' field of the '''Image Properties''' section, browse to the matching normal map for your tiling grass texture.&lt;br /&gt;
** This example is using {{filename|textures/megagen/temperate/grass_04_local.tga}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Preview again!'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
[[Image:simplemega_secondnode_preview.jpg|thumb|300px|The Render mode preview of the second node blended with the first node]]&lt;br /&gt;
Now that's all set up, you can hit the Render Preview ([[Image:simplemega_previewbutton.png|MegaTexture Render Preview button]]) button again and see what effect the new Grass node has.&lt;br /&gt;
If it's being distributed into the wrong places, you can go back into your Distribution settings and tweak the values for the ''geometryBased'' settings. Then you can preview again until it looks right.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Adding a third node ==&lt;br /&gt;
[[Image:simplemega_thirdnode_preview.jpg|thumb|300px|The Render mode preview of the third node blended with the other two nodes]]&lt;br /&gt;
Now that the grass and dirt are in place, we need some rocks to make the terrain look more natural.&lt;br /&gt;
* Again, {{accelbtn|RMB}} on your &amp;quot;Root&amp;quot; node and choose ''New -&amp;gt; Image Source'' (or press {{accelkey|shift}}{{accelkey|i}})&lt;br /&gt;
* This will make another new node below your &amp;quot;Grass&amp;quot; node. &lt;br /&gt;
* Name this new node &amp;quot;Rock&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Again, the main map types need to be specified before the node can be rendered:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Diffuse'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
* In the ''File Name'' field of the '''Diffuse''' section, browse to a generic tiling rock texture.&lt;br /&gt;
** This example is using {{filename|textures/megagen/temperate/rock_01_d.tga}}&lt;br /&gt;
* Set the ''Scale'' value to 32 32.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Distribution'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
Again we can use Geometric Texture Distribution to easily apply the rock textures only to the cliff-like angles.&lt;br /&gt;
* Make sure the Distribution section is highlighted in the top right.&lt;br /&gt;
* Change the &amp;quot;Source Type&amp;quot; from ''texture'' to ''geometryBased''.&lt;br /&gt;
* To make the rock texture only appear on near vertical surfaces, set the ''Slope Lower Value'' to 23, and the ''Fuzziness'' of Slope Lower to 0.05&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Distribution Pattern'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
Again this will control how the the rocks blend into the other nodes. Again, we want a texture to identify the &amp;quot;height&amp;quot; of the tiling rock texture.&lt;br /&gt;
&lt;br /&gt;
* Make sure the Distribution Pattern section is highlighted in the top right.&lt;br /&gt;
* In the ''File Name'' field of the '''Image Properties''' section, browse to the matching heightmap or mask for your tiling rock texture.&lt;br /&gt;
** This example is using {{filename|textures/megagen/temperate/rock_01_h.tga}}&lt;br /&gt;
* The ''Ramp Width'' should be set to a value much lower than the default of 1, since this causes a very blurry blend, which is not natural for rocks blending with dirt. Try a value of 0.1 here, then render a &amp;quot;Window&amp;quot; preview to see how the blending looks.&lt;br /&gt;
* Remember to set the ''Distribution Pattern Texture Scale'' to the same value as the Diffuse Scale, 32 32.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Local'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
Again we want the normal-map which matches the diffuse texture for the rocks.&lt;br /&gt;
* In the ''File Name'' field of the '''Local''' section, browse to the matching normal map for your tiling rock texture.&lt;br /&gt;
** This example is using {{filename|textures/megagen/temperate/rock_01_local.tga}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Preview again!'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
Now that the rocks are set up, you can hit the Render Preview ([[Image:simplemega_previewbutton.png|MegaTexture Render Preview button]]) button again and see what effect the new Rock node has.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Further tweaks ==&lt;br /&gt;
There are other simple changes that can be done in the Terrain Editor to make your MegaTexture look even better.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Node order'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
[[Image:simplemega_node_order.png|frame|Click and drag a node to change the order]]&lt;br /&gt;
You may notice, if you look carefully at the blends between the rock and grass nodes, that some areas of the MegaTexture appear to show the rock texture ''on top'' of the grass! This doesn't look very natural, and it's happening because of the node order.&lt;br /&gt;
&lt;br /&gt;
Since the Rock node is below the Grass node, it will always be rendered on top of the grass. However, there is an easy way to fix this! In the node list of the Terrain Editor, you can click and drag any node to move it above or below existing nodes.&lt;br /&gt;
&lt;br /&gt;
* {{accelbtn|LMB}}-drag the Rock node and move it up in the list until you see a black bar appear between the Dirt and Grass nodes, as shown on the right.&lt;br /&gt;
* Release {{accelbtn|LMB}} when you have positioned the node in the correct place.&lt;br /&gt;
* With the Rock node now positioned between the Dirt and Grass nodes, the grass will appear on top of the rocks as well as the dirt, which looks much more natural!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Color changes'''&amp;lt;/big&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
Maybe your dirt texture is too bright? Or maybe your grass looks a little ''too'' green?&lt;br /&gt;
You can easily fix this from the Terrain Editor itself! No need to create a new image every time you want to tweak the color or brightness, you can set this up on a per-node basis.&lt;br /&gt;
&lt;br /&gt;
Let's say you want to make the dirt texture darker and a bit more red. Here's how you'd do it:&lt;br /&gt;
* Select your Dirt node.&lt;br /&gt;
* Look under the ''Color Properties'' area in the property list, and {{accelbtn|LMB}} on the '''Color''' swatch (next to where it says 1 1 1, which is white).&lt;br /&gt;
* A color wheel and brightness slider will pop up in a new window. You can use this to darken and tint your texture.&lt;br /&gt;
* Choose a darker brightness, and a color slightly towards red. I used '''RGB Values''' of 225, 220, 220.&lt;br /&gt;
* Hit ''OK'' to accept the color.&lt;br /&gt;
* Re-render your MegaTexture preview. You should notice that the dirt layer looks darker now!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= That's it! =&lt;br /&gt;
[[Image:simplemega_ingame.jpg|thumb|300px|The MegaTexture in-game!]]&lt;br /&gt;
You've now created your very own MegaTexture to use in your map!&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
= See Also =&lt;br /&gt;
* [[An Advanced Terrain and Megatexture]] - an advanced guide for complete MegaTexture creation&lt;br /&gt;
* [[Generate a MegaTexture]] - steps for generating a MegaTexture from the SDK launcher.&lt;br /&gt;
&lt;br /&gt;
[[Category:Art]]&lt;br /&gt;
[[Category:Basic Level Design]]&lt;br /&gt;
[[Category:Tutorials]]&lt;/div&gt;</summary>
		<author><name>MoP</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.splashdamage.com/index.php?title=File:Simplemega_node_order.png&amp;diff=4003</id>
		<title>File:Simplemega node order.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.splashdamage.com/index.php?title=File:Simplemega_node_order.png&amp;diff=4003"/>
		<updated>2007-12-12T16:38:14Z</updated>

		<summary type="html">&lt;p&gt;MoP: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>MoP</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.splashdamage.com/index.php?title=File:Simplemega_thirdnode_preview.jpg&amp;diff=4000</id>
		<title>File:Simplemega thirdnode preview.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.splashdamage.com/index.php?title=File:Simplemega_thirdnode_preview.jpg&amp;diff=4000"/>
		<updated>2007-12-12T16:29:15Z</updated>

		<summary type="html">&lt;p&gt;MoP: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>MoP</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.splashdamage.com/index.php?title=A_Simple_First_Megatexture&amp;diff=3995</id>
		<title>A Simple First Megatexture</title>
		<link rel="alternate" type="text/html" href="https://wiki.splashdamage.com/index.php?title=A_Simple_First_Megatexture&amp;diff=3995"/>
		<updated>2007-12-12T14:17:00Z</updated>

		<summary type="html">&lt;p&gt;MoP: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;So now that you've made [[A Simple First Terrain]], no doubt you'll want to apply a MegaTexture to it! This MegaTexture won't be as detailed or as attractive as an advanced MegaTexture, but will demonstrate the basics of creating a [[Surface Tree]], assigning textures, and compiling it all into a working MegaTexture file.&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
'''For this tutorial you must:'''&lt;br /&gt;
* Have a terrain model UV-mapped in the 0-1 range (covered in the simple first terrain tutorial)&lt;br /&gt;
* Have access to some tiling textures. TODO: Link to MegaTexture media!&lt;br /&gt;
* Have a little understanding the ETQW material system&lt;br /&gt;
&lt;br /&gt;
If you don't have any of the above things, you are not ready to do this tutorial!&lt;br /&gt;
&lt;br /&gt;
'''This tutorial covers:'''&lt;br /&gt;
* How to set up a MegaTexture material&lt;br /&gt;
* How to create a Surface Tree&lt;br /&gt;
* How to add texture nodes in the Terrain Editor&lt;br /&gt;
* How to render and compile a full MegaTexture&lt;br /&gt;
&lt;br /&gt;
'''This tutorial does not cover:'''&lt;br /&gt;
* How to use Blender/Maya/Lightwave/ZBrush/Mudbox/3DSMax/Photoshop&lt;br /&gt;
* How to create tiling textures or heightmaps&lt;br /&gt;
* Anything overly complicated&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Creating a MegaTexture material =&lt;br /&gt;
Firstly you need to create a new material for your terrain to use. If you have never made a new material before, read the article on [[Adding Custom Textures]]. All you need to do is create (or use an existing) ''.mtr'' file and place a material declaration in it, in the manner shown here:&lt;br /&gt;
 material megatextures/mapname		{ useTemplate megatextures/default_ambient&amp;lt; &amp;quot;mapname&amp;quot; &amp;gt; }&lt;br /&gt;
&lt;br /&gt;
This material would automatically search for a MegaTexture called {{filename|mapname.mega}} in the {{filename|/megatextures/}} folder. This example material uses the ''&amp;quot;default_ambient&amp;quot;'' template, which expects a 3-channel RGB MegaTexture. These are generated by the default settings of the [[Generate a MegaTexture|MegaTexture tab in the SDK Launcher]].&lt;br /&gt;
&lt;br /&gt;
Obviously you would want to use the actual name of your map instead of &amp;quot;mapname&amp;quot;, for consistency's sake and ease of reference.&lt;br /&gt;
&lt;br /&gt;
Remember that if you made a new ''.mtr'' file after the game or editor was started, you'll have to restart the whole game and editor before it will read your new file.&lt;br /&gt;
&lt;br /&gt;
=== Assigning the material ===&lt;br /&gt;
You should assign the material you just created by naming a material in your 3D application and applying it to your terrain mesh, then export the model to your preferred format (LWO, ASE or OBJ).&lt;br /&gt;
Tips on this process can be found in the [[A Simple First Terrain|simple first terrain tutorial]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Creating the Surface Tree =&lt;br /&gt;
As described in the Simple First Terrain tutorial, terrain models are set up in the Terrain Editor, accessible via {{accelkey|shift}}{{accelkey|N}} in [[editWorld]]. This tool creates a Surface Tree file ({{filename|.sft}}) that contains all the information about the terrain, including roads, stamps, and detail texture information that MegaGen needs to generate a MegaTexture.&lt;br /&gt;
[[Image:simplemega_terrainmodel.png|thumb|300px|Root node set up to use the correct terrain mesh]]&lt;br /&gt;
&lt;br /&gt;
=== Add the terrain mesh ===&lt;br /&gt;
Here's how you bring the terrain mesh into the surface tree:&lt;br /&gt;
* {{accelbtn|RMB}} on the left-hand pane, and choose ''New -&amp;gt; Tree'' via the menu.&lt;br /&gt;
** If you already have a Root node, click the &amp;quot;Begin Editing&amp;quot; button instead.&lt;br /&gt;
* Click on the Root node, and set {{keyname|Model}} to the name of the terrain mesh, in this case {{keyvalue|models/terrain/simpleterrain.obj}}.&lt;br /&gt;
* Press {{accelkey|enter}} to confirm the selection, and the terrain should appear in the 3D view.&lt;br /&gt;
&lt;br /&gt;
Be aware that your terrain model will probably appear bright orange or red.&lt;br /&gt;
The console will probably give you a few WARNING messages, don't worry about these for now, this is because your Megatexture doesn't exist yet!&lt;br /&gt;
&lt;br /&gt;
=== Important note about nodes ===&lt;br /&gt;
When you are editing properties of nodes (names, numbers, texture sources etc.) always remember to hit {{accelkey|enter}} after changing a value, to make sure that the value is stored. If you just type something in and then click somewhere else without pressing {{accelkey|enter}}, your changes may not be applied.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Create the first texture node ==&lt;br /&gt;
[[Image:simplemega_firstnode_diffuse.png|thumb|300px|The first texture node's diffuse texture properties]]&lt;br /&gt;
Now that the model is in place, you can start laying down the texture layers (or &amp;quot;nodes&amp;quot;) that will make up your MegaTexture.&lt;br /&gt;
&lt;br /&gt;
First you need to create a new Image Source node in the Terrain Editor.&lt;br /&gt;
* {{accelbtn|RMB}} on your &amp;quot;Root&amp;quot; node and choose ''New -&amp;gt; Image Source'' (or press {{accelkey|shift}}{{accelkey|i}})&lt;br /&gt;
* This will make a new node called &amp;quot;New Image Renderer&amp;quot;. You can rename this using the &amp;quot;Name&amp;quot; property field in the '''Object''' section.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You will notice in the top right of the Terrain Editor, a section listing things like &amp;quot;Diffuse&amp;quot;, &amp;quot;Distribution&amp;quot;, &amp;quot;Distribution Pattern&amp;quot; etc. Selecting one of these will list all of the properties for that section of the current node.&lt;br /&gt;
The ones we need to worry about are as follows:&lt;br /&gt;
&lt;br /&gt;
=== Diffuse ===&lt;br /&gt;
This is the colour map of the current node, and it should point to a tiling TGA texture.&lt;br /&gt;
* Make sure the Diffuse section is highlighted in the top right of the Terrain Editor.&lt;br /&gt;
* In the ''File Name'' field of the '''Image Properties''' section, browse to a generic tiling dirt texture. Remember to hit {{accelkey|enter}} afterwards!&lt;br /&gt;
** This example is using {{filename|textures/megagen/temperate/dirt_02_d.tga}}&lt;br /&gt;
* The ''Scale'' field at the very bottom of the property list allows you to choose how much to tile the texture.&lt;br /&gt;
** The default value is 1 1, but you don't want that since it will stretch your texture over the whole mesh, and look really blurry!&lt;br /&gt;
** Instead set the Scale to something like 48 48, this means that the texture will be repeated 48 times across each axis of the terrain. This results in a sharper final output.&lt;br /&gt;
That's all you need to do for the Diffuse settings in this node.&lt;br /&gt;
&lt;br /&gt;
=== Distribution ===&lt;br /&gt;
This is how we control where the layer is drawn (ie. no grass underwater, no sand on angles over 60 degrees etc). It's basically a big mask where ''white = fully shown'' and ''black = fully hidden''.&lt;br /&gt;
* Make sure the Distribution section is highlighted in the top right.&lt;br /&gt;
* Since this is our first node, we want to show over the whole terrain. This means the distribution map should be 100% white.&lt;br /&gt;
* You can either assign a pure white TGA texture, or change the ''Source Type'' to ''geometryBased''.&lt;br /&gt;
** ''geometryBased'' will by default create a fully white map, so if you don't have a white TGA handy, this is faster.&lt;br /&gt;
&lt;br /&gt;
=== Distribution Pattern ===&lt;br /&gt;
This controls how the current node blends into others. Usually this will be set to a tiling TGA heightmap texture that matches the Diffuse texture.&lt;br /&gt;
* We don't need a Distribution Pattern for the first node, since it doesn't blend with anything. Nodes on top of this one will need Distribution Patterns for more interesting and natural blends though!&lt;br /&gt;
&lt;br /&gt;
=== Local ===&lt;br /&gt;
This is the normal-map of the current node. This should be a tiling TGA texture representing the local normal information of the matching Diffuse texture.&lt;br /&gt;
* Make sure the Local section is highlighted in the top right.&lt;br /&gt;
* In the ''File Name'' field of the '''Image Properties''' section, browse to the matching normal map for your tiling dirt texture.&lt;br /&gt;
** This example is using {{filename|textures/megagen/temperate/dirt_02_local.tga}}&lt;br /&gt;
* The Local texture's tiling amount is automatically the same as the Diffuse texture.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Previewing the result ==&lt;br /&gt;
[[Image:simplemega_firstnode_preview.jpg|thumb|300px|The Render mode preview of the first node]]&lt;br /&gt;
Now we can easily check if this is all set up correctly. You should notice a little icon at the top left of your Terrain Editor which looks like this: [[Image:simplemega_previewbutton.png|MegaTexture Render Preview button]]&lt;br /&gt;
&lt;br /&gt;
* Notice the drop-down arrow on the right of the button. Click it, and select ''&amp;quot;Full&amp;quot;'' instead of ''&amp;quot;None&amp;quot;''.&lt;br /&gt;
* Your terrain should change colour to black. This means it's ready for a preview to be rendered onto it.&lt;br /&gt;
* Click the button itself now, instead of the drop-down. An &amp;quot;Active Tasks&amp;quot; window should pop up, and when it's done, you should see your dirt texture appear on your terrain model.&lt;br /&gt;
* You can switch the camera to Render mode too, which will show your terrain model's shading better.&lt;br /&gt;
* If you want a full-resolution preview of a small area, choose ''&amp;quot;Window&amp;quot;'' instead of ''&amp;quot;Full&amp;quot;'' from the drop-down menu.&lt;br /&gt;
** This creates a small window that you can move around using {{accelbtn|LMB}}-drag in the XY Top view. Simply position the window where you want to preview the full-resolution MegaTexture, and hit the Render Preview button.&lt;br /&gt;
&lt;br /&gt;
Now any time you add new nodes, or change a node's properties, you can just click the Render Preview button and the view will update with your changes.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Adding a second node ==&lt;br /&gt;
Now that the first layer of dirt is in place, we can try putting some grass on top of it!&lt;br /&gt;
* Again, {{accelbtn|RMB}} on your &amp;quot;Root&amp;quot; node and choose ''New -&amp;gt; Image Source'' (or press {{accelkey|shift}}{{accelkey|i}})&lt;br /&gt;
* This will make another new node below your &amp;quot;Dirt&amp;quot; node. &lt;br /&gt;
* Name this new node &amp;quot;Grass&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Surface Tree hierarchy is rendered from the top down, so nodes ''above'' other nodes in the hierarchy will be rendered ''before'' the other nodes. So currently it'll be rendering our Dirt node, and then rendering the Grass node on top of the dirt.&lt;br /&gt;
&lt;br /&gt;
Again, the main map types need to be specified before the node can be rendered:&lt;br /&gt;
&lt;br /&gt;
=== Diffuse ===&lt;br /&gt;
* Make sure the Diffuse section is highlighted in the top right of the Terrain Editor.&lt;br /&gt;
* In the ''File Name'' field of the '''Image Properties''' section, browse to a generic tiling grass texture.&lt;br /&gt;
** This example is using {{filename|textures/megagen/temperate/grass_04_d.tga}}&lt;br /&gt;
* Again you will want to set the ''Scale'' value to something other than 1 1, to tile your texture. Let's use 32 32 for this one.&lt;br /&gt;
&lt;br /&gt;
=== Distribution ===&lt;br /&gt;
This is important now, since we need to control where this layer is visible. Pure white won't work, since that'll just completely cover our underlying Dirt node!&lt;br /&gt;
* Make sure the Distribution section is highlighted in the top right.&lt;br /&gt;
* Change the ''Source Type'' from ''texture'' to ''geometryBased''.&lt;br /&gt;
&lt;br /&gt;
==== Geometric Texture Distribution ====&lt;br /&gt;
[[Image:simplemega_geometric_distribution.png|thumb|300px|The geometric texture distribution settings of the second node]]&lt;br /&gt;
This is where it gets interesting! There are many settings to alter, and they can have a drastic effect on how different your terrain looks, so try playing around with different values if you're not happy with the initial results.&lt;br /&gt;
&lt;br /&gt;
* '''Altitude Lower''' - Enabling this will limit the lower parts of the terrain from receiving this node's textures.&lt;br /&gt;
** '''Altitude Lower Value''' - The Z height in world units that the node will be drawn above. The default of 0 means that any parts of your terrain mesh below Z=0 will not show any of this node's textures.&lt;br /&gt;
** '''Fuzziness''' - The amount of blur applied to the mask. The higher the value, the more blurry the boundary.&lt;br /&gt;
* '''Altitude Upper''' - Enabling this will limit the higher parts of the terrain from receiving this node's textures.&lt;br /&gt;
** '''Altitude Upper Value''' - The Z height in world units that the node will be drawn below. The default of 0 means that any parts of your terrain mesh above Z=0 will not show any of this node's textures.&lt;br /&gt;
** '''Fuzziness''' - The amount of blur applied to the mask. The higher the value, the more blurry the boundary.&lt;br /&gt;
&lt;br /&gt;
* '''Clamp Distribution To Edge''' - Leave this on Default.&lt;br /&gt;
&lt;br /&gt;
* '''Resolution''' - The size in pixels of the resulting mask. The default value of 256 is fine for nearly any terrain model.&lt;br /&gt;
&lt;br /&gt;
* '''Slope Lower''' - Enabling this will limit shallower angles of the terrain model from receiving this node's textures.&lt;br /&gt;
** '''Slope Lower Value''' - The angle in degrees that the node will be drawn past. The default angle of 0 will result in no change to your mask.&lt;br /&gt;
** '''Fuzziness''' - The amount of blur applied to the mask. The higher the value, the more blurry the boundary.&lt;br /&gt;
* '''Slope Upper''' - Enabling this will limit the steeper angles of the terrain model from receiving this node's textures. This is great for masking out cliffs from your nodes.&lt;br /&gt;
** '''Slope Upper Value''' - The angle in degrees that the node will be hidden past. The default angle of 0 will result in a fully black mask.&lt;br /&gt;
** '''Fuzziness''' - The amount of blur applied to the mask. The higher the value, the more blurry the boundary.&lt;br /&gt;
&lt;br /&gt;
The settings you use for each of these will vary depending on your terrain model, and the type of node you're making. For our Grass node, you can see the settings used for this example in the screenshot above on the right.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
=== Distribution Pattern ===&lt;br /&gt;
[[Image:simplemega_dist_ramps.jpg|thumb|300px|The difference between using or not using a Distribution Pattern, and varying Ramp Widths]]&lt;br /&gt;
This controls how the the grass will blend into the dirt. If you don't have a Distribution Pattern texture, the grass will just slowly fade into the dirt, which doesn't look very natural!&lt;br /&gt;
So what we want here is a texture to identify the &amp;quot;height&amp;quot; of the areas of grass. This means that the dirt can blend in based on the height of each clump of grass, so instead of a smooth fade you will get a more natural blend between the grass and the dirt.&lt;br /&gt;
&lt;br /&gt;
If you examine the screenshot to the right, you can see what effect a good Distribution Pattern can have - when the node is rendered with no Distribution Pattern, the blend between the nodes is a simple smooth gradient, which does not look very natural at all. You can also see the difference that the '''Ramp Width''' value makes - this is a very powerful value, so experiment with it until you really understand the effect it has!&lt;br /&gt;
&lt;br /&gt;
* Make sure the Distribution Pattern section is highlighted in the top right.&lt;br /&gt;
* In the ''File Name'' field of the '''Image Properties''' section, browse to the matching heightmap or mask for your tiling grass texture.&lt;br /&gt;
** This example is using {{filename|textures/megagen/temperate/grass_04_mask.tga}}&lt;br /&gt;
* The ''Ramp Width'' should be set to a value lower than the default of 1, since this causes a very blurry blend, which is usually not what you want. Try a value of 0.25 and re-render the preview - try a &amp;quot;Window&amp;quot; preview as described earlier to get a full-resolution preview where you can really see the blend working.&lt;br /&gt;
* '''Important!''' You will also need to set the ''Distribution Pattern Texture Scale'' to the same value as the Diffuse Scale, in this case we just use 32 32 again.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
=== Local ===&lt;br /&gt;
Again we want the normal-map which matches the diffuse texture for the grass.&lt;br /&gt;
* Make sure the Local section is highlighted in the top right.&lt;br /&gt;
* In the ''File Name'' field of the '''Image Properties''' section, browse to the matching normal map for your tiling grass texture.&lt;br /&gt;
** This example is using {{filename|textures/megagen/temperate/grass_04_local.tga}}&lt;br /&gt;
&lt;br /&gt;
=== Preview again! ===&lt;br /&gt;
[[Image:simplemega_secondnode_preview.jpg|thumb|300px|The Render mode preview of the second node blended with the first node]]&lt;br /&gt;
Now that's all set up, you can hit the Render Preview ([[Image:simplemega_previewbutton.png|MegaTexture Render Preview button]]) button again and see what effect the new Grass node has.&lt;br /&gt;
If it's being distributed into the wrong places, you can go back into your Distribution settings and tweak the values for the ''geometryBased'' settings. Then you can preview again until it looks right.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Adding a third node ==&lt;br /&gt;
Now that the grass and dirt are in place, we need some rocks to make the terrain look more natural.&lt;br /&gt;
* Again, {{accelbtn|RMB}} on your &amp;quot;Root&amp;quot; node and choose ''New -&amp;gt; Image Source'' (or press {{accelkey|shift}}{{accelkey|i}})&lt;br /&gt;
* This will make another new node below your &amp;quot;Grass&amp;quot; node. &lt;br /&gt;
* Name this new node &amp;quot;Rock&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Again, the main map types need to be specified before the node can be rendered:&lt;br /&gt;
&lt;br /&gt;
=== Diffuse ===&lt;br /&gt;
* In the ''File Name'' field of the ''Diffuse'' section, browse to a generic tiling rock texture.&lt;br /&gt;
** This example is using {{filename|textures/megagen/temperate/grass_04_d.tga}}&lt;br /&gt;
* Again you will want to set the ''Scale'' value to something other than 1 1, to tile your texture. Let's use 32 32 for this one.&lt;br /&gt;
&lt;br /&gt;
=== Distribution ===&lt;br /&gt;
This is important now, since we need to control where this layer is visible. Pure white won't work, since that'll just completely cover our underlying Dirt node!&lt;br /&gt;
* Make sure the Distribution section is highlighted in the top right.&lt;br /&gt;
* Change the ''Source Type'' from ''texture'' to ''geometryBased''.&lt;br /&gt;
&lt;br /&gt;
==== Geometric Texture Distribution ====&lt;br /&gt;
[[Image:simplemega_geometric_distribution.png|thumb|300px|The geometric texture distribution settings of the second node]]&lt;br /&gt;
This is where it gets interesting! There are many settings to alter, and they can have a drastic effect on how different your terrain looks, so try playing around with different values if you're not happy with the initial results.&lt;br /&gt;
&lt;br /&gt;
* '''Altitude Lower''' - Enabling this will limit the lower parts of the terrain from receiving this node's textures.&lt;br /&gt;
** '''Altitude Lower Value''' - The Z height in world units that the node will be drawn above. The default of 0 means that any parts of your terrain mesh below Z=0 will not show any of this node's textures.&lt;br /&gt;
** '''Fuzziness''' - The amount of blur applied to the mask. The higher the value, the more blurry the boundary.&lt;br /&gt;
* '''Altitude Upper''' - Enabling this will limit the higher parts of the terrain from receiving this node's textures.&lt;br /&gt;
** '''Altitude Upper Value''' - The Z height in world units that the node will be drawn below. The default of 0 means that any parts of your terrain mesh above Z=0 will not show any of this node's textures.&lt;br /&gt;
** '''Fuzziness''' - The amount of blur applied to the mask. The higher the value, the more blurry the boundary.&lt;br /&gt;
&lt;br /&gt;
* '''Clamp Distribution To Edge''' - Leave this on Default.&lt;br /&gt;
&lt;br /&gt;
* '''Resolution''' - The size in pixels of the resulting mask. The default value of 256 is fine for nearly any terrain model.&lt;br /&gt;
&lt;br /&gt;
* '''Slope Lower''' - Enabling this will limit shallower angles of the terrain model from receiving this node's textures.&lt;br /&gt;
** '''Slope Lower Value''' - The angle in degrees that the node will be drawn past. The default angle of 0 will result in no change to your mask.&lt;br /&gt;
** '''Fuzziness''' - The amount of blur applied to the mask. The higher the value, the more blurry the boundary.&lt;br /&gt;
* '''Slope Upper''' - Enabling this will limit the steeper angles of the terrain model from receiving this node's textures. This is great for masking out cliffs from your nodes.&lt;br /&gt;
** '''Slope Upper Value''' - The angle in degrees that the node will be hidden past. The default angle of 0 will result in a fully black mask.&lt;br /&gt;
** '''Fuzziness''' - The amount of blur applied to the mask. The higher the value, the more blurry the boundary.&lt;br /&gt;
&lt;br /&gt;
The settings you use for each of these will vary depending on your terrain model, and the type of node you're making. For our Grass node, you can see the settings used for this example in the screenshot above on the right.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
=== Distribution Pattern ===&lt;br /&gt;
[[Image:simplemega_dist_ramps.jpg|thumb|300px|The difference between using or not using a Distribution Pattern, and varying Ramp Widths]]&lt;br /&gt;
This controls how the the grass will blend into the dirt. If you don't have a Distribution Pattern texture, the grass will just slowly fade into the dirt, which doesn't look very natural!&lt;br /&gt;
So what we want here is a texture to identify the &amp;quot;height&amp;quot; of the areas of grass. This means that the dirt can blend in based on the height of each clump of grass, so instead of a smooth fade you will get a more natural blend between the grass and the dirt.&lt;br /&gt;
&lt;br /&gt;
If you examine the screenshot to the right, you can see what effect a good Distribution Pattern can have - when the node is rendered with no Distribution Pattern, the blend between the nodes is a simple smooth gradient, which does not look very natural at all. You can also see the difference that the '''Ramp Width''' value makes - this is a very powerful value, so experiment with it until you really understand the effect it has!&lt;br /&gt;
&lt;br /&gt;
* Make sure the Distribution Pattern section is highlighted in the top right.&lt;br /&gt;
* In the ''File Name'' field of the '''Image Properties''' section, browse to the matching heightmap or mask for your tiling grass texture.&lt;br /&gt;
** This example is using {{filename|textures/megagen/temperate/grass_04_mask.tga}}&lt;br /&gt;
* The ''Ramp Width'' should be set to a value lower than the default of 1, since this causes a very blurry blend, which is usually not what you want. Try a value of 0.25 and re-render the preview - try a &amp;quot;Window&amp;quot; preview as described earlier to get a full-resolution preview where you can really see the blend working.&lt;br /&gt;
* '''Important!''' You will also need to set the ''Distribution Pattern Texture Scale'' to the same value as the Diffuse Scale, in this case we just use 32 32 again.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
=== Local ===&lt;br /&gt;
Again we want the normal-map which matches the diffuse texture for the grass.&lt;br /&gt;
* Make sure the Local section is highlighted in the top right.&lt;br /&gt;
* In the ''File Name'' field of the '''Image Properties''' section, browse to the matching normal map for your tiling grass texture.&lt;br /&gt;
** This example is using {{filename|textures/megagen/temperate/grass_04_local.tga}}&lt;br /&gt;
&lt;br /&gt;
=== Preview again! ===&lt;br /&gt;
[[Image:simplemega_secondnode_preview.jpg|thumb|300px|The Render mode preview of the second node blended with the first node]]&lt;br /&gt;
Now that's all set up, you can hit the Render Preview ([[Image:simplemega_previewbutton.png|MegaTexture Render Preview button]]) button again and see what effect the new Grass node has.&lt;br /&gt;
If it's being distributed into the wrong places, you can go back into your Distribution settings and tweak the values for the ''geometryBased'' settings. Then you can preview again until it looks right.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
= That's it! =&lt;br /&gt;
[[Image:simplemega_ingame.jpg|thumb|300px|The MegaTexture in-game!]]&lt;br /&gt;
You've now created your very own MegaTexture to use in your map!&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
= See Also =&lt;br /&gt;
* [[An Advanced Terrain and Megatexture]] - an advanced guide for complete MegaTexture creation&lt;br /&gt;
* [[Generate a MegaTexture]] - steps for generating a MegaTexture from the SDK launcher.&lt;br /&gt;
&lt;br /&gt;
[[Category:Art]]&lt;br /&gt;
[[Category:Basic Level Design]]&lt;br /&gt;
[[Category:Tutorials]]&lt;/div&gt;</summary>
		<author><name>MoP</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.splashdamage.com/index.php?title=File:Simplemega_dist_ramps.jpg&amp;diff=3994</id>
		<title>File:Simplemega dist ramps.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.splashdamage.com/index.php?title=File:Simplemega_dist_ramps.jpg&amp;diff=3994"/>
		<updated>2007-12-12T11:16:15Z</updated>

		<summary type="html">&lt;p&gt;MoP: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>MoP</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.splashdamage.com/index.php?title=A_Simple_First_Megatexture&amp;diff=3987</id>
		<title>A Simple First Megatexture</title>
		<link rel="alternate" type="text/html" href="https://wiki.splashdamage.com/index.php?title=A_Simple_First_Megatexture&amp;diff=3987"/>
		<updated>2007-12-11T18:50:09Z</updated>

		<summary type="html">&lt;p&gt;MoP: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;So now that you've made [[A Simple First Terrain]], no doubt you'll want to apply a MegaTexture to it! This MegaTexture won't be as detailed or as attractive as an advanced MegaTexture, but will demonstrate the basics of creating a [[Surface Tree]], assigning textures, and compiling it all into a working MegaTexture file.&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
'''For this tutorial you must:'''&lt;br /&gt;
* Have a terrain model UV-mapped in the 0-1 range (covered in the simple first terrain tutorial)&lt;br /&gt;
* Have access to some tiling textures. TODO: Link to MegaTexture media!&lt;br /&gt;
* Have a little understanding the ETQW material system&lt;br /&gt;
&lt;br /&gt;
If you don't have any of the above things, you are not ready to do this tutorial!&lt;br /&gt;
&lt;br /&gt;
'''This tutorial covers:'''&lt;br /&gt;
* How to set up a MegaTexture material&lt;br /&gt;
* How to create a Surface Tree&lt;br /&gt;
* How to add texture nodes in the Terrain Editor&lt;br /&gt;
* How to render and compile a full MegaTexture&lt;br /&gt;
&lt;br /&gt;
'''This tutorial does not cover:'''&lt;br /&gt;
* How to use Blender/Maya/Lightwave/ZBrush/Mudbox/3DSMax/Photoshop&lt;br /&gt;
* How to create tiling textures or heightmaps&lt;br /&gt;
* Anything overly complicated&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Creating a MegaTexture material =&lt;br /&gt;
Firstly you need to create a new material for your terrain to use. If you have never made a new material before, read the article on [[Adding Custom Textures]]. All you need to do is create (or use an existing) ''.mtr'' file and place a material declaration in it, in the manner shown here:&lt;br /&gt;
 material megatextures/mapname		{ useTemplate megatextures/default_ambient&amp;lt; &amp;quot;mapname&amp;quot; &amp;gt; }&lt;br /&gt;
&lt;br /&gt;
This material would automatically search for a MegaTexture called {{filename|mapname.mega}} in the {{filename|/megatextures/}} folder. This example material uses the ''&amp;quot;default_ambient&amp;quot;'' template, which expects a 3-channel RGB MegaTexture. These are generated by the default settings of the [[Generate a MegaTexture|MegaTexture tab in the SDK Launcher]].&lt;br /&gt;
&lt;br /&gt;
Obviously you would want to use the actual name of your map instead of &amp;quot;mapname&amp;quot;, for consistency's sake and ease of reference.&lt;br /&gt;
&lt;br /&gt;
Remember that if you made a new ''.mtr'' file after the game or editor was started, you'll have to restart the whole game and editor before it will read your new file.&lt;br /&gt;
&lt;br /&gt;
=== Assigning the material ===&lt;br /&gt;
You should assign the material you just created by naming a material in your 3D application and applying it to your terrain mesh, then export the model to your preferred format (LWO, ASE or OBJ).&lt;br /&gt;
Tips on this process can be found in the [[A Simple First Terrain|simple first terrain tutorial]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Creating the Surface Tree =&lt;br /&gt;
As described in the Simple First Terrain tutorial, terrain models are set up in the Terrain Editor, accessible via {{accelkey|shift}}{{accelkey|N}} in [[editWorld]]. This tool creates a Surface Tree file ({{filename|.sft}}) that contains all the information about the terrain, including roads, stamps, and detail texture information that MegaGen needs to generate a MegaTexture.&lt;br /&gt;
[[Image:simplemega_terrainmodel.png|thumb|300px|Root node set up to use the correct terrain mesh]]&lt;br /&gt;
&lt;br /&gt;
=== Add the terrain mesh ===&lt;br /&gt;
Here's how you bring the terrain mesh into the surface tree:&lt;br /&gt;
* {{accelbtn|RMB}} on the left-hand pane, and choose ''New -&amp;gt; Tree'' via the menu.&lt;br /&gt;
** If you already have a Root node, click the &amp;quot;Begin Editing&amp;quot; button instead.&lt;br /&gt;
* Click on the Root node, and set {{keyname|Model}} to the name of the terrain mesh, in this case {{keyvalue|models/terrain/simpleterrain.obj}}.&lt;br /&gt;
* Press {{accelkey|enter}} to confirm the selection, and the terrain should appear in the 3D view.&lt;br /&gt;
&lt;br /&gt;
Be aware that your terrain model will probably appear bright orange or red.&lt;br /&gt;
The console will probably give you a few WARNING messages, don't worry about these for now, this is because your Megatexture doesn't exist yet!&lt;br /&gt;
&lt;br /&gt;
=== Important note about nodes ===&lt;br /&gt;
When you are editing properties of nodes (names, numbers, texture sources etc.) always remember to hit {{accelkey|enter}} after changing a value, to make sure that the value is stored. If you just type something in and then click somewhere else without pressing {{accelkey|enter}}, your changes may not be applied.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Create the first texture node ==&lt;br /&gt;
[[Image:simplemega_firstnode_diffuse.png|thumb|300px|The first texture node's diffuse texture properties]]&lt;br /&gt;
Now that the model is in place, you can start laying down the texture layers (or &amp;quot;nodes&amp;quot;) that will make up your MegaTexture.&lt;br /&gt;
&lt;br /&gt;
First you need to create a new Image Source node in the Terrain Editor.&lt;br /&gt;
* {{accelbtn|RMB}} on your &amp;quot;Root&amp;quot; node and choose ''New -&amp;gt; Image Source'' (or press {{accelkey|shift}}{{accelkey|i}})&lt;br /&gt;
* This will make a new node called &amp;quot;New Image Renderer&amp;quot;. You can rename this using the &amp;quot;Name&amp;quot; property field in the '''Object''' section.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You will notice in the top right of the Terrain Editor, a section listing things like &amp;quot;Diffuse&amp;quot;, &amp;quot;Distribution&amp;quot;, &amp;quot;Distribution Pattern&amp;quot; etc. Selecting one of these will list all of the properties for that section of the current node.&lt;br /&gt;
The ones we need to worry about are as follows:&lt;br /&gt;
&lt;br /&gt;
=== Diffuse ===&lt;br /&gt;
This is the colour map of the current node, and it should point to a tiling TGA texture.&lt;br /&gt;
* Make sure the Diffuse section is highlighted in the top right of the Terrain Editor.&lt;br /&gt;
* In the ''File Name'' field of the '''Image Properties''' section, browse to a generic tiling dirt texture. Remember to hit {{accelkey|enter}} afterwards!&lt;br /&gt;
** This example is using {{filename|textures/megagen/temperate/dirt_02_d.tga}}&lt;br /&gt;
* The ''Scale'' field at the very bottom of the property list allows you to choose how much to tile the texture.&lt;br /&gt;
** The default value is 1 1, but you don't want that since it will stretch your texture over the whole mesh, and look really blurry!&lt;br /&gt;
** Instead set the Scale to something like 48 48, this means that the texture will be repeated 48 times across each axis of the terrain. This results in a sharper final output.&lt;br /&gt;
That's all you need to do for the Diffuse settings in this node.&lt;br /&gt;
&lt;br /&gt;
=== Distribution ===&lt;br /&gt;
This is how we control where the layer is drawn (ie. no grass underwater, no sand on angles over 60 degrees etc). It's basically a big mask where ''white = fully shown'' and ''black = fully hidden''.&lt;br /&gt;
* Make sure the Distribution section is highlighted in the top right.&lt;br /&gt;
* Since this is our first node, we want to show over the whole terrain. This means the distribution map should be 100% white.&lt;br /&gt;
* You can either assign a pure white TGA texture, or change the ''Source Type'' to ''geometryBased''.&lt;br /&gt;
** ''geometryBased'' will by default create a fully white map, so if you don't have a white TGA handy, this is faster.&lt;br /&gt;
&lt;br /&gt;
=== Distribution Pattern ===&lt;br /&gt;
This controls how the current node blends into others. Usually this will be set to a tiling TGA heightmap texture that matches the Diffuse texture.&lt;br /&gt;
* We don't need a Distribution Pattern for the first node, since it doesn't blend with anything. Nodes on top of this one will need Distribution Patterns for more interesting and natural blends though!&lt;br /&gt;
&lt;br /&gt;
=== Local ===&lt;br /&gt;
This is the normal-map of the current node. This should be a tiling TGA texture representing the local normal information of the matching Diffuse texture.&lt;br /&gt;
* Make sure the Local section is highlighted in the top right.&lt;br /&gt;
* In the ''File Name'' field of the '''Image Properties''' section, browse to the matching normal map for your tiling dirt texture.&lt;br /&gt;
** This example is using {{filename|textures/megagen/temperate/dirt_02_local.tga}}&lt;br /&gt;
* The Local texture's tiling amount is automatically the same as the Diffuse texture.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Previewing the result ==&lt;br /&gt;
[[Image:simplemega_firstnode_preview.jpg|thumb|300px|The Render mode preview of the first node]]&lt;br /&gt;
Now we can easily check if this is all set up correctly. You should notice a little icon at the top left of your Terrain Editor which looks like this: [[Image:simplemega_previewbutton.png|MegaTexture Render Preview button]]&lt;br /&gt;
&lt;br /&gt;
* Notice the drop-down arrow on the right of the button. Click it, and select ''&amp;quot;Full&amp;quot;'' instead of ''&amp;quot;None&amp;quot;''.&lt;br /&gt;
* Your terrain should change colour to black. This means it's ready for a preview to be rendered onto it.&lt;br /&gt;
* Click the button itself now, instead of the drop-down. An &amp;quot;Active Tasks&amp;quot; window should pop up, and when it's done, you should see your dirt texture appear on your terrain model.&lt;br /&gt;
* You can switch the camera to Render mode too, which will show your terrain model's shading better.&lt;br /&gt;
* If you want a full-resolution preview of a small area, choose ''&amp;quot;Window&amp;quot;'' instead of ''&amp;quot;Full&amp;quot;'' from the drop-down menu.&lt;br /&gt;
** This creates a small window that you can move around using {{accelbtn|LMB}}-drag in the XY Top view. Simply position the window where you want to preview the full-resolution MegaTexture, and hit the Render Preview button.&lt;br /&gt;
&lt;br /&gt;
Now any time you add new nodes, or change a node's properties, you can just click the Render Preview button and the view will update with your changes.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Adding a second node ==&lt;br /&gt;
Now that the first layer of dirt is in place, we can try putting some grass on top of it!&lt;br /&gt;
* Again, {{accelbtn|RMB}} on your &amp;quot;Root&amp;quot; node and choose ''New -&amp;gt; Image Source'' (or press {{accelkey|shift}}{{accelkey|i}})&lt;br /&gt;
* This will make another new node below your &amp;quot;Dirt&amp;quot; node. &lt;br /&gt;
** Name this new node &amp;quot;Grass&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Surface Tree hierarchy is rendered from the top down, so nodes ''above'' other nodes in the hierarchy will be rendered ''before'' the other nodes. So currently it'll be rendering our Dirt node, and then rendering the Grass node on top of the dirt.&lt;br /&gt;
&lt;br /&gt;
Again, the main map types need to be specified before the node can be rendered:&lt;br /&gt;
&lt;br /&gt;
=== Diffuse ===&lt;br /&gt;
* Make sure the Diffuse section is highlighted in the top right of the Terrain Editor.&lt;br /&gt;
* In the ''File Name'' field of the '''Image Properties''' section, browse to a generic tiling grass texture.&lt;br /&gt;
** This example is using {{filename|textures/megagen/temperate/grass_04_d.tga}}&lt;br /&gt;
* Again you will want to set the ''Scale'' value to something other than 1 1, to tile your texture. Let's use 32 32 for this one.&lt;br /&gt;
&lt;br /&gt;
=== Distribution ===&lt;br /&gt;
This is important now, since we need to control where this layer is visible. Pure white won't work, since that'll just completely cover our underlying Dirt node!&lt;br /&gt;
* Make sure the Distribution section is highlighted in the top right.&lt;br /&gt;
* Change the ''Source Type'' from ''texture'' to ''geometryBased''.&lt;br /&gt;
&lt;br /&gt;
==== Geometric Texture Distribution ====&lt;br /&gt;
[[Image:simplemega_geometric_distribution.png|thumb|300px|The geometric texture distribution settings of the second node]]&lt;br /&gt;
This is where it gets interesting! There are many settings to alter, and they can have a drastic effect on how different your terrain looks, so try playing around with different values if you're not happy with the initial results.&lt;br /&gt;
&lt;br /&gt;
* '''Altitude Lower''' - Enabling this will limit the lower parts of the terrain from receiving this node's textures.&lt;br /&gt;
** '''Altitude Lower Value''' - The Z height in world units that the node will be drawn above. The default of 0 means that any parts of your terrain mesh below Z=0 will not show any of this node's textures.&lt;br /&gt;
** '''Fuzziness''' - The amount of blur applied to the mask. The higher the value, the more blurry the boundary.&lt;br /&gt;
* '''Altitude Upper''' - Enabling this will limit the higher parts of the terrain from receiving this node's textures.&lt;br /&gt;
** '''Altitude Upper Value''' - The Z height in world units that the node will be drawn below. The default of 0 means that any parts of your terrain mesh above Z=0 will not show any of this node's textures.&lt;br /&gt;
** '''Fuzziness''' - The amount of blur applied to the mask. The higher the value, the more blurry the boundary.&lt;br /&gt;
&lt;br /&gt;
* '''Clamp Distribution To Edge''' - Leave this on Default.&lt;br /&gt;
&lt;br /&gt;
* '''Resolution''' - The size in pixels of the resulting mask. The default value of 256 is fine for nearly any terrain model.&lt;br /&gt;
&lt;br /&gt;
* '''Slope Lower''' - Enabling this will limit shallower angles of the terrain model from receiving this node's textures.&lt;br /&gt;
** '''Slope Lower Value''' - The angle in degrees that the node will be drawn past. The default angle of 0 will result in no change to your mask.&lt;br /&gt;
** '''Fuzziness''' - The amount of blur applied to the mask. The higher the value, the more blurry the boundary.&lt;br /&gt;
* '''Slope Upper''' - Enabling this will limit the steeper angles of the terrain model from receiving this node's textures. This is great for masking out cliffs from your nodes.&lt;br /&gt;
** '''Slope Upper Value''' - The angle in degrees that the node will be hidden past. The default angle of 0 will result in a fully black mask.&lt;br /&gt;
** '''Fuzziness''' - The amount of blur applied to the mask. The higher the value, the more blurry the boundary.&lt;br /&gt;
&lt;br /&gt;
The settings you use for each of these will vary depending on your terrain model, and the type of node you're making. For my Grass node, you can see the settings used for this example in the screenshot above on the right.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
=== Distribution Pattern ===&lt;br /&gt;
This controls how the the grass will blend into the dirt. If you don't have a Distribution Pattern texture, the grass will just slowly fade into the dirt, which doesn't look very natural!&lt;br /&gt;
So what we want here is a texture to identify the &amp;quot;height&amp;quot; of the areas of grass. This means that the dirt can blend in based on the height of each clump of grass, so instead of a smooth fade you will get a more natural blend between the grass and the dirt.&lt;br /&gt;
* Make sure the Distribution Pattern section is highlighted in the top right.&lt;br /&gt;
* In the ''File Name'' field of the '''Image Properties''' section, browse to the matching heightmap or mask for your tiling grass texture.&lt;br /&gt;
** This example is using {{filename|textures/megagen/temperate/grass_04_mask.tga}}&lt;br /&gt;
* '''Important!''' You will also need to set the ''Distribution Pattern Texture Scale'' to the same value as the Diffuse Scale, in this case we just use 32 32 again.&lt;br /&gt;
&lt;br /&gt;
=== Local ===&lt;br /&gt;
Again we want the normal-map which matches the diffuse texture for the grass.&lt;br /&gt;
* Make sure the Local section is highlighted in the top right.&lt;br /&gt;
* In the ''File Name'' field of the '''Image Properties''' section, browse to the matching normal map for your tiling grass texture.&lt;br /&gt;
** This example is using {{filename|textures/megagen/temperate/grass_04_local.tga}}&lt;br /&gt;
&lt;br /&gt;
=== Preview again! ===&lt;br /&gt;
[[Image:simplemega_secondnode_preview.jpg|thumb|300px|The Render mode preview of the second node blended with the first node]]&lt;br /&gt;
Now that's all set up, you can hit the Render Preview ([[Image:simplemega_previewbutton.png|MegaTexture Render Preview button]]) button again and see what effect the new Grass node has.&lt;br /&gt;
If it's being distributed into the wrong places, you can go back into your Distribution settings and tweak the values for the ''geometryBased'' settings. Then you can preview again until it looks right.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
= That's it! =&lt;br /&gt;
[[Image:simplemega_ingame.jpg|thumb|300px|The MegaTexture in-game!]]&lt;br /&gt;
You've now created your very own MegaTexture to use in your map!&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
= See Also =&lt;br /&gt;
* [[An Advanced Terrain and Megatexture]] - an advanced guide for complete MegaTexture creation&lt;br /&gt;
* [[Generate a MegaTexture]] - steps for generating a MegaTexture from the SDK launcher.&lt;br /&gt;
&lt;br /&gt;
[[Category:Art]]&lt;br /&gt;
[[Category:Basic Level Design]]&lt;br /&gt;
[[Category:Tutorials]]&lt;/div&gt;</summary>
		<author><name>MoP</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.splashdamage.com/index.php?title=A_Simple_First_Megatexture&amp;diff=3986</id>
		<title>A Simple First Megatexture</title>
		<link rel="alternate" type="text/html" href="https://wiki.splashdamage.com/index.php?title=A_Simple_First_Megatexture&amp;diff=3986"/>
		<updated>2007-12-11T18:42:38Z</updated>

		<summary type="html">&lt;p&gt;MoP: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;So now that you've made [[A Simple First Terrain]], no doubt you'll want to apply a MegaTexture to it! This MegaTexture won't be as detailed or as attractive as an advanced MegaTexture, but will demonstrate the basics of creating a [[Surface Tree]], assigning textures, and compiling it all into a working MegaTexture file.&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
'''For this tutorial you must:'''&lt;br /&gt;
* Have a terrain model UV-mapped in the 0-1 range (covered in the simple first terrain tutorial)&lt;br /&gt;
* Have access to some tiling textures. TODO: Link to MegaTexture media!&lt;br /&gt;
* Have a little understanding the ETQW material system&lt;br /&gt;
&lt;br /&gt;
If you don't have any of the above things, you are not ready to do this tutorial!&lt;br /&gt;
&lt;br /&gt;
'''This tutorial covers:'''&lt;br /&gt;
* How to set up a MegaTexture material&lt;br /&gt;
* How to create a Surface Tree&lt;br /&gt;
* How to add texture nodes in the Terrain Editor&lt;br /&gt;
* How to render and compile a full MegaTexture&lt;br /&gt;
&lt;br /&gt;
'''This tutorial does not cover:'''&lt;br /&gt;
* How to use Blender/Maya/Lightwave/ZBrush/Mudbox/3DSMax/Photoshop&lt;br /&gt;
* How to create tiling textures or heightmaps&lt;br /&gt;
* Anything overly complicated&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Creating a MegaTexture material =&lt;br /&gt;
Firstly you need to create a new material for your terrain to use. If you have never made a new material before, read the article on [[Adding Custom Textures]]. All you need to do is create (or use an existing) ''.mtr'' file and place a material declaration in it, in the manner shown here:&lt;br /&gt;
 material megatextures/mapname		{ useTemplate megatextures/default_ambient&amp;lt; &amp;quot;mapname&amp;quot; &amp;gt; }&lt;br /&gt;
&lt;br /&gt;
This material would automatically search for a MegaTexture called {{filename|mapname.mega}} in the {{filename|/megatextures/}} folder. This example material uses the ''&amp;quot;default_ambient&amp;quot;'' template, which expects a 3-channel RGB MegaTexture. These are generated by the default settings of the [[Generate a MegaTexture|MegaTexture tab in the SDK Launcher]].&lt;br /&gt;
&lt;br /&gt;
Obviously you would want to use the actual name of your map instead of &amp;quot;mapname&amp;quot;, for consistency's sake and ease of reference.&lt;br /&gt;
&lt;br /&gt;
Remember that if you made a new ''.mtr'' file after the game or editor was started, you'll have to restart the whole game and editor before it will read your new file.&lt;br /&gt;
&lt;br /&gt;
=== Assigning the material ===&lt;br /&gt;
You should assign the material you just created by naming a material in your 3D application and applying it to your terrain mesh, then export the model to your preferred format (LWO, ASE or OBJ).&lt;br /&gt;
Tips on this process can be found in the [[A Simple First Terrain|simple first terrain tutorial]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Creating the Surface Tree =&lt;br /&gt;
As described in the Simple First Terrain tutorial, terrain models are set up in the Terrain Editor, accessible via {{accelkey|shift}}{{accelkey|N}} in [[editWorld]]. This tool creates a Surface Tree file ({{filename|.sft}}) that contains all the information about the terrain, including roads, stamps, and detail texture information that MegaGen needs to generate a MegaTexture.&lt;br /&gt;
[[Image:simplemega_terrainmodel.png|thumb|300px|Root node set up to use the correct terrain mesh]]&lt;br /&gt;
&lt;br /&gt;
=== Add the terrain mesh ===&lt;br /&gt;
Here's how you bring the terrain mesh into the surface tree:&lt;br /&gt;
* {{accelbtn|RMB}} on the left-hand pane, and choose ''New -&amp;gt; Tree'' via the menu.&lt;br /&gt;
** If you already have a Root node, click the &amp;quot;Begin Editing&amp;quot; button instead.&lt;br /&gt;
* Click on the Root node, and set {{keyname|Model}} to the name of the terrain mesh, in this case {{keyvalue|models/terrain/simpleterrain.obj}}.&lt;br /&gt;
* Press {{accelkey|enter}} to confirm the selection, and the terrain should appear in the 3D view.&lt;br /&gt;
&lt;br /&gt;
Be aware that your terrain model will probably appear bright orange or red.&lt;br /&gt;
The console will probably give you a few WARNING messages, don't worry about these for now, this is because your Megatexture doesn't exist yet!&lt;br /&gt;
&lt;br /&gt;
=== Important note about nodes ===&lt;br /&gt;
When you are editing properties of nodes (names, numbers, texture sources etc.) always remember to hit {{accelkey|enter}} after changing a value, to make sure that the value is stored. If you just type something in and then click somewhere else without pressing {{accelkey|enter}}, your changes may not be applied.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Create the first texture node ==&lt;br /&gt;
[[Image:simplemega_firstnode_diffuse.png|thumb|300px|The first texture node's diffuse texture properties]]&lt;br /&gt;
Now that the model is in place, you can start laying down the texture layers (or &amp;quot;nodes&amp;quot;) that will make up your MegaTexture.&lt;br /&gt;
&lt;br /&gt;
First you need to create a new Image Source node in the Terrain Editor.&lt;br /&gt;
* {{accelbtn|RMB}} on your &amp;quot;Root&amp;quot; node and choose ''New -&amp;gt; Image Source'' (or press {{accelkey|shift}}{{accelkey|i}})&lt;br /&gt;
* This will make a new node called &amp;quot;New Image Renderer&amp;quot;. You can rename this using the &amp;quot;Name&amp;quot; property field in the '''Object''' section.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You will notice in the top right of the Terrain Editor, a section listing things like &amp;quot;Diffuse&amp;quot;, &amp;quot;Distribution&amp;quot;, &amp;quot;Distribution Pattern&amp;quot; etc. Selecting one of these will list all of the properties for that section of the current node.&lt;br /&gt;
The ones we need to worry about are as follows:&lt;br /&gt;
&lt;br /&gt;
=== Diffuse ===&lt;br /&gt;
This is the colour map of the current node, and it should point to a tiling TGA texture.&lt;br /&gt;
* Make sure the Diffuse section is highlighted in the top right of the Terrain Editor.&lt;br /&gt;
* In the ''File Name'' field of the '''Image Properties''' section, browse to a generic tiling dirt texture. Remember to hit {{accelkey|enter}} afterwards!&lt;br /&gt;
** This example is using {{filename|textures/megagen/temperate/dirt_02_d.tga}}&lt;br /&gt;
* The ''Scale'' field at the very bottom of the property list allows you to choose how much to tile the texture.&lt;br /&gt;
** The default value is 1 1, but you don't want that since it will stretch your texture over the whole mesh, and look really blurry!&lt;br /&gt;
** Instead set the Scale to something like 48 48, this means that the texture will be repeated 48 times across each axis of the terrain. This results in a sharper final output.&lt;br /&gt;
That's all you need to do for the Diffuse settings in this node.&lt;br /&gt;
&lt;br /&gt;
=== Distribution ===&lt;br /&gt;
This is how we control where the layer is drawn (ie. no grass underwater, no sand on angles over 60 degrees etc). It's basically a big mask where ''white = fully shown'' and ''black = fully hidden''.&lt;br /&gt;
* Make sure the Distribution section is highlighted in the top right.&lt;br /&gt;
* Since this is our first node, we want to show over the whole terrain. This means the distribution map should be 100% white.&lt;br /&gt;
* You can either assign a pure white TGA texture, or change the ''Source Type'' to ''geometryBased''.&lt;br /&gt;
** ''geometryBased'' will by default create a fully white map, so if you don't have a white TGA handy, this is faster.&lt;br /&gt;
&lt;br /&gt;
=== Distribution Pattern ===&lt;br /&gt;
This controls how the current node blends into others. Usually this will be set to a tiling TGA heightmap texture that matches the Diffuse texture.&lt;br /&gt;
* We don't need a Distribution Pattern for the first node, since it doesn't blend with anything. Nodes on top of this one will need Distribution Patterns for more interesting and natural blends though!&lt;br /&gt;
&lt;br /&gt;
=== Local ===&lt;br /&gt;
This is the normal-map of the current node. This should be a tiling TGA texture representing the local normal information of the matching Diffuse texture.&lt;br /&gt;
* Make sure the Local section is highlighted in the top right.&lt;br /&gt;
* In the ''File Name'' field of the '''Image Properties''' section, browse to the matching normal map for your tiling dirt texture.&lt;br /&gt;
** This example is using {{filename|textures/megagen/temperate/dirt_02_local.tga}}&lt;br /&gt;
* The Local texture's tiling amount is automatically the same as the Diffuse texture.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Previewing the result ==&lt;br /&gt;
[[Image:simplemega_firstnode_preview.jpg|thumb|300px|The Render mode preview of the first node]]&lt;br /&gt;
Now we can easily check if this is all set up correctly. You should notice a little icon at the top left of your Terrain Editor which looks like this: [[Image:simplemega_previewbutton.png|MegaTexture Render Preview button]]&lt;br /&gt;
&lt;br /&gt;
* Notice the drop-down arrow on the right of the button. Click it, and select ''&amp;quot;Full&amp;quot;'' instead of ''&amp;quot;None&amp;quot;''.&lt;br /&gt;
* Your terrain should change colour to black. This means it's ready for a preview to be rendered onto it.&lt;br /&gt;
* Click the button itself now, instead of the drop-down. An &amp;quot;Active Tasks&amp;quot; window should pop up, and when it's done, you should see your dirt texture appear on your terrain model.&lt;br /&gt;
* You can switch the camera to Render mode too, which will show your terrain model's shading better.&lt;br /&gt;
* If you want a full-resolution preview of a small area, choose ''&amp;quot;Window&amp;quot;'' instead of ''&amp;quot;Full&amp;quot;'' from the drop-down menu.&lt;br /&gt;
** This creates a small window that you can move around using {{accelbtn|LMB}}-drag in the XY Top view. Simply position the window where you want to preview the full-resolution MegaTexture, and hit the Render Preview button.&lt;br /&gt;
&lt;br /&gt;
Now any time you add new nodes, or change a node's properties, you can just click the Render Preview button and the view will update with your changes.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Adding a second node ==&lt;br /&gt;
Now that the first layer of dirt is in place, we can try putting some grass on top of it!&lt;br /&gt;
* Again, {{accelbtn|RMB}} on your &amp;quot;Root&amp;quot; node and choose ''New -&amp;gt; Image Source'' (or press {{accelkey|shift}}{{accelkey|i}})&lt;br /&gt;
* This will make another new node below your &amp;quot;Dirt&amp;quot; node. &lt;br /&gt;
** Name this new node &amp;quot;Grass&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Surface Tree hierarchy is rendered from the top down, so nodes ''above'' other nodes in the hierarchy will be rendered ''before'' the other nodes. So currently it'll be rendering our Dirt node, and then rendering the Grass node on top of the dirt.&lt;br /&gt;
&lt;br /&gt;
Again, the main map types need to be specified before the node can be rendered:&lt;br /&gt;
&lt;br /&gt;
=== Diffuse ===&lt;br /&gt;
* Make sure the Diffuse section is highlighted in the top right of the Terrain Editor.&lt;br /&gt;
* In the ''File Name'' field of the '''Image Properties''' section, browse to a generic tiling grass texture.&lt;br /&gt;
** This example is using {{filename|textures/megagen/temperate/grass_04_d.tga}}&lt;br /&gt;
* Again you will want to set the ''Scale'' value to something other than 1 1, to tile your texture. Let's use 32 32 for this one.&lt;br /&gt;
&lt;br /&gt;
=== Distribution ===&lt;br /&gt;
This is important now, since we need to control where this layer is visible. Pure white won't work, since that'll just completely cover our underlying Dirt node!&lt;br /&gt;
* Make sure the Distribution section is highlighted in the top right.&lt;br /&gt;
* Change the ''Source Type'' from ''texture'' to ''geometryBased''.&lt;br /&gt;
&lt;br /&gt;
==== Geometric Texture Distribution ====&lt;br /&gt;
[[Image:simplemega_geometric_distribution.png|thumb|300px|The geometric texture distribution settings of the second node]]&lt;br /&gt;
This is where it gets interesting! There are many settings to alter, and they can have a drastic effect on how different your terrain looks, so try playing around with different values if you're not happy with the initial results.&lt;br /&gt;
&lt;br /&gt;
* '''Altitude Lower''' - Enabling this will limit the lower parts of the terrain from receiving this node's textures.&lt;br /&gt;
** '''Altitude Lower Value''' - The Z height in world units that the node will be drawn above. The default of 0 means that any parts of your terrain mesh below Z=0 will not show any of this node's textures.&lt;br /&gt;
** '''Fuzziness''' - The amount of blur applied to the mask. The higher the value, the more blurry the boundary.&lt;br /&gt;
* '''Altitude Upper''' - Enabling this will limit the higher parts of the terrain from receiving this node's textures.&lt;br /&gt;
** '''Altitude Upper Value''' - The Z height in world units that the node will be drawn below. The default of 0 means that any parts of your terrain mesh above Z=0 will not show any of this node's textures.&lt;br /&gt;
** '''Fuzziness''' - The amount of blur applied to the mask. The higher the value, the more blurry the boundary.&lt;br /&gt;
&lt;br /&gt;
* '''Clamp Distribution To Edge''' - Leave this on Default.&lt;br /&gt;
&lt;br /&gt;
* '''Resolution''' - The size in pixels of the resulting mask. The default value of 256 is fine for nearly any terrain model.&lt;br /&gt;
&lt;br /&gt;
* '''Slope Lower''' - Enabling this will limit shallower angles of the terrain model from receiving this node's textures.&lt;br /&gt;
** '''Slope Lower Value''' - The angle in degrees that the node will be drawn past. The default angle of 0 will result in no change to your mask.&lt;br /&gt;
** '''Fuzziness''' - The amount of blur applied to the mask. The higher the value, the more blurry the boundary.&lt;br /&gt;
* '''Slope Upper''' - Enabling this will limit the steeper angles of the terrain model from receiving this node's textures. This is great for masking out cliffs from your nodes.&lt;br /&gt;
** '''Slope Upper Value''' - The angle in degrees that the node will be hidden past. The default angle of 0 will result in a fully black mask.&lt;br /&gt;
** '''Fuzziness''' - The amount of blur applied to the mask. The higher the value, the more blurry the boundary.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
=== Distribution Pattern ===&lt;br /&gt;
This controls how the the grass will blend into the dirt. If you don't have a Distribution Pattern texture, the grass will just slowly fade into the dirt, which doesn't look very natural!&lt;br /&gt;
So what we want here is a texture to identify the &amp;quot;height&amp;quot; of the areas of grass. This means that the dirt can blend in based on the height of each clump of grass, so instead of a smooth fade you will get a more natural blend between the grass and the dirt.&lt;br /&gt;
* Make sure the Distribution Pattern section is highlighted in the top right.&lt;br /&gt;
* In the ''File Name'' field of the '''Image Properties''' section, browse to the matching heightmap or mask for your tiling grass texture.&lt;br /&gt;
** This example is using {{filename|textures/megagen/temperate/grass_04_mask.tga}}&lt;br /&gt;
* '''Important!''' You will also need to set the ''Distribution Pattern Texture Scale'' to the same value as the Diffuse Scale, in this case we just use 32 32 again.&lt;br /&gt;
&lt;br /&gt;
=== Local ===&lt;br /&gt;
Again we want the normal-map which matches the diffuse texture for the grass.&lt;br /&gt;
* Make sure the Local section is highlighted in the top right.&lt;br /&gt;
* In the ''File Name'' field of the '''Image Properties''' section, browse to the matching normal map for your tiling grass texture.&lt;br /&gt;
** This example is using {{filename|textures/megagen/temperate/grass_04_local.tga}}&lt;br /&gt;
&lt;br /&gt;
=== Preview again! ===&lt;br /&gt;
[[Image:simplemega_secondnode_preview.jpg|thumb|300px|The Render mode preview of the second node blended with the first node]]&lt;br /&gt;
Now that's all set up, you can hit the Render Preview ([[Image:simplemega_previewbutton.png|MegaTexture Render Preview button]]) button again and see what effect the new Grass node has.&lt;br /&gt;
If it's being distributed into the wrong places, you can go back into your Distribution settings and tweak the values for the ''geometryBased'' settings. Then you can preview again until it looks right.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
= That's it! =&lt;br /&gt;
[[Image:simplemega_ingame.jpg|thumb|300px|The MegaTexture in-game!]]&lt;br /&gt;
You've now created your very own MegaTexture to use in your map!&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
= See Also =&lt;br /&gt;
* [[An Advanced Terrain and Megatexture]] - an advanced guide for complete MegaTexture creation&lt;br /&gt;
* [[Generate a MegaTexture]] - steps for generating a MegaTexture from the SDK launcher.&lt;br /&gt;
&lt;br /&gt;
[[Category:Art]]&lt;br /&gt;
[[Category:Basic Level Design]]&lt;br /&gt;
[[Category:Tutorials]]&lt;/div&gt;</summary>
		<author><name>MoP</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.splashdamage.com/index.php?title=File:Simplemega_secondnode_preview.jpg&amp;diff=3985</id>
		<title>File:Simplemega secondnode preview.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.splashdamage.com/index.php?title=File:Simplemega_secondnode_preview.jpg&amp;diff=3985"/>
		<updated>2007-12-11T18:42:08Z</updated>

		<summary type="html">&lt;p&gt;MoP: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>MoP</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.splashdamage.com/index.php?title=File:Simplemega_geometric_distribution.png&amp;diff=3984</id>
		<title>File:Simplemega geometric distribution.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.splashdamage.com/index.php?title=File:Simplemega_geometric_distribution.png&amp;diff=3984"/>
		<updated>2007-12-11T18:29:16Z</updated>

		<summary type="html">&lt;p&gt;MoP: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>MoP</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.splashdamage.com/index.php?title=Enemy_Territory:_QUAKE_Wars&amp;diff=3979</id>
		<title>Enemy Territory: QUAKE Wars</title>
		<link rel="alternate" type="text/html" href="https://wiki.splashdamage.com/index.php?title=Enemy_Territory:_QUAKE_Wars&amp;diff=3979"/>
		<updated>2007-12-11T17:38:46Z</updated>

		<summary type="html">&lt;p&gt;MoP: /* Terrain Editing */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
&lt;br /&gt;
Welcome to the Enemy Territory: QUAKE Wars section. Here you'll find a variety of reference documentation and tutorials related to editing ETQW, along with links to the SDK. To learn more about Enemy Territory: QUAKE Wars, visit [http://www.enemyterritory.com www.enemyterritory.com].&lt;br /&gt;
&lt;br /&gt;
==Software Development Kit==&lt;br /&gt;
&lt;br /&gt;
The Enemy Territory: QUAKE Wars Software Development kit is currently in BETA. A list of download locations is [http://community.enemyterritory.com/index.php?q=node/210 available here].&lt;br /&gt;
&lt;br /&gt;
==Tutorials==&lt;br /&gt;
{| width=&amp;quot;100%&amp;quot;&lt;br /&gt;
| width=&amp;quot;50%&amp;quot; valign=&amp;quot;top&amp;quot; |&lt;br /&gt;
{| style=&amp;quot;border: 1px solid #AAAAAA;&amp;quot; width=&amp;quot;100%&amp;quot;&lt;br /&gt;
| style=&amp;quot;border-bottom: 1px solid #AAAAAA;&amp;quot; |&lt;br /&gt;
=== Basics ===&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* '''[[A Simple First Map]]''' - a step-by-step guide towards making a simple map.&lt;br /&gt;
* '''[[A Simple Second Map]]''' - a second step-by-step guide.&lt;br /&gt;
* '''[[Taking A Screenshot]]''' - Settings and options for making a great screenshot!&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border-bottom: 1px solid #AAAAAA;&amp;quot; |&lt;br /&gt;
&lt;br /&gt;
=== Terrain ===&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* '''[[A Simple First Terrain]]''' - a step-by-step guide for terrains.&lt;br /&gt;
* '''[[A Simple First Megatexture]]''' - a step-by-step guide for basic Megatextures.&lt;br /&gt;
* '''[[Making a Terrain Model]]''' - more detailed guide for terrain meshes.&lt;br /&gt;
* '''[[An Advanced Terrain and Megatexture]]''' - a comprehensive guide for making detailed terrain models with Megatextures.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
| width=&amp;quot;50%&amp;quot; valign=&amp;quot;top&amp;quot; |&lt;br /&gt;
{| style=&amp;quot;border: 1px solid #AAAAAA;&amp;quot; width=&amp;quot;100%&amp;quot;&lt;br /&gt;
| style=&amp;quot;border-bottom: 1px solid #AAAAAA;&amp;quot; |&lt;br /&gt;
&lt;br /&gt;
=== Vehicles ===&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* '''[[Vehicle Tutorial]]''' - The whole thing! Click below for smaller segments.&lt;br /&gt;
** '''[[Vehicle Tutorial Part 1|Step 1]]''' - Design considerations, before you do anything else!&lt;br /&gt;
** '''[[Vehicle Tutorial Part 2|Step 2]]''' - Initial rough model, rig and basic script.&lt;br /&gt;
** '''[[Vehicle Tutorial Part 3|Step 3]]''' - More advanced rig and scripting.&lt;br /&gt;
** '''[[Vehicle Tutorial Part 4|Step 4]]''' - Further technical setup ideas.&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border-bottom: 1px solid #AAAAAA;&amp;quot; |&lt;br /&gt;
=== Models &amp;amp; Textures ===&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* '''[[Adding Custom Textures]]''' - Create materials to add your own custom textures to the game.&lt;br /&gt;
* '''[[Making A Normal Map]]''' - Using Renderbump to generate a bump-map from a high-poly model.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Script &amp;amp; Code==&lt;br /&gt;
{| width=&amp;quot;100%&amp;quot;&lt;br /&gt;
| width=&amp;quot;50%&amp;quot; valign=&amp;quot;top&amp;quot; |&lt;br /&gt;
{| style=&amp;quot;border: 1px solid #AAAAAA;&amp;quot; width=&amp;quot;100%&amp;quot;&lt;br /&gt;
| style=&amp;quot;border-bottom: 1px solid #AAAAAA;&amp;quot; |&lt;br /&gt;
=== Coding ===&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* '''[[Windows Code Notes]]''' - General information about compiling on Windows.&lt;br /&gt;
* '''[[Linux Code Notes]]''' - General information about compiling on Linux systems.&lt;br /&gt;
* '''[[Generating Compiled Scripts]]''' - Information on building a compiledscript DLL.&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border-bottom: 1px solid #AAAAAA;&amp;quot; |&lt;br /&gt;
&lt;br /&gt;
=== Declarations ===&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* '''[[Materials]]''' - All you need to know about material declarations.&lt;br /&gt;
* '''[[Templates]]''' - Setting up templates to save time and effort.&lt;br /&gt;
* '''[[Surface Types]]''' - Available surface types for particle &amp;amp; sound effects.&lt;br /&gt;
* '''[[Skins]]''' - Easily switch textures on surfaces.&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border-bottom: 1px solid #AAAAAA;&amp;quot; |&lt;br /&gt;
&lt;br /&gt;
=== Vehicle Scripting ===&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* '''[[Vehicle Scripting: Basic_Overview|Basic Overview]]''' - Introduction to vehicle setup.&lt;br /&gt;
* '''[[Vehicle Scripting: Entity_Definition|Entity Definition]]''' - One definition to rule them all!&lt;br /&gt;
* '''[[Vehicle Scripting: Vehicle_Definition|Vehicle Definition]]''' - Introduction to the ''.vscript'' file.&lt;br /&gt;
* '''[[Vehicle Scripting: Positions_&amp;amp;_Views|Positions &amp;amp; Views]]''' - Configuring player positions &amp;amp; camera views.&lt;br /&gt;
* '''[[Vehicle Scripting: Components|Components]]''' - Details of various vehicle components.&lt;br /&gt;
* '''[[Vehicle Scripting: Weapons|Weapons]]''' - Things that go boom!&lt;br /&gt;
* '''[[Vehicle Scripting: IK|IK]]''' - Inverse Kinematics &amp;amp; you...&lt;br /&gt;
* '''[[Vehicle Scripting: Cockpits|Cockpits]]''' - Cockpit setup.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
| width=&amp;quot;50%&amp;quot; valign=&amp;quot;top&amp;quot; |&lt;br /&gt;
{| style=&amp;quot;border: 1px solid #AAAAAA;&amp;quot; width=&amp;quot;100%&amp;quot;&lt;br /&gt;
| style=&amp;quot;border-bottom: 1px solid #AAAAAA;&amp;quot; |&lt;br /&gt;
=== Entity Scripting ===&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* '''[[EntityClass:Overview|Classes]]''' - Tree of entity types.&lt;br /&gt;
* '''[[ScriptEvent:List|Events]]''' - List of all script events.&lt;br /&gt;
* '''[[Scripting:Examples|Examples]]''' - Some example walkthoughs of building up a scripted entity.&lt;br /&gt;
* '''[[Script:Files|Script Files]]''' - List of the script files used by the game.&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border-bottom: 1px solid #AAAAAA;&amp;quot; |&lt;br /&gt;
&lt;br /&gt;
=== GUIs ===&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* '''[[GUIs|GUI Overview]]''' - Overview of the GUI system.&lt;br /&gt;
* '''[[GUIs: Event Based Scripting|Event Based Scripting]]''' - GUIs are event-based.&lt;br /&gt;
* '''[[GUIs: Materials|Materials]]''' - Using materials in GUIs.&lt;br /&gt;
* '''[[GUIs: Transitions|Transitions]]''' - Transitions.&lt;br /&gt;
* '''[[GUIs: Templates|Templates]]''' - Using templates in GUIs.&lt;br /&gt;
* '''[[GUIs: List Enumeration|List Enumeration]]''' - List enumerations.&lt;br /&gt;
* '''[[GUIs: Properties|Properties]]''' - Player/Global properties and more.&lt;br /&gt;
* '''[[GUIs: Timelines|Timelines]]''' - GUI timelines.&lt;br /&gt;
* '''[[GUIs: Layouts|Layouts]]''' - Window layouts.&lt;br /&gt;
* '''[[Reference (GUIs)|Reference]]''' - GUI reference.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Design==&lt;br /&gt;
{| width=&amp;quot;100%&amp;quot;&lt;br /&gt;
| width=&amp;quot;50%&amp;quot; valign=&amp;quot;top&amp;quot; |&lt;br /&gt;
{| style=&amp;quot;border: 1px solid #AAAAAA;&amp;quot; width=&amp;quot;100%&amp;quot;&lt;br /&gt;
| style=&amp;quot;border-bottom: 1px solid #AAAAAA;&amp;quot; |&lt;br /&gt;
=== The Basics ===&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* '''[[A Simple First Map]]''' - step-by-step guide towards making a simple map&lt;br /&gt;
* '''[[A Simple Second Map]]''' - step-by-step guide towards making a simple map&lt;br /&gt;
* '''[[A Simple First Terrain]]''' - step-by-step guide creating a simple terrain&lt;br /&gt;
* '''[[An Advanced Map]]''' - includes terrain&lt;br /&gt;
* '''[[Design: How do I|How do I ...?]]''' - Common and useful tasks&lt;br /&gt;
* '''[[Map Troubleshooting]]''' - Common problems and fixes&lt;br /&gt;
----&lt;br /&gt;
* '''[[Brush Basics]]'''&lt;br /&gt;
* '''[[Entity Basics]]'''&lt;br /&gt;
* '''[[Lighting Basics]]'''&lt;br /&gt;
* '''[[Portal Basics]]'''&lt;br /&gt;
----&lt;br /&gt;
* '''[[Common Textures]]'''&lt;br /&gt;
* '''[[Decals]]'''&lt;br /&gt;
* '''[[Editor Groups]]'''&lt;br /&gt;
* '''[[Map Objects]]'''&lt;br /&gt;
* '''[[References]]'''&lt;br /&gt;
* '''[[Sound]]'''&lt;br /&gt;
* '''[[Texturesheets]]'''&lt;br /&gt;
* '''[[Water]]'''&lt;br /&gt;
----&lt;br /&gt;
* '''[[Ambient Light Editor]]'''&lt;br /&gt;
* '''[[Atmosphere Editor]]'''&lt;br /&gt;
* '''[[Texture Editor]]'''&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
| width=&amp;quot;50%&amp;quot; valign=&amp;quot;top&amp;quot; |&lt;br /&gt;
{| style=&amp;quot;border: 1px solid #AAAAAA;&amp;quot; width=&amp;quot;100%&amp;quot;&lt;br /&gt;
| style=&amp;quot;border-bottom: 1px solid #AAAAAA;&amp;quot; |&lt;br /&gt;
&lt;br /&gt;
=== Advanced Stuff ===&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* '''[[Batches]]'''&lt;br /&gt;
* '''[[Deployables]]'''&lt;br /&gt;
* '''[[Detail Groups]]'''&lt;br /&gt;
* '''[[Developer cheats]]'''&lt;br /&gt;
* '''[[List of Entities]]''' - Descriptions for all entities&lt;br /&gt;
* '''[[LOD Groups]]'''&lt;br /&gt;
* '''[[Locations]]'''&lt;br /&gt;
* '''[[Model Instancing]]'''&lt;br /&gt;
* '''[[Occlusion Tests]]'''&lt;br /&gt;
* '''[[Performance Optimizations]]'''&lt;br /&gt;
* '''[[Surface Tree]]'''&lt;br /&gt;
* '''[[Surface Types]]'''&lt;br /&gt;
* '''[[Terrain Editing]]'''&lt;br /&gt;
* '''[[Terrain Editor]]'''&lt;br /&gt;
* '''[[Vehicle Route Constraint System]]'''&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Art==&lt;br /&gt;
{| width=&amp;quot;100%&amp;quot;&lt;br /&gt;
| width=&amp;quot;50%&amp;quot; valign=&amp;quot;top&amp;quot; |&lt;br /&gt;
{| style=&amp;quot;border: 1px solid #AAAAAA;&amp;quot; width=&amp;quot;100%&amp;quot;&lt;br /&gt;
| style=&amp;quot;border-bottom: 1px solid #AAAAAA;&amp;quot; |&lt;br /&gt;
=== Models ===&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* '''[[In-Game Models]]''' - Making models for use in the engine.&lt;br /&gt;
* '''[[Collision Meshes]]''' - Optimized models for in-game physics collision.&lt;br /&gt;
* '''[[High-Poly Models]]''' - Making source models for baking normal maps.&lt;br /&gt;
* '''[[Renderbump]]''' - Create normal maps from high-poly geometry.&lt;br /&gt;
* '''[[Imposters]]''' - Sprites used for rendering complex models cheaply at a distance.&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border-bottom: 1px solid #AAAAAA;&amp;quot; |&lt;br /&gt;
&lt;br /&gt;
=== Animation ===&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* '''[[MD5 Export Process]]''' - How to export an animated MD5.&lt;br /&gt;
* '''[[Vehicle Setup]]''' - How to set up a vehicle.&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border-bottom: 1px solid #AAAAAA;&amp;quot; |&lt;br /&gt;
=== Textures ===&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* '''[[Basic Texture Overview]]''' - Supported texture types and implementations.&lt;br /&gt;
* '''[[Texturesheets]]''' - Overview of what texturesheets are, and when to use them.&lt;br /&gt;
* '''[[The Atlas Editor]]''' - Create environment texture sheets to improve performance.&lt;br /&gt;
* '''[[RenderBumpFlat]]''' - Create normal-maps from high-poly geometry.&lt;br /&gt;
* '''[[Detail Textures]]''' - Add high-frequency detail to your textures.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
| width=&amp;quot;50%&amp;quot; valign=&amp;quot;top&amp;quot; |&lt;br /&gt;
{| style=&amp;quot;border: 1px solid #AAAAAA;&amp;quot; width=&amp;quot;100%&amp;quot;&lt;br /&gt;
| style=&amp;quot;border-bottom: 1px solid #AAAAAA;&amp;quot; |&lt;br /&gt;
=== Terrain Editing ===&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* '''[[A Simple First Terrain]]''' - Simple steps to creating a terrain-based map.&lt;br /&gt;
* '''[[A Simple First Megatexture]]''' - Following on from the Simple First Terrain tutorial.&lt;br /&gt;
* '''[[Generate a MegaTexture]]''' - Render and compile your Megatexture.&lt;br /&gt;
* '''[[An Advanced Terrain and Megatexture]]''' - A detailed guide to making a realistic, natural terrain and Megatexture.&lt;br /&gt;
* '''[[Terrain Editor|EditWorld's Terrain Editor]]''' - Set up a Surface Tree for your Megatexture.&lt;br /&gt;
* '''[[Making a Terrain Model]]''' - All aspects of terrain mesh creation including Out-of-Bounds geometry.&lt;br /&gt;
* '''[[Water Surfaces#Water Models|Water Surfaces]]''' - Create water to go with your landscape.&lt;br /&gt;
* '''[[STUFF System]]''' - Procedurally distribute models over your terrain mesh.&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border-bottom: 1px solid #AAAAAA;&amp;quot; |&lt;br /&gt;
&lt;br /&gt;
=== Atmospheres and Effects ===&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* '''[[Atmosphere Editor|The Atmosphere Editor]]''' - Create and edit atmospheres for your map.&lt;br /&gt;
* '''[[Ambient Light Editor|The Ambient Light Editor]]''' - Create and edit ambient light setups.&lt;br /&gt;
* '''[[Environment Maps]]''' - Used for reflection effects.&lt;br /&gt;
* '''[[Water Surfaces]]''' - Creating water effects.&lt;br /&gt;
* '''[[Effects Editor|The Effects Editor]]''' - Create and edit particle effects.&lt;br /&gt;
* '''[[Cheap Decals]]''' - Bulletholes and other collision decals.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>MoP</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.splashdamage.com/index.php?title=Enemy_Territory:_QUAKE_Wars&amp;diff=3978</id>
		<title>Enemy Territory: QUAKE Wars</title>
		<link rel="alternate" type="text/html" href="https://wiki.splashdamage.com/index.php?title=Enemy_Territory:_QUAKE_Wars&amp;diff=3978"/>
		<updated>2007-12-11T17:22:58Z</updated>

		<summary type="html">&lt;p&gt;MoP: /* Terrain */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
&lt;br /&gt;
Welcome to the Enemy Territory: QUAKE Wars section. Here you'll find a variety of reference documentation and tutorials related to editing ETQW, along with links to the SDK. To learn more about Enemy Territory: QUAKE Wars, visit [http://www.enemyterritory.com www.enemyterritory.com].&lt;br /&gt;
&lt;br /&gt;
==Software Development Kit==&lt;br /&gt;
&lt;br /&gt;
The Enemy Territory: QUAKE Wars Software Development kit is currently in BETA. A list of download locations is [http://community.enemyterritory.com/index.php?q=node/210 available here].&lt;br /&gt;
&lt;br /&gt;
==Tutorials==&lt;br /&gt;
{| width=&amp;quot;100%&amp;quot;&lt;br /&gt;
| width=&amp;quot;50%&amp;quot; valign=&amp;quot;top&amp;quot; |&lt;br /&gt;
{| style=&amp;quot;border: 1px solid #AAAAAA;&amp;quot; width=&amp;quot;100%&amp;quot;&lt;br /&gt;
| style=&amp;quot;border-bottom: 1px solid #AAAAAA;&amp;quot; |&lt;br /&gt;
=== Basics ===&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* '''[[A Simple First Map]]''' - a step-by-step guide towards making a simple map.&lt;br /&gt;
* '''[[A Simple Second Map]]''' - a second step-by-step guide.&lt;br /&gt;
* '''[[Taking A Screenshot]]''' - Settings and options for making a great screenshot!&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border-bottom: 1px solid #AAAAAA;&amp;quot; |&lt;br /&gt;
&lt;br /&gt;
=== Terrain ===&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* '''[[A Simple First Terrain]]''' - a step-by-step guide for terrains.&lt;br /&gt;
* '''[[A Simple First Megatexture]]''' - a step-by-step guide for basic Megatextures.&lt;br /&gt;
* '''[[Making a Terrain Model]]''' - more detailed guide for terrain meshes.&lt;br /&gt;
* '''[[An Advanced Terrain and Megatexture]]''' - a comprehensive guide for making detailed terrain models with Megatextures.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
| width=&amp;quot;50%&amp;quot; valign=&amp;quot;top&amp;quot; |&lt;br /&gt;
{| style=&amp;quot;border: 1px solid #AAAAAA;&amp;quot; width=&amp;quot;100%&amp;quot;&lt;br /&gt;
| style=&amp;quot;border-bottom: 1px solid #AAAAAA;&amp;quot; |&lt;br /&gt;
&lt;br /&gt;
=== Vehicles ===&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* '''[[Vehicle Tutorial]]''' - The whole thing! Click below for smaller segments.&lt;br /&gt;
** '''[[Vehicle Tutorial Part 1|Step 1]]''' - Design considerations, before you do anything else!&lt;br /&gt;
** '''[[Vehicle Tutorial Part 2|Step 2]]''' - Initial rough model, rig and basic script.&lt;br /&gt;
** '''[[Vehicle Tutorial Part 3|Step 3]]''' - More advanced rig and scripting.&lt;br /&gt;
** '''[[Vehicle Tutorial Part 4|Step 4]]''' - Further technical setup ideas.&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border-bottom: 1px solid #AAAAAA;&amp;quot; |&lt;br /&gt;
=== Models &amp;amp; Textures ===&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* '''[[Adding Custom Textures]]''' - Create materials to add your own custom textures to the game.&lt;br /&gt;
* '''[[Making A Normal Map]]''' - Using Renderbump to generate a bump-map from a high-poly model.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Script &amp;amp; Code==&lt;br /&gt;
{| width=&amp;quot;100%&amp;quot;&lt;br /&gt;
| width=&amp;quot;50%&amp;quot; valign=&amp;quot;top&amp;quot; |&lt;br /&gt;
{| style=&amp;quot;border: 1px solid #AAAAAA;&amp;quot; width=&amp;quot;100%&amp;quot;&lt;br /&gt;
| style=&amp;quot;border-bottom: 1px solid #AAAAAA;&amp;quot; |&lt;br /&gt;
=== Coding ===&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* '''[[Windows Code Notes]]''' - General information about compiling on Windows.&lt;br /&gt;
* '''[[Linux Code Notes]]''' - General information about compiling on Linux systems.&lt;br /&gt;
* '''[[Generating Compiled Scripts]]''' - Information on building a compiledscript DLL.&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border-bottom: 1px solid #AAAAAA;&amp;quot; |&lt;br /&gt;
&lt;br /&gt;
=== Declarations ===&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* '''[[Materials]]''' - All you need to know about material declarations.&lt;br /&gt;
* '''[[Templates]]''' - Setting up templates to save time and effort.&lt;br /&gt;
* '''[[Surface Types]]''' - Available surface types for particle &amp;amp; sound effects.&lt;br /&gt;
* '''[[Skins]]''' - Easily switch textures on surfaces.&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border-bottom: 1px solid #AAAAAA;&amp;quot; |&lt;br /&gt;
&lt;br /&gt;
=== Vehicle Scripting ===&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* '''[[Vehicle Scripting: Basic_Overview|Basic Overview]]''' - Introduction to vehicle setup.&lt;br /&gt;
* '''[[Vehicle Scripting: Entity_Definition|Entity Definition]]''' - One definition to rule them all!&lt;br /&gt;
* '''[[Vehicle Scripting: Vehicle_Definition|Vehicle Definition]]''' - Introduction to the ''.vscript'' file.&lt;br /&gt;
* '''[[Vehicle Scripting: Positions_&amp;amp;_Views|Positions &amp;amp; Views]]''' - Configuring player positions &amp;amp; camera views.&lt;br /&gt;
* '''[[Vehicle Scripting: Components|Components]]''' - Details of various vehicle components.&lt;br /&gt;
* '''[[Vehicle Scripting: Weapons|Weapons]]''' - Things that go boom!&lt;br /&gt;
* '''[[Vehicle Scripting: IK|IK]]''' - Inverse Kinematics &amp;amp; you...&lt;br /&gt;
* '''[[Vehicle Scripting: Cockpits|Cockpits]]''' - Cockpit setup.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
| width=&amp;quot;50%&amp;quot; valign=&amp;quot;top&amp;quot; |&lt;br /&gt;
{| style=&amp;quot;border: 1px solid #AAAAAA;&amp;quot; width=&amp;quot;100%&amp;quot;&lt;br /&gt;
| style=&amp;quot;border-bottom: 1px solid #AAAAAA;&amp;quot; |&lt;br /&gt;
=== Entity Scripting ===&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* '''[[EntityClass:Overview|Classes]]''' - Tree of entity types.&lt;br /&gt;
* '''[[ScriptEvent:List|Events]]''' - List of all script events.&lt;br /&gt;
* '''[[Scripting:Examples|Examples]]''' - Some example walkthoughs of building up a scripted entity.&lt;br /&gt;
* '''[[Script:Files|Script Files]]''' - List of the script files used by the game.&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border-bottom: 1px solid #AAAAAA;&amp;quot; |&lt;br /&gt;
&lt;br /&gt;
=== GUIs ===&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* '''[[GUIs|GUI Overview]]''' - Overview of the GUI system.&lt;br /&gt;
* '''[[GUIs: Event Based Scripting|Event Based Scripting]]''' - GUIs are event-based.&lt;br /&gt;
* '''[[GUIs: Materials|Materials]]''' - Using materials in GUIs.&lt;br /&gt;
* '''[[GUIs: Transitions|Transitions]]''' - Transitions.&lt;br /&gt;
* '''[[GUIs: Templates|Templates]]''' - Using templates in GUIs.&lt;br /&gt;
* '''[[GUIs: List Enumeration|List Enumeration]]''' - List enumerations.&lt;br /&gt;
* '''[[GUIs: Properties|Properties]]''' - Player/Global properties and more.&lt;br /&gt;
* '''[[GUIs: Timelines|Timelines]]''' - GUI timelines.&lt;br /&gt;
* '''[[GUIs: Layouts|Layouts]]''' - Window layouts.&lt;br /&gt;
* '''[[Reference (GUIs)|Reference]]''' - GUI reference.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Design==&lt;br /&gt;
{| width=&amp;quot;100%&amp;quot;&lt;br /&gt;
| width=&amp;quot;50%&amp;quot; valign=&amp;quot;top&amp;quot; |&lt;br /&gt;
{| style=&amp;quot;border: 1px solid #AAAAAA;&amp;quot; width=&amp;quot;100%&amp;quot;&lt;br /&gt;
| style=&amp;quot;border-bottom: 1px solid #AAAAAA;&amp;quot; |&lt;br /&gt;
=== The Basics ===&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* '''[[A Simple First Map]]''' - step-by-step guide towards making a simple map&lt;br /&gt;
* '''[[A Simple Second Map]]''' - step-by-step guide towards making a simple map&lt;br /&gt;
* '''[[A Simple First Terrain]]''' - step-by-step guide creating a simple terrain&lt;br /&gt;
* '''[[An Advanced Map]]''' - includes terrain&lt;br /&gt;
* '''[[Design: How do I|How do I ...?]]''' - Common and useful tasks&lt;br /&gt;
* '''[[Map Troubleshooting]]''' - Common problems and fixes&lt;br /&gt;
----&lt;br /&gt;
* '''[[Brush Basics]]'''&lt;br /&gt;
* '''[[Entity Basics]]'''&lt;br /&gt;
* '''[[Lighting Basics]]'''&lt;br /&gt;
* '''[[Portal Basics]]'''&lt;br /&gt;
----&lt;br /&gt;
* '''[[Common Textures]]'''&lt;br /&gt;
* '''[[Decals]]'''&lt;br /&gt;
* '''[[Editor Groups]]'''&lt;br /&gt;
* '''[[Map Objects]]'''&lt;br /&gt;
* '''[[References]]'''&lt;br /&gt;
* '''[[Sound]]'''&lt;br /&gt;
* '''[[Texturesheets]]'''&lt;br /&gt;
* '''[[Water]]'''&lt;br /&gt;
----&lt;br /&gt;
* '''[[Ambient Light Editor]]'''&lt;br /&gt;
* '''[[Atmosphere Editor]]'''&lt;br /&gt;
* '''[[Texture Editor]]'''&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
| width=&amp;quot;50%&amp;quot; valign=&amp;quot;top&amp;quot; |&lt;br /&gt;
{| style=&amp;quot;border: 1px solid #AAAAAA;&amp;quot; width=&amp;quot;100%&amp;quot;&lt;br /&gt;
| style=&amp;quot;border-bottom: 1px solid #AAAAAA;&amp;quot; |&lt;br /&gt;
&lt;br /&gt;
=== Advanced Stuff ===&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* '''[[Batches]]'''&lt;br /&gt;
* '''[[Deployables]]'''&lt;br /&gt;
* '''[[Detail Groups]]'''&lt;br /&gt;
* '''[[Developer cheats]]'''&lt;br /&gt;
* '''[[List of Entities]]''' - Descriptions for all entities&lt;br /&gt;
* '''[[LOD Groups]]'''&lt;br /&gt;
* '''[[Locations]]'''&lt;br /&gt;
* '''[[Model Instancing]]'''&lt;br /&gt;
* '''[[Occlusion Tests]]'''&lt;br /&gt;
* '''[[Performance Optimizations]]'''&lt;br /&gt;
* '''[[Surface Tree]]'''&lt;br /&gt;
* '''[[Surface Types]]'''&lt;br /&gt;
* '''[[Terrain Editing]]'''&lt;br /&gt;
* '''[[Terrain Editor]]'''&lt;br /&gt;
* '''[[Vehicle Route Constraint System]]'''&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Art==&lt;br /&gt;
{| width=&amp;quot;100%&amp;quot;&lt;br /&gt;
| width=&amp;quot;50%&amp;quot; valign=&amp;quot;top&amp;quot; |&lt;br /&gt;
{| style=&amp;quot;border: 1px solid #AAAAAA;&amp;quot; width=&amp;quot;100%&amp;quot;&lt;br /&gt;
| style=&amp;quot;border-bottom: 1px solid #AAAAAA;&amp;quot; |&lt;br /&gt;
=== Models ===&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* '''[[In-Game Models]]''' - Making models for use in the engine.&lt;br /&gt;
* '''[[Collision Meshes]]''' - Optimized models for in-game physics collision.&lt;br /&gt;
* '''[[High-Poly Models]]''' - Making source models for baking normal maps.&lt;br /&gt;
* '''[[Renderbump]]''' - Create normal maps from high-poly geometry.&lt;br /&gt;
* '''[[Imposters]]''' - Sprites used for rendering complex models cheaply at a distance.&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border-bottom: 1px solid #AAAAAA;&amp;quot; |&lt;br /&gt;
&lt;br /&gt;
=== Animation ===&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* '''[[MD5 Export Process]]''' - How to export an animated MD5.&lt;br /&gt;
* '''[[Vehicle Setup]]''' - How to set up a vehicle.&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border-bottom: 1px solid #AAAAAA;&amp;quot; |&lt;br /&gt;
=== Textures ===&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* '''[[Basic Texture Overview]]''' - Supported texture types and implementations.&lt;br /&gt;
* '''[[Texturesheets]]''' - Overview of what texturesheets are, and when to use them.&lt;br /&gt;
* '''[[The Atlas Editor]]''' - Create environment texture sheets to improve performance.&lt;br /&gt;
* '''[[RenderBumpFlat]]''' - Create normal-maps from high-poly geometry.&lt;br /&gt;
* '''[[Detail Textures]]''' - Add high-frequency detail to your textures.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
| width=&amp;quot;50%&amp;quot; valign=&amp;quot;top&amp;quot; |&lt;br /&gt;
{| style=&amp;quot;border: 1px solid #AAAAAA;&amp;quot; width=&amp;quot;100%&amp;quot;&lt;br /&gt;
| style=&amp;quot;border-bottom: 1px solid #AAAAAA;&amp;quot; |&lt;br /&gt;
=== Terrain Editing ===&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* '''[[Making a Terrain Model]]''' - Create a terrain mesh for your map.&lt;br /&gt;
* '''[[Terrain Editor|EditWorld's Terrain Editor]]''' - Set up a Surface Tree for your MegaTexture.&lt;br /&gt;
* '''[[An_Advanced_Terrain_and_Megatexture|An Advanced Terrain and Megatexture]]''' - A guide to making a Terrain and Megatexture.&lt;br /&gt;
* '''[[Generate a MegaTexture]]''' - Render and compile your MegaTexture.&lt;br /&gt;
* '''[[Water Surfaces#Water Models|Water Surfaces]]''' - Create water to go with your landscape.&lt;br /&gt;
* '''[[STUFF System]]''' - Procedurally distribute models over your terrain mesh.&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border-bottom: 1px solid #AAAAAA;&amp;quot; |&lt;br /&gt;
&lt;br /&gt;
=== Atmospheres and Effects ===&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
* '''[[Atmosphere Editor|The Atmosphere Editor]]''' - Create and edit atmospheres for your map.&lt;br /&gt;
* '''[[Ambient Light Editor|The Ambient Light Editor]]''' - Create and edit ambient light setups.&lt;br /&gt;
* '''[[Environment Maps]]''' - Used for reflection effects.&lt;br /&gt;
* '''[[Water Surfaces]]''' - Creating water effects.&lt;br /&gt;
* '''[[Effects Editor|The Effects Editor]]''' - Create and edit particle effects.&lt;br /&gt;
* '''[[Cheap Decals]]''' - Bulletholes and other collision decals.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>MoP</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.splashdamage.com/index.php?title=A_Simple_First_Megatexture&amp;diff=3977</id>
		<title>A Simple First Megatexture</title>
		<link rel="alternate" type="text/html" href="https://wiki.splashdamage.com/index.php?title=A_Simple_First_Megatexture&amp;diff=3977"/>
		<updated>2007-12-11T17:03:21Z</updated>

		<summary type="html">&lt;p&gt;MoP: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;So now that you've made [[A Simple First Terrain]], no doubt you'll want to apply a MegaTexture to it! This MegaTexture won't be as detailed or as attractive as an advanced MegaTexture, but will demonstrate the basics of creating a [[Surface Tree]], assigning textures, and compiling it all into a working MegaTexture file.&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
'''For this tutorial you must:'''&lt;br /&gt;
* Have a terrain model UV-mapped in the 0-1 range (covered in the simple first terrain tutorial)&lt;br /&gt;
* Have access to some tiling textures. TODO: Link to MegaTexture media!&lt;br /&gt;
* Have a little understanding the ETQW material system&lt;br /&gt;
&lt;br /&gt;
If you don't have any of the above things, you are not ready to do this tutorial!&lt;br /&gt;
&lt;br /&gt;
'''This tutorial covers:'''&lt;br /&gt;
* How to set up a MegaTexture material&lt;br /&gt;
* How to create a Surface Tree&lt;br /&gt;
* How to add texture nodes in the Terrain Editor&lt;br /&gt;
* How to render and compile a full MegaTexture&lt;br /&gt;
&lt;br /&gt;
'''This tutorial does not cover:'''&lt;br /&gt;
* How to use Blender/Maya/Lightwave/ZBrush/Mudbox/3DSMax/Photoshop&lt;br /&gt;
* How to create tiling textures or heightmaps&lt;br /&gt;
* Anything overly complicated&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Creating a MegaTexture material =&lt;br /&gt;
Firstly you need to create a new material for your terrain to use. If you have never made a new material before, read the article on [[Adding Custom Textures]]. All you need to do is create (or use an existing) ''.mtr'' file and place a material declaration in it, in the manner shown here:&lt;br /&gt;
 material megatextures/mapname		{ useTemplate megatextures/default_ambient&amp;lt; &amp;quot;mapname&amp;quot; &amp;gt; }&lt;br /&gt;
&lt;br /&gt;
This material would automatically search for a MegaTexture called {{filename|mapname.mega}} in the {{filename|/megatextures/}} folder. This example material uses the ''&amp;quot;default_ambient&amp;quot;'' template, which expects a 3-channel RGB MegaTexture. These are generated by the default settings of the [[Generate a MegaTexture|MegaTexture tab in the SDK Launcher]].&lt;br /&gt;
&lt;br /&gt;
Obviously you would want to use the actual name of your map instead of &amp;quot;mapname&amp;quot;, for consistency's sake and ease of reference.&lt;br /&gt;
&lt;br /&gt;
Remember that if you made a new ''.mtr'' file after the game or editor was started, you'll have to restart the whole game and editor before it will read your new file.&lt;br /&gt;
&lt;br /&gt;
=== Assigning the material ===&lt;br /&gt;
You should assign the material you just created by naming a material in your 3D application and applying it to your terrain mesh, then export the model to your preferred format (LWO, ASE or OBJ).&lt;br /&gt;
Tips on this process can be found in the [[A Simple First Terrain|simple first terrain tutorial]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Creating the Surface Tree =&lt;br /&gt;
As described in the Simple First Terrain tutorial, terrain models are set up in the Terrain Editor, accessible via {{accelkey|shift}}{{accelkey|N}} in [[editWorld]]. This tool creates a Surface Tree file ({{filename|.sft}}) that contains all the information about the terrain, including roads, stamps, and detail texture information that MegaGen needs to generate a MegaTexture.&lt;br /&gt;
[[Image:simplemega_terrainmodel.png|thumb|300px|Root node set up to use the correct terrain mesh]]&lt;br /&gt;
&lt;br /&gt;
=== Add the terrain mesh ===&lt;br /&gt;
Here's how you bring the terrain mesh into the surface tree:&lt;br /&gt;
* {{accelbtn|RMB}} on the left-hand pane, and choose ''New -&amp;gt; Tree'' via the menu.&lt;br /&gt;
** If you already have a Root node, click the &amp;quot;Begin Editing&amp;quot; button instead.&lt;br /&gt;
* Click on the Root node, and set {{keyname|Model}} to the name of the terrain mesh, in this case {{keyvalue|models/terrain/simpleterrain.obj}}.&lt;br /&gt;
* Press {{accelkey|enter}} to confirm the selection, and the terrain should appear in the 3D view.&lt;br /&gt;
&lt;br /&gt;
Be aware that your terrain model will probably appear bright orange or red.&lt;br /&gt;
The console will probably give you a few WARNING messages, don't worry about these for now, this is because your Megatexture doesn't exist yet!&lt;br /&gt;
&lt;br /&gt;
=== Important note about nodes ===&lt;br /&gt;
When you are editing properties of nodes (names, numbers, texture sources etc.) always remember to hit {{accelkey|enter}} after changing a value, to make sure that the value is stored. If you just type something in and then click somewhere else without pressing {{accelkey|enter}}, your changes may not be applied.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Create the first texture node ==&lt;br /&gt;
[[Image:simplemega_firstnode_diffuse.png|thumb|300px|The first texture node's diffuse texture properties]]&lt;br /&gt;
Now that the model is in place, you can start laying down the texture layers (or &amp;quot;nodes&amp;quot;) that will make up your MegaTexture.&lt;br /&gt;
&lt;br /&gt;
First you need to create a new Image Source node in the Terrain Editor.&lt;br /&gt;
* {{accelbtn|RMB}} on your &amp;quot;Root&amp;quot; node and choose ''New -&amp;gt; Image Source'' (or press {{accelkey|shift}}{{accelkey|i}})&lt;br /&gt;
* This will make a new node called &amp;quot;New Image Renderer&amp;quot;. You can rename this using the &amp;quot;Name&amp;quot; property field in the '''Object''' section.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You will notice in the top right of the Terrain Editor, a section listing things like &amp;quot;Diffuse&amp;quot;, &amp;quot;Distribution&amp;quot;, &amp;quot;Distribution Pattern&amp;quot; etc. Selecting one of these will list all of the properties for that section of the current node.&lt;br /&gt;
The ones we need to worry about are as follows:&lt;br /&gt;
&lt;br /&gt;
=== Diffuse ===&lt;br /&gt;
This is the colour map of the current node, and it should point to a tiling TGA texture.&lt;br /&gt;
* Make sure the Diffuse section is highlighted in the top right of the Terrain Editor.&lt;br /&gt;
* In the ''File Name'' field of the '''Image Properties''' section, browse to a generic tiling dirt texture. Remember to hit {{accelkey|enter}}!&lt;br /&gt;
** I'm using {{filename|textures/megagen/temperate/dirt02_d.tga}}&lt;br /&gt;
* The ''Scale'' field at the very bottom of the property list allows you to choose how much to tile the texture.&lt;br /&gt;
** The default value is 1 1, but you don't want that since it will stretch your texture over the whole mesh, and look really blurry!&lt;br /&gt;
** Instead set the Scale to something like 48 48, this means that the texture will be repeated 48 times across each axis of the terrain. This results in a sharper final output.&lt;br /&gt;
That's all you need to do for the Diffuse settings in this node.&lt;br /&gt;
&lt;br /&gt;
=== Distribution ===&lt;br /&gt;
This is how we control where the layer is drawn (ie. no grass underwater, no sand on angles over 60 degrees etc). It's basically a big mask where ''white = fully shown'' and ''black = fully hidden''.&lt;br /&gt;
* Make sure the Distribution section is highlighted in the top right.&lt;br /&gt;
* Since this is our first node, we want to show over the whole terrain. This means the distribution map should be 100% white.&lt;br /&gt;
* You can either assign a pure white TGA texture, or change the ''Source Type'' to ''geometryBased''.&lt;br /&gt;
** ''geometryBased'' will by default create a fully white map, so if you don't have a white TGA handy, this is faster.&lt;br /&gt;
&lt;br /&gt;
=== Distribution Pattern ===&lt;br /&gt;
This controls how the current node blends into others. Usually this will be set to a tiling TGA heightmap texture that matches the Diffuse texture.&lt;br /&gt;
* We don't need a Distribution Pattern for the first node, since it doesn't blend with anything. Nodes on top of this one will need Distribution Patterns for more interesting and natural blends though!&lt;br /&gt;
&lt;br /&gt;
=== Local ===&lt;br /&gt;
This is the normal-map of the current node. This should be a tiling TGA texture representing the local normal information of the matching Diffuse texture.&lt;br /&gt;
* Make sure the Local section is highlighted in the top right.&lt;br /&gt;
* In the ''File Name'' field of the '''Image Properties''' section, browse to the matching normal map for your tiling dirt texture.&lt;br /&gt;
** I'm using {{filename|textures/megagen/temperate/dirt02_local.tga}}&lt;br /&gt;
* The Local texture's tiling amount is automatically the same as the Diffuse texture.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Previewing the result ==&lt;br /&gt;
[[Image:simplemega_firstnode_preview.jpg|thumb|300px|The Render mode preview of the first node]]&lt;br /&gt;
Now we can easily check if this is all set up correctly. You should notice a little icon at the top left of your Terrain Editor which looks like this: [[Image:simplemega_previewbutton.png|MegaTexture Render Preview button]]&lt;br /&gt;
&lt;br /&gt;
* Notice the drop-down arrow on the right of the button. Click it, and select ''&amp;quot;Full&amp;quot;'' instead of ''&amp;quot;None&amp;quot;''.&lt;br /&gt;
* Your terrain should change colour to black. This means it's ready for a preview to be rendered onto it.&lt;br /&gt;
* Click the button itself now, instead of the drop-down. An &amp;quot;Active Tasks&amp;quot; window should pop up, and when it's done, you should see your dirt texture appear on your terrain model.&lt;br /&gt;
* You can switch the camera to Render mode too, which will show your terrain model's shading better.&lt;br /&gt;
* If you want a full-resolution preview of a small area, choose ''&amp;quot;Window&amp;quot;'' instead of ''&amp;quot;Full&amp;quot;'' from the drop-down menu.&lt;br /&gt;
** This creates a small window that you can move around using {{accelbtn|LMB}}-drag in the XY Top view. Simply position the window where you want to preview the full-resolution MegaTexture, and hit the Render Preview button.&lt;br /&gt;
&lt;br /&gt;
Now any time you add new nodes, or change a node's properties, you can just click the Render Preview button and the view will update with your changes.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= That's it! =&lt;br /&gt;
[[Image:simplemega_ingame.jpg|thumb|300px|The MegaTexture in-game!]]&lt;br /&gt;
You've now created a map with your very own MegaTexture!&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
= See Also =&lt;br /&gt;
* [[An Advanced Terrain and Megatexture]] - an advanced guide for complete MegaTexture creation&lt;br /&gt;
* [[Generate a MegaTexture]] - steps for generating a MegaTexture from the SDK launcher.&lt;br /&gt;
&lt;br /&gt;
[[Category:Art]]&lt;br /&gt;
[[Category:Basic Level Design]]&lt;br /&gt;
[[Category:Tutorials]]&lt;/div&gt;</summary>
		<author><name>MoP</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.splashdamage.com/index.php?title=File:Simplemega_firstnode_preview.jpg&amp;diff=3974</id>
		<title>File:Simplemega firstnode preview.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.splashdamage.com/index.php?title=File:Simplemega_firstnode_preview.jpg&amp;diff=3974"/>
		<updated>2007-12-11T16:50:34Z</updated>

		<summary type="html">&lt;p&gt;MoP: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>MoP</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.splashdamage.com/index.php?title=File:Simplemega_previewbutton.png&amp;diff=3973</id>
		<title>File:Simplemega previewbutton.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.splashdamage.com/index.php?title=File:Simplemega_previewbutton.png&amp;diff=3973"/>
		<updated>2007-12-11T16:40:24Z</updated>

		<summary type="html">&lt;p&gt;MoP: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>MoP</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.splashdamage.com/index.php?title=A_Simple_First_Megatexture&amp;diff=3972</id>
		<title>A Simple First Megatexture</title>
		<link rel="alternate" type="text/html" href="https://wiki.splashdamage.com/index.php?title=A_Simple_First_Megatexture&amp;diff=3972"/>
		<updated>2007-12-11T16:27:26Z</updated>

		<summary type="html">&lt;p&gt;MoP: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;So now that you've made [[A Simple First Terrain]], no doubt you'll want to apply a MegaTexture to it! This MegaTexture won't be as detailed or as attractive as an advanced MegaTexture, but will demonstrate the basics of creating a [[Surface Tree]], assigning textures, and compiling it all into a working MegaTexture file.&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
'''For this tutorial you must:'''&lt;br /&gt;
* Have a terrain model UV-mapped in the 0-1 range (covered in the simple first terrain tutorial)&lt;br /&gt;
* Have access to some tiling textures. TODO: Link to MegaTexture media!&lt;br /&gt;
* Have a little understanding the ETQW material system&lt;br /&gt;
&lt;br /&gt;
If you don't have any of the above things, you are not ready to do this tutorial!&lt;br /&gt;
&lt;br /&gt;
'''This tutorial covers:'''&lt;br /&gt;
* How to set up a MegaTexture material&lt;br /&gt;
* How to create a Surface Tree&lt;br /&gt;
* How to add texture nodes in the Terrain Editor&lt;br /&gt;
* How to render and compile a full MegaTexture&lt;br /&gt;
&lt;br /&gt;
'''This tutorial does not cover:'''&lt;br /&gt;
* How to use Blender/Maya/Lightwave/ZBrush/Mudbox/3DSMax/Photoshop&lt;br /&gt;
* How to create tiling textures or heightmaps&lt;br /&gt;
* Anything overly complicated&lt;br /&gt;
&lt;br /&gt;
= Creating a MegaTexture material =&lt;br /&gt;
Firstly you need to create a new material for your terrain to use. If you have never made a new material before, read the article on [[Adding Custom Textures]]. All you need to do is create (or use an existing) ''.mtr'' file and place a material declaration in it, in the manner shown here:&lt;br /&gt;
 material megatextures/mapname		{ useTemplate megatextures/default_ambient&amp;lt; &amp;quot;mapname&amp;quot; &amp;gt; }&lt;br /&gt;
&lt;br /&gt;
This material would automatically search for a MegaTexture called {{filename|mapname.mega}} in the {{filename|/megatextures/}} folder. This example material uses the ''&amp;quot;default_ambient&amp;quot;'' template, which expects a 3-channel RGB MegaTexture. These are generated by the default settings of the [[Generate a MegaTexture|MegaTexture tab in the SDK Launcher]].&lt;br /&gt;
&lt;br /&gt;
Obviously you would want to use the actual name of your map instead of &amp;quot;mapname&amp;quot;, for consistency's sake and ease of reference.&lt;br /&gt;
&lt;br /&gt;
Remember that if you made a new ''.mtr'' file after the game or editor was started, you'll have to restart the whole game and editor before it will read your new file.&lt;br /&gt;
&lt;br /&gt;
=== Assigning the material ===&lt;br /&gt;
You should assign the material you just created by naming a material in your 3D application and applying it to your terrain mesh, then export the model to your preferred format (LWO, ASE or OBJ).&lt;br /&gt;
Tips on this process can be found in the [[A Simple First Terrain|simple first terrain tutorial]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Creating the Surface Tree =&lt;br /&gt;
As described in the Simple First Terrain tutorial, terrain models are set up in the Terrain Editor, accessible via {{accelkey|shift}}{{accelkey|N}} in [[editWorld]]. This tool creates a Surface Tree file ({{filename|.sft}}) that contains all the information about the terrain, including roads, stamps, and detail texture information that MegaGen needs to generate a MegaTexture.&lt;br /&gt;
[[Image:simplemega_terrainmodel.png|thumb|300px|Root node set up to use the correct terrain mesh]]&lt;br /&gt;
&lt;br /&gt;
=== Add the terrain mesh ===&lt;br /&gt;
Here's how you bring the terrain mesh into the surface tree:&lt;br /&gt;
* {{accelbtn|RMB}} on the left-hand pane, and choose ''New -&amp;gt; Tree'' via the menu.&lt;br /&gt;
** If you already have a Root node, click the &amp;quot;Begin Editing&amp;quot; button instead.&lt;br /&gt;
* Click on the Root node, and set {{keyname|Model}} to the name of the terrain mesh, in this case {{keyvalue|models/terrain/simpleterrain.obj}}.&lt;br /&gt;
* Press {{accelkey|enter}} to confirm the selection, and the terrain should appear in the 3D view.&lt;br /&gt;
&lt;br /&gt;
Be aware that your terrain model will probably appear bright orange or red.&lt;br /&gt;
The console will probably give you a few WARNING messages, don't worry about these for now, this is because your Megatexture doesn't exist yet!&lt;br /&gt;
&lt;br /&gt;
=== Important note about nodes ===&lt;br /&gt;
When you are editing properties of nodes (names, numbers, texture sources etc.) always remember to hit {{accelkey|enter}} after changing a value, to make sure that the value is stored. If you just type something in and then click somewhere else without pressing {{accelkey|enter}}, your changes may not be applied.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Create the first texture node ==&lt;br /&gt;
[[Image:simplemega_firstnode_diffuse.png|thumb|300px|The first texture node's diffuse texture properties]]&lt;br /&gt;
Now that the model is in place, you can start laying down the texture layers (or &amp;quot;nodes&amp;quot;) that will make up your MegaTexture.&lt;br /&gt;
&lt;br /&gt;
First you need to create a new Image Source node in the Terrain Editor.&lt;br /&gt;
* {{accelbtn|RMB}} on your &amp;quot;Root&amp;quot; node and choose ''New -&amp;gt; Image Source'' (or press {{accelkey|shift}}{{accelkey|i}})&lt;br /&gt;
* This will make a new node called &amp;quot;New Image Renderer&amp;quot;. You can rename this using the &amp;quot;Name&amp;quot; property field in the '''Object''' section.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You will notice in the top right of the Terrain Editor, a section listing things like &amp;quot;Diffuse&amp;quot;, &amp;quot;Distribution&amp;quot;, &amp;quot;Distribution Pattern&amp;quot; etc. Selecting one of these will list all of the properties for that section of the current node.&lt;br /&gt;
The ones we need to worry about are as follows:&lt;br /&gt;
&lt;br /&gt;
=== Diffuse ===&lt;br /&gt;
This is the colour map of the current node, and it should point to a tiling TGA texture.&lt;br /&gt;
* Make sure the Diffuse section is highlighted in the top right of the Terrain Editor.&lt;br /&gt;
* In the ''File Name'' field of the '''Image Properties''' section, browse to a generic tiling dirt texture. Remember to hit {{accelkey|enter}}!&lt;br /&gt;
** I'm using {{filename|textures/megagen/temperate/dirt02_d.tga}}&lt;br /&gt;
&lt;br /&gt;
=== Distribution ===&lt;br /&gt;
This is how we control where the layer is drawn (ie. no grass underwater, no sand on angles over 60 degrees etc). It's basically a big mask where ''white = fully shown'' and ''black = fully hidden''.&lt;br /&gt;
* Make sure the Distribution section is highlighted in the top right.&lt;br /&gt;
* Since this is our first node, we want to show over the whole terrain. This means the distribution map should be 100% white.&lt;br /&gt;
* You can either assign a pure white TGA texture, or change the ''Source Type'' to ''geometryBased''.&lt;br /&gt;
** ''geometryBased'' will by default create a fully white map, so if you don't have a white TGA handy, this is faster.&lt;br /&gt;
&lt;br /&gt;
=== Distribution Pattern ===&lt;br /&gt;
This controls how the current node blends into others. Usually this will be set to a tiling TGA heightmap texture that matches the Diffuse texture.&lt;br /&gt;
* We don't need a Distribution Pattern for the first node, since it doesn't blend with anything. Nodes on top of this one will need Distribution Patterns for more interesting and natural blends though!&lt;br /&gt;
&lt;br /&gt;
=== Local ===&lt;br /&gt;
This is the normal-map of the current node. This should be a tiling TGA texture representing the local normal information of the matching Diffuse texture.&lt;br /&gt;
* Make sure the Local section is highlighted in the top right.&lt;br /&gt;
* In the ''File Name'' field of the '''Image Properties''' section, browse to the matching normal map for your tiling dirt texture.&lt;br /&gt;
** I'm using {{filename|textures/megagen/temperate/dirt02_local.tga}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= That's it! =&lt;br /&gt;
[[Image:simple_mega_ingame.jpg|thumb|300px|The MegaTexture in-game!]]&lt;br /&gt;
You've now created a map with your very own MegaTexture!&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
= See Also =&lt;br /&gt;
* [[An Advanced Terrain and Megatexture]] - an advanced guide for complete MegaTexture creation&lt;br /&gt;
* [[Generate a MegaTexture]] - steps for generating a MegaTexture from the SDK launcher.&lt;br /&gt;
&lt;br /&gt;
[[Category:Art]]&lt;br /&gt;
[[Category:Basic Level Design]]&lt;br /&gt;
[[Category:Tutorials]]&lt;/div&gt;</summary>
		<author><name>MoP</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.splashdamage.com/index.php?title=File:Simplemega_firstnode_diffuse.png&amp;diff=3971</id>
		<title>File:Simplemega firstnode diffuse.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.splashdamage.com/index.php?title=File:Simplemega_firstnode_diffuse.png&amp;diff=3971"/>
		<updated>2007-12-11T16:18:53Z</updated>

		<summary type="html">&lt;p&gt;MoP: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>MoP</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.splashdamage.com/index.php?title=File:Simplemega_terrainmodel.png&amp;diff=3970</id>
		<title>File:Simplemega terrainmodel.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.splashdamage.com/index.php?title=File:Simplemega_terrainmodel.png&amp;diff=3970"/>
		<updated>2007-12-11T15:52:11Z</updated>

		<summary type="html">&lt;p&gt;MoP: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>MoP</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.splashdamage.com/index.php?title=A_Simple_First_Megatexture&amp;diff=3969</id>
		<title>A Simple First Megatexture</title>
		<link rel="alternate" type="text/html" href="https://wiki.splashdamage.com/index.php?title=A_Simple_First_Megatexture&amp;diff=3969"/>
		<updated>2007-12-11T15:21:23Z</updated>

		<summary type="html">&lt;p&gt;MoP: /* Introduction */ any not either&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;So now that you've made [[A Simple First Terrain]], no doubt you'll want to apply a MegaTexture to it! This MegaTexture won't be as detailed or as attractive as an advanced MegaTexture, but will demonstrate the basics of creating a [[Surface Tree]], assigning textures, and compiling it all into a working MegaTexture file.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
'''For this tutorial you must:'''&lt;br /&gt;
* Have a terrain model UV-mapped in the 0-1 range (covered in the simple first terrain tutorial)&lt;br /&gt;
* Have access to some tiling textures. TODO: Link to MegaTexture media!&lt;br /&gt;
* Have a little understanding the ETQW material system&lt;br /&gt;
&lt;br /&gt;
If you don't have any of the above things, you are not ready to do this tutorial!&lt;br /&gt;
&lt;br /&gt;
'''This tutorial covers:'''&lt;br /&gt;
* How to set up a MegaTexture material&lt;br /&gt;
* How to create a Surface Tree&lt;br /&gt;
* How to add texture nodes in the Terrain Editor&lt;br /&gt;
* How to render and compile a full MegaTexture&lt;br /&gt;
&lt;br /&gt;
'''This tutorial does not cover:'''&lt;br /&gt;
* How to use Blender/Maya/Lightwave/ZBrush/Mudbox/3DSMax/Photoshop&lt;br /&gt;
* How to create tiling textures or heightmaps&lt;br /&gt;
* Anything overly complicated&lt;br /&gt;
&lt;br /&gt;
== Creating a MegaTexture Material ==&lt;br /&gt;
Firstly you need to create a new material for your terrain to use. If you have never made a new material before, read the article on [[Adding Custom Textures]]. All you need to do is create (or use an existing) ''.mtr'' file and place a material declaration in it, in the manner shown here:&lt;br /&gt;
 material megatextures/mapname		{ useTemplate megatextures/default_ambient&amp;lt; &amp;quot;mapname&amp;quot; &amp;gt; }&lt;br /&gt;
&lt;br /&gt;
This material would automatically search for a MegaTexture called {{filename|mapname.mega}} in the {{filename|/megatextures/}} folder. This example material uses the ''&amp;quot;default_ambient&amp;quot;'' template, which expects a 3-channel RGB MegaTexture. These are generated by the default settings of the [[Generate a MegaTexture|MegaTexture tab in the SDK Launcher]].&lt;br /&gt;
&lt;br /&gt;
Obviously you would want to use the actual name of your map instead of &amp;quot;mapname&amp;quot;, for consistency's sake and ease of reference.&lt;br /&gt;
&lt;br /&gt;
Remember that if you made a new ''.mtr'' file after the game or editor was started, you'll have to restart the whole game and editor before it will read your new file.&lt;br /&gt;
&lt;br /&gt;
=== Assigning the Material ===&lt;br /&gt;
You should assign the material you just created by naming a material in your 3D application and applying it to your terrain mesh, then export the model to your preferred format (LWO, ASE or OBJ).&lt;br /&gt;
Tips on this process can be found in the [[A Simple First Terrain|simple first terrain tutorial]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Creating the Surface Tree ==&lt;br /&gt;
As described in the Simple First Terrain tutorial, terrain models are set up in the Terrain Editor, accessible via {{accelkey|shift}}{{accelkey|N}} in [[editWorld]]. This tool creates a Surface Tree file ({{filename|.sft}}) that contains all the information about the terrain, including roads, stamps, and detail texture information that MegaGen needs to generate a MegaTexture.&lt;br /&gt;
&lt;br /&gt;
=== Add the Terrain Mesh ===&lt;br /&gt;
[[Image:simpleterrain_terraineditor2.png|thumb|300px|Root node set up to use the correct terrain mesh]]&lt;br /&gt;
Here's how you bring the terrain mesh into the surface tree:&lt;br /&gt;
* {{accelbtn|RMB}} on the left-hand pane, and choose ''New -&amp;gt; Tree'' via the menu.&lt;br /&gt;
** If you already have a Root node, click the &amp;quot;Begin Editing&amp;quot; button instead.&lt;br /&gt;
* Click on the Root node, and set {{keyname|Model}} to the name of the terrain mesh, in this case {{keyvalue|models/terrain/simpleterrain.obj}}.&lt;br /&gt;
* Press {{accelkey|enter}} to confirm the selection, and the terrain should appear in the 3D view.&lt;br /&gt;
&lt;br /&gt;
Be aware that your terrain model will probably appear bright orange or red.&lt;br /&gt;
The console will probably give you a few WARNING messages, don't worry about these for now, this is because your Megatexture doesn't exist yet!&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== That's it! ==&lt;br /&gt;
[[Image:simple_mega_ingame.jpg|thumb|300px|The MegaTexture in-game!]]&lt;br /&gt;
You've now created a map with your very own MegaTexture!&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
* [[An Advanced Terrain and Megatexture]] - an advanced guide for complete MegaTexture creation&lt;br /&gt;
* [[Generate a MegaTexture]] - steps for generating a MegaTexture from the SDK launcher.&lt;br /&gt;
&lt;br /&gt;
[[Category:Art]]&lt;br /&gt;
[[Category:Basic Level Design]]&lt;br /&gt;
[[Category:Tutorials]]&lt;/div&gt;</summary>
		<author><name>MoP</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.splashdamage.com/index.php?title=A_Simple_First_Megatexture&amp;diff=3968</id>
		<title>A Simple First Megatexture</title>
		<link rel="alternate" type="text/html" href="https://wiki.splashdamage.com/index.php?title=A_Simple_First_Megatexture&amp;diff=3968"/>
		<updated>2007-12-11T15:20:47Z</updated>

		<summary type="html">&lt;p&gt;MoP: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;So now that you've made [[A Simple First Terrain]], no doubt you'll want to apply a MegaTexture to it! This MegaTexture won't be as detailed or as attractive as an advanced MegaTexture, but will demonstrate the basics of creating a [[Surface Tree]], assigning textures, and compiling it all into a working MegaTexture file.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
'''For this tutorial you must:'''&lt;br /&gt;
* Have a terrain model UV-mapped in the 0-1 range (covered in the simple first terrain tutorial)&lt;br /&gt;
* Have access to some tiling textures. TODO: Link to MegaTexture media!&lt;br /&gt;
* Have a little understanding the ETQW material system&lt;br /&gt;
&lt;br /&gt;
If you don't have either of the above things, you are not ready to do this tutorial!&lt;br /&gt;
&lt;br /&gt;
'''This tutorial covers:'''&lt;br /&gt;
* How to set up a MegaTexture material&lt;br /&gt;
* How to create a Surface Tree&lt;br /&gt;
* How to add texture nodes in the Terrain Editor&lt;br /&gt;
* How to render and compile a full MegaTexture&lt;br /&gt;
&lt;br /&gt;
'''This tutorial does not cover:'''&lt;br /&gt;
* How to use Blender/Maya/Lightwave/ZBrush/Mudbox/3DSMax/Photoshop&lt;br /&gt;
* How to create tiling textures or heightmaps&lt;br /&gt;
* Anything overly complicated&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Creating a MegaTexture Material ==&lt;br /&gt;
Firstly you need to create a new material for your terrain to use. If you have never made a new material before, read the article on [[Adding Custom Textures]]. All you need to do is create (or use an existing) ''.mtr'' file and place a material declaration in it, in the manner shown here:&lt;br /&gt;
 material megatextures/mapname		{ useTemplate megatextures/default_ambient&amp;lt; &amp;quot;mapname&amp;quot; &amp;gt; }&lt;br /&gt;
&lt;br /&gt;
This material would automatically search for a MegaTexture called {{filename|mapname.mega}} in the {{filename|/megatextures/}} folder. This example material uses the ''&amp;quot;default_ambient&amp;quot;'' template, which expects a 3-channel RGB MegaTexture. These are generated by the default settings of the [[Generate a MegaTexture|MegaTexture tab in the SDK Launcher]].&lt;br /&gt;
&lt;br /&gt;
Obviously you would want to use the actual name of your map instead of &amp;quot;mapname&amp;quot;, for consistency's sake and ease of reference.&lt;br /&gt;
&lt;br /&gt;
Remember that if you made a new ''.mtr'' file after the game or editor was started, you'll have to restart the whole game and editor before it will read your new file.&lt;br /&gt;
&lt;br /&gt;
=== Assigning the Material ===&lt;br /&gt;
You should assign the material you just created by naming a material in your 3D application and applying it to your terrain mesh, then export the model to your preferred format (LWO, ASE or OBJ).&lt;br /&gt;
Tips on this process can be found in the [[A Simple First Terrain|simple first terrain tutorial]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Creating the Surface Tree ==&lt;br /&gt;
As described in the Simple First Terrain tutorial, terrain models are set up in the Terrain Editor, accessible via {{accelkey|shift}}{{accelkey|N}} in [[editWorld]]. This tool creates a Surface Tree file ({{filename|.sft}}) that contains all the information about the terrain, including roads, stamps, and detail texture information that MegaGen needs to generate a MegaTexture.&lt;br /&gt;
&lt;br /&gt;
=== Add the Terrain Mesh ===&lt;br /&gt;
[[Image:simpleterrain_terraineditor2.png|thumb|300px|Root node set up to use the correct terrain mesh]]&lt;br /&gt;
Here's how you bring the terrain mesh into the surface tree:&lt;br /&gt;
* {{accelbtn|RMB}} on the left-hand pane, and choose ''New -&amp;gt; Tree'' via the menu.&lt;br /&gt;
** If you already have a Root node, click the &amp;quot;Begin Editing&amp;quot; button instead.&lt;br /&gt;
* Click on the Root node, and set {{keyname|Model}} to the name of the terrain mesh, in this case {{keyvalue|models/terrain/simpleterrain.obj}}.&lt;br /&gt;
* Press {{accelkey|enter}} to confirm the selection, and the terrain should appear in the 3D view.&lt;br /&gt;
&lt;br /&gt;
Be aware that your terrain model will probably appear bright orange or red.&lt;br /&gt;
The console will probably give you a few WARNING messages, don't worry about these for now, this is because your Megatexture doesn't exist yet!&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== That's it! ==&lt;br /&gt;
[[Image:simple_mega_ingame.jpg|thumb|300px|The MegaTexture in-game!]]&lt;br /&gt;
You've now created a map with your very own MegaTexture!&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
* [[An Advanced Terrain and Megatexture]] - an advanced guide for complete MegaTexture creation&lt;br /&gt;
* [[Generate a MegaTexture]] - steps for generating a MegaTexture from the SDK launcher.&lt;br /&gt;
&lt;br /&gt;
[[Category:Art]]&lt;br /&gt;
[[Category:Basic Level Design]]&lt;br /&gt;
[[Category:Tutorials]]&lt;/div&gt;</summary>
		<author><name>MoP</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.splashdamage.com/index.php?title=A_Simple_First_Megatexture&amp;diff=3967</id>
		<title>A Simple First Megatexture</title>
		<link rel="alternate" type="text/html" href="https://wiki.splashdamage.com/index.php?title=A_Simple_First_Megatexture&amp;diff=3967"/>
		<updated>2007-12-11T14:43:16Z</updated>

		<summary type="html">&lt;p&gt;MoP: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;So now that you've made [[A Simple First Terrain]], no doubt you'll want to apply a MegaTexture to it! This MegaTexture won't be as detailed or as attractive as an advanced MegaTexture, but will demonstrate the basics of creating a [[Surface Tree]], assigning textures, and compiling it all into a working MegaTexture file.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
'''For this tutorial you must:'''&lt;br /&gt;
* Have a terrain model UV-mapped in the 0-1 range (covered in the simple first terrain tutorial)&lt;br /&gt;
* Have access to some tiling textures. TODO: Link to MegaTexture media!&lt;br /&gt;
* Have a little understanding the ETQW material system&lt;br /&gt;
&lt;br /&gt;
If you don't have either of the above things, you are not ready to do this tutorial!&lt;br /&gt;
&lt;br /&gt;
'''This tutorial covers:'''&lt;br /&gt;
* How to set up a MegaTexture material&lt;br /&gt;
* How to create a Surface Tree&lt;br /&gt;
* How to add texture nodes in the Terrain Editor&lt;br /&gt;
* How to render and compile a full MegaTexture&lt;br /&gt;
&lt;br /&gt;
'''This tutorial does not cover:'''&lt;br /&gt;
* How to use Blender/Maya/Lightwave/ZBrush/Mudbox/3DSMax/Photoshop&lt;br /&gt;
* How to create tiling textures or heightmaps&lt;br /&gt;
* Anything overly complicated&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Creating a MegaTexture Material ==&lt;br /&gt;
Firstly you need to create a new material for your terrain to use. If you have never made a new material before, read the article on [[Adding Custom Textures]]. All you need to do is create (or use an existing) ''.mtr'' file and place a material declaration in it, in the manner shown here:&lt;br /&gt;
 material megatextures/mapname		{ useTemplate megatextures/default_ambient&amp;lt; &amp;quot;mapname&amp;quot; &amp;gt; }&lt;br /&gt;
&lt;br /&gt;
This material would automatically search for a MegaTexture called {{filename|mapname.mega}} in the {{filename|/megatextures/}} folder. This example material uses the ''&amp;quot;default_ambient&amp;quot;'' template, which expects a 3-channel RGB MegaTexture. These are generated by the default settings of the [[Generate a MegaTexture|MegaTexture tab in the SDK Launcher]].&lt;br /&gt;
&lt;br /&gt;
Obviously you would want to use the actual name of your map instead of &amp;quot;mapname&amp;quot;, for consistency's sake and ease of reference.&lt;br /&gt;
&lt;br /&gt;
Remember that if you made a new ''.mtr'' file after the game or editor was started, you'll have to restart the whole game and editor before it will read your new file.&lt;br /&gt;
&lt;br /&gt;
=== Assigning the Material ===&lt;br /&gt;
You should assign the material you just created by naming a material in your 3D application and applying it to your terrain mesh, then export the model to your preferred format (LWO, ASE or OBJ).&lt;br /&gt;
Tips on this process can be found in the [[A Simple First Terrain|simple first terrain tutorial]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Creating the Surface Tree ==&lt;br /&gt;
As described in the Simple First Terrain tutorial, terrain models are set up in the Terrain Editor, accessible via {{accelkey|shift}}{{accelkey|N}} in [[editWorld]]. This tool creates a Surface Tree file ({{filename|.sft}}) that contains all the information about the terrain, including roads, stamps, and detail texture information that MegaGen needs to generate a MegaTexture.&lt;br /&gt;
&lt;br /&gt;
=== Add the Terrain Mesh ===&lt;br /&gt;
[[Image:simpleterrain_terraineditor2.png|thumb|300px|Root node set up to use the correct terrain mesh]]&lt;br /&gt;
Here's how you bring the terrain mesh into the surface tree:&lt;br /&gt;
* Press ''&amp;quot;Begin Editing&amp;quot;'' at the bottom of the Terrain Editor window.&lt;br /&gt;
* {{accelbtn|RMB}} on the left-hand pane and create a new Tree via the menu.&lt;br /&gt;
* Click on the Root node, and set {{keyname|Model}} to the name of the terrain mesh, in this case {{keyvalue|models/terrain/simpleterrain.obj}}.&lt;br /&gt;
* Press {{accelkey|enter}} to confirm the selection, and the terrain should appear in the 3D view.&lt;br /&gt;
&lt;br /&gt;
Be aware that your terrain model will probably appear bright orange or red. Don't worry, this is because your Megatexture doesn't exist yet!&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== That's it! ==&lt;br /&gt;
[[Image:simple_mega_ingame.jpg|thumb|300px|The MegaTexture in-game!]]&lt;br /&gt;
You've now created a map with your very own MegaTexture!&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
* [[An Advanced Terrain and Megatexture]] - an advanced guide for complete MegaTexture creation&lt;br /&gt;
* [[Generate a MegaTexture]] - steps for generating a MegaTexture from the SDK launcher.&lt;br /&gt;
&lt;br /&gt;
[[Category:Art]]&lt;br /&gt;
[[Category:Basic Level Design]]&lt;br /&gt;
[[Category:Tutorials]]&lt;/div&gt;</summary>
		<author><name>MoP</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.splashdamage.com/index.php?title=Skybox&amp;diff=3965</id>
		<title>Skybox</title>
		<link rel="alternate" type="text/html" href="https://wiki.splashdamage.com/index.php?title=Skybox&amp;diff=3965"/>
		<updated>2007-12-11T14:09:52Z</updated>

		<summary type="html">&lt;p&gt;MoP: line break&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A skybox is a set of images used to create an exterior sky. These can be added to an atmosphere using the [[Atmosphere Editor]].&amp;lt;includeonly&amp;gt; &lt;br /&gt;
&lt;br /&gt;
{{main|Skybox}}&amp;lt;/includeonly&amp;gt;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
__NOEDITSECTION__&lt;br /&gt;
= Creating A Sky Box =&lt;br /&gt;
== Make The Image ==&lt;br /&gt;
* Create a sky image that tiles horizontally. Make it 4 times wider than it is high (eg. 2048x512).&lt;br /&gt;
* Save the image as {{filename|/base/atmosphere/skies/&amp;lt;mapname&amp;gt;.tga}}.&lt;br /&gt;
&lt;br /&gt;
== Convert The Image To a Skybox ==&lt;br /&gt;
Launch the game using the SDK Launcher to make sure your save paths are set up correctly (if you don't, it will output the files to the base ETQW folder rather than your mod directory).&lt;br /&gt;
&lt;br /&gt;
Then you can use the {{consolecmd|halfSphereToSkybox}} console command to convert your image into a distortion-free skybox that can be used by the game.&lt;br /&gt;
* For example, type {{consolecmd|halfSphereToSkybox atmosphere/skies/&amp;lt;mapname&amp;gt;}}&lt;br /&gt;
* This will output {{filename|&amp;lt;mapname&amp;gt;_side.tga}} and {{filename|&amp;lt;mapname&amp;gt;_top.tga}} images into the same folder.&lt;br /&gt;
Here is an example showing what happens to your source image to get the skybox textures:&lt;br /&gt;
[[Image:skybox_conversion.jpg|Before and after converting a skybox image]]&lt;br /&gt;
&lt;br /&gt;
== Create A Material ==&lt;br /&gt;
Create a material for your new skybox. These are very simple since they're set up from a template. In general these materials are stored in {{filename|/base/materials/atmospheres/skydomes.mtr}}.&lt;br /&gt;
Example material:&lt;br /&gt;
 // used by ''&amp;lt;mapname&amp;gt;''&lt;br /&gt;
 material atmospheres/skydomes/''&amp;lt;mapname&amp;gt;'' {&lt;br /&gt;
 	useTemplate material/skybox&amp;lt; &amp;quot;highquality atmosphere/skies/''&amp;lt;mapname&amp;gt;''&amp;quot; &amp;gt;&lt;br /&gt;
 }&lt;br /&gt;
Save the material file and type {{consolecmd|reloadDecls}} in the console to load the updated material.&lt;br /&gt;
Your sky material should now be available to choose in the &amp;quot;Layer Material&amp;quot; section of the &amp;quot;Skydome &amp;amp; Clouds&amp;quot; tab of the [[Atmosphere Editor]].&lt;br /&gt;
&lt;br /&gt;
[[Category:Art]]&lt;br /&gt;
[[Category:Level Design]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>MoP</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.splashdamage.com/index.php?title=Skybox&amp;diff=3964</id>
		<title>Skybox</title>
		<link rel="alternate" type="text/html" href="https://wiki.splashdamage.com/index.php?title=Skybox&amp;diff=3964"/>
		<updated>2007-12-11T14:09:34Z</updated>

		<summary type="html">&lt;p&gt;MoP: launch with SDK launcher so the paths are correct&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A skybox is a set of images used to create an exterior sky. These can be added to an atmosphere using the [[Atmosphere Editor]].&amp;lt;includeonly&amp;gt; &lt;br /&gt;
&lt;br /&gt;
{{main|Skybox}}&amp;lt;/includeonly&amp;gt;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
__NOEDITSECTION__&lt;br /&gt;
= Creating A Sky Box =&lt;br /&gt;
== Make The Image ==&lt;br /&gt;
* Create a sky image that tiles horizontally. Make it 4 times wider than it is high (eg. 2048x512).&lt;br /&gt;
* Save the image as {{filename|/base/atmosphere/skies/&amp;lt;mapname&amp;gt;.tga}}.&lt;br /&gt;
&lt;br /&gt;
== Convert The Image To a Skybox ==&lt;br /&gt;
Launch the game using the SDK Launcher to make sure your save paths are set up correctly (if you don't, it will output the files to the base ETQW folder rather than your mod directory).&lt;br /&gt;
Then you can use the {{consolecmd|halfSphereToSkybox}} console command to convert your image into a distortion-free skybox that can be used by the game.&lt;br /&gt;
* For example, type {{consolecmd|halfSphereToSkybox atmosphere/skies/&amp;lt;mapname&amp;gt;}}&lt;br /&gt;
* This will output {{filename|&amp;lt;mapname&amp;gt;_side.tga}} and {{filename|&amp;lt;mapname&amp;gt;_top.tga}} images into the same folder.&lt;br /&gt;
Here is an example showing what happens to your source image to get the skybox textures:&lt;br /&gt;
[[Image:skybox_conversion.jpg|Before and after converting a skybox image]]&lt;br /&gt;
&lt;br /&gt;
== Create A Material ==&lt;br /&gt;
Create a material for your new skybox. These are very simple since they're set up from a template. In general these materials are stored in {{filename|/base/materials/atmospheres/skydomes.mtr}}.&lt;br /&gt;
Example material:&lt;br /&gt;
 // used by ''&amp;lt;mapname&amp;gt;''&lt;br /&gt;
 material atmospheres/skydomes/''&amp;lt;mapname&amp;gt;'' {&lt;br /&gt;
 	useTemplate material/skybox&amp;lt; &amp;quot;highquality atmosphere/skies/''&amp;lt;mapname&amp;gt;''&amp;quot; &amp;gt;&lt;br /&gt;
 }&lt;br /&gt;
Save the material file and type {{consolecmd|reloadDecls}} in the console to load the updated material.&lt;br /&gt;
Your sky material should now be available to choose in the &amp;quot;Layer Material&amp;quot; section of the &amp;quot;Skydome &amp;amp; Clouds&amp;quot; tab of the [[Atmosphere Editor]].&lt;br /&gt;
&lt;br /&gt;
[[Category:Art]]&lt;br /&gt;
[[Category:Level Design]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>MoP</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.splashdamage.com/index.php?title=Necessary_map_declarations&amp;diff=3963</id>
		<title>Necessary map declarations</title>
		<link rel="alternate" type="text/html" href="https://wiki.splashdamage.com/index.php?title=Necessary_map_declarations&amp;diff=3963"/>
		<updated>2007-12-11T12:19:16Z</updated>

		<summary type="html">&lt;p&gt;MoP: one as&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{first etqwmap toc}}&lt;br /&gt;
== Materials ==&lt;br /&gt;
&lt;br /&gt;
Here is a list of materials for assets created later on. Simply copy the text from the boxs below and save to {{filename|materials/yourmapname.mtr}} Don't forget to find/replace 'etqwmap' with yourmapname.&lt;br /&gt;
&lt;br /&gt;
This is needed for some codey reason.&lt;br /&gt;
&lt;br /&gt;
 #include &amp;lt;materials/commandmaps.include&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
These are the megatexture materials. They look pretty as they use a template.&lt;br /&gt;
&lt;br /&gt;
 material megatextures/etqwmap { useTemplate megatextures/default_ambient_spec&amp;lt; &amp;quot;etqwmap&amp;quot; &amp;gt; }&lt;br /&gt;
 material megatextures/etqwmap_noshadows { useTemplate megatextures/default_ambient_spec_noshadows&amp;lt; &amp;quot;etqwmap&amp;quot;  &amp;gt; }&lt;br /&gt;
             &lt;br /&gt;
These are the command map materials. One for the regular command map, one for out of bounds.&lt;br /&gt;
 &lt;br /&gt;
 material commandmaps/etqwmap&lt;br /&gt;
 {&lt;br /&gt;
 	templates/game/maps/cmMap( &amp;quot;commandmaps/etqwmap.tga&amp;quot; )&lt;br /&gt;
  }&lt;br /&gt;
 &lt;br /&gt;
 material commandmaps/etqwmap_oob&lt;br /&gt;
 {&lt;br /&gt;
 	templates/game/maps/cmMap( &amp;quot;commandmaps/etqwmap_oob.tga&amp;quot; )&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
These are the territory materials.&lt;br /&gt;
&lt;br /&gt;
 material commandmaps/etqwmap_territory_01 { &lt;br /&gt;
 	templates/game/maps/cmIcon( makealpha( commandmaps/etqwmap/etqwmap_ter01.tga ) )&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 material commandmaps/etqwmap_territory_02 { &lt;br /&gt;
 	templates/game/maps/cmIcon( makealpha( commandmaps/etqwmap/etqwmap_ter02.tga ) )&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 material commandmaps/etqwmap_territory_03 {&lt;br /&gt;
 	templates/game/maps/cmIcon( makealpha( commandmaps/etqwmap/etqwmap_ter03.tga ) )&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 material commandmaps/etqwmap_territory_04 { &lt;br /&gt;
 	templates/game/maps/cmIcon( makealpha( commandmaps/etqwmap/etqwmap_ter04.tga ) )&lt;br /&gt;
 }&lt;br /&gt;
  &lt;br /&gt;
 material commandmaps/etqwmap_territory_05 { &lt;br /&gt;
 	templates/game/maps/cmIcon( makealpha( commandmaps/etqwmap/etqwmap_ter05.tga ) )&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
The level shot (loading screen image) material.&lt;br /&gt;
&lt;br /&gt;
 material levelshots/etqwmap { &lt;br /&gt;
  	 sort gui&lt;br /&gt;
 	{&lt;br /&gt;
  		blend blend&lt;br /&gt;
  		vertexColor&lt;br /&gt;
  		map nopicmip clamp	&amp;quot;levelshots/etqwmap&amp;quot;&lt;br /&gt;
 	}&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
The material for the small thumbnail of your map.&lt;br /&gt;
 &lt;br /&gt;
 material levelshots/thumbs/etqwmap { &lt;br /&gt;
 	 sort gui&lt;br /&gt;
 	{&lt;br /&gt;
 		blend blend&lt;br /&gt;
 		vertexColor&lt;br /&gt;
 		map nopicmip clamp	&amp;quot;levelshots/thumbs/etqwmap&amp;quot;&lt;br /&gt;
 	}&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
== Definitions ==&lt;br /&gt;
&lt;br /&gt;
Here are the map definitions needed for a functioning map. Save these to def/yourmapname.def&lt;br /&gt;
&lt;br /&gt;
 #include &amp;quot;def/pathfinder.include&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 heightMap heightmaps/etqwmap {&lt;br /&gt;
 	heightMap &amp;quot;heightmaps/etqwmap.tga&amp;quot;&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 deployMask masks/etqwmap/mcp {&lt;br /&gt;
 	mask		&amp;quot;masks/etqwmap/mcp.tga&amp;quot;&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 deployMask masks/etqwmap/default {&lt;br /&gt;
 	mask		&amp;quot;masks/etqwmap/default.tga&amp;quot;&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 deployMask masks/etqwmap/mcp_route {&lt;br /&gt;
 	mask		&amp;quot;masks/etqwmap/mcp_route.tga&amp;quot;&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 deployMask masks/etqwmap/playzone {&lt;br /&gt;
 	mask		&amp;quot;masks/etqwmap/playzone.tga&amp;quot;&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 stringMap pathfinder_etqwmap {&lt;br /&gt;
 	_pathfinder_default( &amp;quot;etqwmap&amp;quot;, 20 )&lt;br /&gt;
 	&amp;quot;playzone_0&amp;quot;					&amp;quot;etqwmap_playzone_path_and_heightmap&amp;quot;&lt;br /&gt;
  	&amp;quot;resolution_x_playzone_0&amp;quot;		&amp;quot;1280&amp;quot;&lt;br /&gt;
  	&amp;quot;resolution_y_playzone_0&amp;quot;		&amp;quot;1280&amp;quot;		&lt;br /&gt;
 	&amp;quot;mg_resolution_x_playzone_0&amp;quot;	&amp;quot;1280&amp;quot;&lt;br /&gt;
 	&amp;quot;mg_resolution_y_playzone_0&amp;quot;	&amp;quot;1280&amp;quot;	&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
[[Category:Basic Level Design]]&lt;/div&gt;</summary>
		<author><name>MoP</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.splashdamage.com/index.php?title=A_Simple_First_Megatexture&amp;diff=3962</id>
		<title>A Simple First Megatexture</title>
		<link rel="alternate" type="text/html" href="https://wiki.splashdamage.com/index.php?title=A_Simple_First_Megatexture&amp;diff=3962"/>
		<updated>2007-12-11T12:18:07Z</updated>

		<summary type="html">&lt;p&gt;MoP: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;So now that you've made [[A Simple First Terrain]], no doubt you'll want to apply a MegaTexture to it! This MegaTexture won't be as detailed or as attractive as an advanced MegaTexture, but will demonstrate the basics of creating a [[Surface Tree]], assigning textures, and compiling it all into a working MegaTexture file.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
'''For this tutorial you must:'''&lt;br /&gt;
* Have a terrain model UV-mapped in the 0-1 range (covered in the simple first terrain tutorial)&lt;br /&gt;
* Have access to some tiling textures. TODO: Link to MegaTexture media!&lt;br /&gt;
&lt;br /&gt;
If you don't have either of the above things, you are not ready to do this tutorial!&lt;br /&gt;
&lt;br /&gt;
'''This tutorial covers:'''&lt;br /&gt;
* How to set up a MegaTexture material&lt;br /&gt;
* How to create a Surface Tree&lt;br /&gt;
* How to add texture nodes in the Terrain Editor&lt;br /&gt;
* How to render and compile a full MegaTexture&lt;br /&gt;
&lt;br /&gt;
'''This tutorial does not cover:'''&lt;br /&gt;
* How to use Blender/Maya/Lightwave/ZBrush/Mudbox/3DSMax/Photoshop&lt;br /&gt;
* How to create tiling textures or heightmaps&lt;br /&gt;
* Anything overly complicated&lt;br /&gt;
&lt;br /&gt;
== Creating a MegaTexture Material ==&lt;br /&gt;
Here is an example:&lt;br /&gt;
 material megatextures/&amp;lt;mapname&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Assigning a Material ==&lt;br /&gt;
[[Image:simpleterrain_textured.png|thumb|200px|Textured terrain mesh]]&lt;br /&gt;
It is not possible to assign materials to terrain meshes in EditWorld, you must do this process in your modelling application. You can then re-export your terrain model to LWO, ASE, or OBJ format.&lt;br /&gt;
&lt;br /&gt;
Setting the mesh material differs between modelling packages. Usually it is just the high-level name of the material applied to your terrain mesh (the name of any bitmaps assigned will not make a difference).&lt;br /&gt;
&lt;br /&gt;
Due to an oddity with the OBJ format, the material name {{filename|megatextures/&amp;lt;mapname&amp;gt;}} is not valid inside an OBJ file. Instead, the material should be named {{filename|megatextures__&amp;lt;mapname&amp;gt;}}, where the slashes are replaced by double underscores (single underscores will not work!).&lt;br /&gt;
&lt;br /&gt;
If you are using Lightwave, 3ds Max, or Maya, you should not have to text-edit any files, just set the material name in the relevant section of the material editor.&lt;br /&gt;
&lt;br /&gt;
editWorld can then be told to reload the OBJ (now with a proper material declaration) via ''Misc -&amp;gt; Reload -&amp;gt; Models'' or clicking the &amp;quot;Reload Models&amp;quot; button.&lt;br /&gt;
&lt;br /&gt;
''Instead of using the concrete texture, you can use one of the existing Megatextures. For example, to use Area22's megatexture, simply set the mesh's material name to {{filename|megatextures__area22}}.''&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
== Creating the Surface Tree ==&lt;br /&gt;
Terrains are set up in the Terrain Editor, accessible via {{accelkey|shift}}{{accelkey|N}} in [[editWorld]]. This tool creates a Surface Tree file ({{filename|.sft}}) that contains all the information about the terrain, including roads, stamps, and detail texture information that MegaGen needs to generate a MegaTexture.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
[[Image:simpleterrain_terraineditor2.png|thumb|200px|Root node set up to use the correct terrain mesh]]&lt;br /&gt;
To set the mesh to the map, first press 'Begin Editing' at the bottom of the Terrain Editor window. Then {{accelbtn|RMB}} on the left-hand pane and create a new Tree via the menu. This creates a Root node on which all the terrain information resides. Clicking on the Root node allows a model to be specified - set {{keyname|Model}} to the name of the terrain mesh, in this case {{keyvalue|models/terrain/simpleterrain.obj}}. Press {{accelkey|enter}} to confirm and the terrain should appear in the 3D view, with the red placeholder material.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
== That's it! ==&lt;br /&gt;
[[Image:simpleterrain_ingame.png|thumb|400px|Terrain in-game]]&lt;br /&gt;
You've now created a map with your very own MegaTexture!&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
== Terrain Mesh UVs ==&lt;br /&gt;
If you find your MegaTexture is not displaying correctly, it may mean your mesh UVs are incorrect. Consult your modelling package to find out how to reset or unwrap the UVs on the terrain mesh.&lt;br /&gt;
&lt;br /&gt;
=== Important ===&lt;br /&gt;
Terrain model UV coordinates are expected to be inside the 0.0-1.0 UV range. If they are not, you may find that your terrain flickers or stretches when compiled into the map. If you are experiencing these problems, try a simple Planar Map from above, to project UV coordinates down onto your terrain mesh. (Blender instructions: select all the UV faces, hit {{accelkey|u}} and select 'Unwrap')&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
* [[An Advanced Terrain and Megatexturel]] - an advanced guide for complete MegaTexture creation&lt;br /&gt;
* [[Generate a MegaTexture]] - steps for generating a MegaTexture from the SDK launcher.&lt;br /&gt;
&lt;br /&gt;
[[Category:Art]]&lt;br /&gt;
[[Category:Basic Level Design]]&lt;br /&gt;
[[Category:Tutorials]]&lt;/div&gt;</summary>
		<author><name>MoP</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.splashdamage.com/index.php?title=A_Simple_First_Megatexture&amp;diff=3961</id>
		<title>A Simple First Megatexture</title>
		<link rel="alternate" type="text/html" href="https://wiki.splashdamage.com/index.php?title=A_Simple_First_Megatexture&amp;diff=3961"/>
		<updated>2007-12-11T12:11:02Z</updated>

		<summary type="html">&lt;p&gt;MoP: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;So now that you've made [[A Simple First Terrain]], no doubt you'll want to apply a MegaTexture to it! This MegaTexture won't be as detailed or as attractive as an advanced MegaTexture, but will demonstrate the basics of creating a [[Surface Tree]], assigning textures, and compiling it all into a working MegaTexture file.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
'''For this tutorial you must:'''&lt;br /&gt;
* Have a terrain model UV-mapped in the 0-1 range (covered in the simple first terrain tutorial)&lt;br /&gt;
* Have access to some tiling textures. TODO: Link to MegaTexture media!&lt;br /&gt;
&lt;br /&gt;
If you don't have either of the above things, you are not ready to do this tutorial!&lt;br /&gt;
&lt;br /&gt;
'''This tutorial covers:'''&lt;br /&gt;
* How to set up a MegaTexture material&lt;br /&gt;
* How to create a Surface Tree&lt;br /&gt;
* How to add texture nodes in the Terrain Editor&lt;br /&gt;
* How to render and compile a full MegaTexture&lt;br /&gt;
&lt;br /&gt;
'''This tutorial does not cover:'''&lt;br /&gt;
* How to use Blender/Maya/Lightwave/ZBrush/Mudbox/3DSMax/Photoshop&lt;br /&gt;
* How to create tiling textures or heightmaps&lt;br /&gt;
* Anything complicated&lt;br /&gt;
&lt;br /&gt;
== Assigning a Material ==&lt;br /&gt;
[[Image:simpleterrain_textured.png|thumb|200px|Textured terrain mesh]]&lt;br /&gt;
It is not possible to assign materials to terrain meshes in EditWorld, you must do this process in your modelling application.&lt;br /&gt;
&lt;br /&gt;
For testing purposes, terrain meshes are often assigned a temporary material until they are in a state that they can be textured properly. Traditionally, this has been one of the existing materials in the game, such as concrete - {{filename|textures/concrete/concrete10}} (although any valid material will work.)&lt;br /&gt;
&lt;br /&gt;
Due to an oddity with the OBJ format, the material name {{filename|textures/concrete/concrete10}} is not valid inside an OBJ file. Instead, the material should be named {{filename|textures__concrete__concrete10}}, where the slashes are replaced by double underscores (single underscores will not work!).&lt;br /&gt;
&lt;br /&gt;
Setting the mesh material differs between modelling packages. However, since OBJ files are text, they can be manually edited with a text editor instead of using the modelling application. The OBJ will contain a line (often about halfway through) starting with &amp;lt;tt&amp;gt;usemtl&amp;lt;/tt&amp;gt; followed by an arbitrary texture name. This line should be replaced with &amp;lt;tt&amp;gt;usemtl textures__concrete__concrete10&amp;lt;/tt&amp;gt; and the file saved.&lt;br /&gt;
&lt;br /&gt;
If you are using Lightwave, 3ds Max, or Maya, you should not have to text-edit any files, just set the material name in the relevant section of the material editor.&lt;br /&gt;
&lt;br /&gt;
editWorld can then be told to reload the OBJ (now with a proper material declaration) via ''Misc -&amp;gt; Reload -&amp;gt; Models'' or clicking the &amp;quot;Reload Models&amp;quot; button.&lt;br /&gt;
&lt;br /&gt;
''Instead of using the concrete texture, you can use one of the existing Megatextures. For example, to use Area22's megatexture, simply set the mesh's material name to {{filename|megatextures__area22}}.''&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
== Creating the Surface Tree ==&lt;br /&gt;
Terrains are set up in the Terrain Editor, accessible via {{accelkey|shift}}{{accelkey|N}} in [[editWorld]]. This tool creates a Surface Tree file ({{filename|.sft}}) that contains all the information about the terrain, including roads, stamps, and detail texture information that MegaGen needs to generate a MegaTexture.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
[[Image:simpleterrain_terraineditor2.png|thumb|200px|Root node set up to use the correct terrain mesh]]&lt;br /&gt;
To set the mesh to the map, first press 'Begin Editing' at the bottom of the Terrain Editor window. Then {{accelbtn|RMB}} on the left-hand pane and create a new Tree via the menu. This creates a Root node on which all the terrain information resides. Clicking on the Root node allows a model to be specified - set {{keyname|Model}} to the name of the terrain mesh, in this case {{keyvalue|models/terrain/simpleterrain.obj}}. Press {{accelkey|enter}} to confirm and the terrain should appear in the 3D view, with the red placeholder material.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
== That's it! ==&lt;br /&gt;
[[Image:simpleterrain_ingame.png|thumb|400px|Terrain in-game]]&lt;br /&gt;
You've now created a map with your very own MegaTexture!&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
== Terrain Mesh UVs ==&lt;br /&gt;
If you find your MegaTexture is not displaying correctly, it may mean your mesh UVs are incorrect. Consult your modelling package to find out how to reset or unwrap the UVs on the terrain mesh.&lt;br /&gt;
&lt;br /&gt;
=== Important ===&lt;br /&gt;
Terrain model UV coordinates are expected to be inside the 0.0-1.0 UV range. If they are not, you may find that your terrain flickers or stretches when compiled into the map. If you are experiencing these problems, try a simple Planar Map from above, to project UV coordinates down onto your terrain mesh. (Blender instructions: select all the UV faces, hit {{accelkey|u}} and select 'Unwrap')&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
* [[An Advanced Terrain and Megatexturel]] - an advanced guide for complete MegaTexture creation&lt;br /&gt;
* [[Generate a MegaTexture]] - steps for generating a MegaTexture from the SDK launcher.&lt;br /&gt;
&lt;br /&gt;
[[Category:Art]]&lt;br /&gt;
[[Category:Basic Level Design]]&lt;br /&gt;
[[Category:Tutorials]]&lt;/div&gt;</summary>
		<author><name>MoP</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.splashdamage.com/index.php?title=A_Simple_First_Megatexture&amp;diff=3960</id>
		<title>A Simple First Megatexture</title>
		<link rel="alternate" type="text/html" href="https://wiki.splashdamage.com/index.php?title=A_Simple_First_Megatexture&amp;diff=3960"/>
		<updated>2007-12-11T12:07:04Z</updated>

		<summary type="html">&lt;p&gt;MoP: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;So now that you've made [[A Simple First Terrain]], no doubt you'll want to apply a MegaTexture to it! This MegaTexture won't be as detailed or as attractive as an advanced MegaTexture, but will demonstrate the basics of creating a [[Surface Tree]], assigning textures, and compiling it all into a working MegaTexture file.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
'''For this tutorial you must:'''&lt;br /&gt;
* Have a terrain model UV-mapped in the 0-1 range (covered in the simple first terrain tutorial)&lt;br /&gt;
* Have access to some tiling textures. TODO: Link to MegaTexture media!&lt;br /&gt;
&lt;br /&gt;
If you don't have either of the above things, you are not ready to do this tutorial!&lt;br /&gt;
&lt;br /&gt;
'''This tutorial covers:'''&lt;br /&gt;
* How to set up a MegaTexture material&lt;br /&gt;
* How to create a Surface Tree&lt;br /&gt;
* How to add texture nodes in the Terrain Editor&lt;br /&gt;
* How to render and compile a full MegaTexture&lt;br /&gt;
&lt;br /&gt;
'''This tutorial does not cover:'''&lt;br /&gt;
* How to use Blender/Maya/Lightwave/ZBrush/Mudbox/3DSMax/Photoshop&lt;br /&gt;
* How to create tiling textures or heightmaps&lt;br /&gt;
* Anything complicated&lt;br /&gt;
&lt;br /&gt;
== Assigning a Working Material ==&lt;br /&gt;
Use your preferred modelling package to assign the material name to your mesh. &lt;br /&gt;
&lt;br /&gt;
== Creating a Caulk Hull ==&lt;br /&gt;
[[Image:simpleterrain_caulkhull.png|thumb|400px|The caulk hull]]&lt;br /&gt;
Since maps must be leak-free/sealed, maps with terrain must have a caulk hull to ensure this is the case.&lt;br /&gt;
&lt;br /&gt;
In this case, since the terrain is 32768 units long and wide, the caulk hull should also be the same dimensions. The caulk hull is quickly created from a brush 32768 units long, 32768 wide and 16384 units tall, which is then hollowed. The brushes are also assigned the 'editor/noimpactcaulk' texture, which prevents gunshots and projectiles from hitting the surfaces of the hull (they simply disappear instead.)&lt;br /&gt;
&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
== Setting The Terrain ==&lt;br /&gt;
[[Image:simpleterrain_terraineditor.png|thumb|200px|The Terrain Editor]]&lt;br /&gt;
The mesh must be triangulated before it is exported as an .OBJ, and saved as {{filename|models/terrain/simpleterrain.obj}}. At this stage, a texture is not necessary, and can be set later.&lt;br /&gt;
&lt;br /&gt;
Terrains are set up in the Terrain Editor, accessible via {{accelkey|shift}}{{accelkey|N}}. This tool creates a Surface Tree file ({{filename|.sft}}) that contains all the information about the terrain, including roads, stamps, and detail texture information that MegaBuild needs to generate a Megatexture.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
[[Image:simpleterrain_terraineditor2.png|thumb|200px|Root node set up to use the correct terrain mesh]]&lt;br /&gt;
To set the mesh to the map, first press 'Begin Editing' at the bottom of the Terrain Editor window. Then {{accelbtn|RMB}} on the left-hand pane and create a new Tree via the menu. This creates a Root node on which all the terrain information resides. Clicking on the Root node allows a model to be specified - set {{keyname|Model}} to the name of the terrain mesh, in this case {{keyvalue|models/terrain/simpleterrain.obj}}. Press {{accelkey|enter}} to confirm and the terrain should appear in the 3D view, with the red placeholder material.&lt;br /&gt;
&lt;br /&gt;
At this point you may add a player spawn, an atmosphere, and compile the level to check the terrain. However, since there is no material set, there will be rendering issues.&lt;br /&gt;
&lt;br /&gt;
''You may find the 3D terrain is partly covered or obscured by the base of caulk hull. This can be fixed by moving or resizing the caulk hull so it contains the terrain properly.''&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
== Assigning a Material ==&lt;br /&gt;
[[Image:simpleterrain_textured.png|thumb|200px|Textured terrain mesh]]&lt;br /&gt;
It is not possible to assign materials to terrain meshes in EditWorld, you must do this process in your modelling application.&lt;br /&gt;
&lt;br /&gt;
For testing purposes, terrain meshes are often assigned a temporary material until they are in a state that they can be textured properly. Traditionally, this has been one of the existing materials in the game, such as concrete - {{filename|textures/concrete/concrete10}} (although any valid material will work.)&lt;br /&gt;
&lt;br /&gt;
Due to an oddity with the OBJ format, the material name {{filename|textures/concrete/concrete10}} is not valid inside an OBJ file. Instead, the material should be named {{filename|textures__concrete__concrete10}}, where the slashes are replaced by double underscores (single underscores will not work!).&lt;br /&gt;
&lt;br /&gt;
Setting the mesh material differs between modelling packages. However, since OBJ files are text, they can be manually edited with a text editor instead of using the modelling application. The OBJ will contain a line (often about halfway through) starting with &amp;lt;tt&amp;gt;usemtl&amp;lt;/tt&amp;gt; followed by an arbitrary texture name. This line should be replaced with &amp;lt;tt&amp;gt;usemtl textures__concrete__concrete10&amp;lt;/tt&amp;gt; and the file saved.&lt;br /&gt;
&lt;br /&gt;
If you are using Lightwave, 3ds Max, or Maya, you should not have to text-edit any files, just set the material name in the relevant section of the material editor.&lt;br /&gt;
&lt;br /&gt;
editWorld can then be told to reload the OBJ (now with a proper material declaration) via ''Misc -&amp;gt; Reload -&amp;gt; Models'' or clicking the &amp;quot;Reload Models&amp;quot; button.&lt;br /&gt;
&lt;br /&gt;
''Instead of using the concrete texture, you can use one of the existing Megatextures. For example, to use Area22's megatexture, simply set the mesh's material name to {{filename|megatextures__area22}}.''&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
== Map Geometry ==&lt;br /&gt;
[[Image:simpleterrain_building.png|thumb|200px|Exported geometry used to help edit the terrain]]&lt;br /&gt;
The map and terrain are now in a state that they can be used for level design, however difficulty can arise ensuring the structures in the level fit to the terrain. &lt;br /&gt;
&lt;br /&gt;
This can be countered using editWorld's export tool, which exports map geometry for importing into the modelling package alongside the terrain. This can be done by selecting the geometry to export (such as a building or a reference, located anywhere in the map), and pressing {{accelkey|ctrl}}{{accelkey|e}}. This writes the geometry to {{filename|models/export.obj}}.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
[[Image:simpleterrain_refinedmesh.png|thumb|200px|Exported geometry used to help edit the terrain]]&lt;br /&gt;
The exported geometry can then be used as a template to modify the terrain accordingly - such as flattening areas of land to fit buildings, cutting holes for entrances of simply adding more detail. The modified terrain mesh is then saved for further work in editWorld.&lt;br /&gt;
&lt;br /&gt;
Most often, terrain vertices are snapped to the corners of buildings and structures, such that the terrain faces now covered by the building can be deleted. This allows for buildings to sink into the terrain, and lead into underground areas of the map.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
[[Image:simpleterrain_fixedterrain.png|thumb|200px|Terrain after being edited to fit the geometry.]]&lt;br /&gt;
This process of refinement is repeated many times throughout the life of the map, ensuring the terrain precisely fits the map geometry. &lt;br /&gt;
&lt;br /&gt;
''When working with terrained maps, most level geometry is stored in separate [[References]] to allow for easy editing.''&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
== That's it! ==&lt;br /&gt;
[[Image:simpleterrain_ingame.png|thumb|400px|Terrain in-game]]&lt;br /&gt;
You've now created a map with your very own MegaTexture!&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
== Terrain Mesh UVs ==&lt;br /&gt;
If you find your MegaTexture is not displaying correctly, it may mean your mesh UVs are incorrect. Consult your modelling package to find out how to reset or unwrap the UVs on the terrain mesh.&lt;br /&gt;
&lt;br /&gt;
=== Important ===&lt;br /&gt;
Terrain model UV coordinates are expected to be inside the 0.0-1.0 UV range. If they are not, you may find that your terrain flickers or stretches when compiled into the map. If you are experiencing these problems, try a simple Planar Map from above, to project UV coordinates down onto your terrain mesh. (Blender instructions: select all the UV faces, hit {{accelkey|u}} and select 'Unwrap')&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
* [[An Advanced Terrain and Megatexturel]] - an advanced guide for complete MegaTexture creation&lt;br /&gt;
* [[Generate a MegaTexture]] - steps for generating a MegaTexture from the SDK launcher.&lt;br /&gt;
&lt;br /&gt;
[[Category:Art]]&lt;br /&gt;
[[Category:Basic Level Design]]&lt;br /&gt;
[[Category:Tutorials]]&lt;/div&gt;</summary>
		<author><name>MoP</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.splashdamage.com/index.php?title=MegaGen&amp;diff=3956</id>
		<title>MegaGen</title>
		<link rel="alternate" type="text/html" href="https://wiki.splashdamage.com/index.php?title=MegaGen&amp;diff=3956"/>
		<updated>2007-12-11T10:51:21Z</updated>

		<summary type="html">&lt;p&gt;MoP: swapped incorrect headings around&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;MegaGen is the in-game tool for generating uncompressed, un-lit [[MegaTexture]] tiles. It loads a [[Surface Tree]], analyses the nodes and texture layers, and renders out sets of 4096x4096 pixel diffuse and local normal-map textures.&amp;lt;includeonly&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{main|MegaGen}}&amp;lt;/includeonly&amp;gt;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Output files can be found in the base game folder under ''maps/&amp;lt;mapname&amp;gt;_x_y.tga'', where x and y denote the tile number (0,0 being top left).&lt;br /&gt;
&lt;br /&gt;
= MegaBuild Options =&lt;br /&gt;
*Resolution - the final [[MegaTexture]]'s width and height in pixels.&lt;br /&gt;
** Same as '''-r &amp;lt;resolution&amp;gt;''' on the command line&lt;br /&gt;
*Render hidden nodes - this will render all nodes, even if they're hidden by the designer&lt;br /&gt;
** Same as '''-renderHidden''' on the command line&lt;br /&gt;
&lt;br /&gt;
= Memory Cache =&lt;br /&gt;
* '''st_imageCacheSize''' - amount of system RAM used for caching textures. The bigger this is, the faster compiles will go. &lt;br /&gt;
**32-bit EXEs should only use up to around 1.5GB or so (1536).&lt;br /&gt;
**64-bit EXEs can use up to around 7GB (7168) (This is on a machine with 8GB of memory, more could be used if more is available. Safe bet is to use at least a GB less than there is physical memory available).&lt;br /&gt;
&lt;br /&gt;
= Video Cache =&lt;br /&gt;
* '''st_imageCacheVidMemSize''' - amount of video RAM used for caching textures. This shouldn't be more than half of your card's RAM.&lt;br /&gt;
&lt;br /&gt;
[[Category:Art]]&lt;br /&gt;
[[Category:Level Design]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>MoP</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.splashdamage.com/index.php?title=Portal_Basics&amp;diff=3955</id>
		<title>Portal Basics</title>
		<link rel="alternate" type="text/html" href="https://wiki.splashdamage.com/index.php?title=Portal_Basics&amp;diff=3955"/>
		<updated>2007-12-11T10:36:52Z</updated>

		<summary type="html">&lt;p&gt;MoP: /* Developer Commands */ r_useportals not t_useportals&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Portals are not teleporters!'''&lt;br /&gt;
&lt;br /&gt;
Portals are used to reduce the amount of work the renderer has to do. In essence, a portal is a window into an area of a map; if the renderer can not see a portal into an area of the map, it knows the area behind the portal can not be seen by the player either, and therefore does not need to render it. Similarly, if the player is very far from the portal, such that it only uses a few pixels on the screen, the renderer knows it's not worth rendering the area behind it.&lt;br /&gt;
&lt;br /&gt;
The important thing to understand is that portals are only useful when used to distinguish separate areas, and when the area they hide is complex enough to make it worth not rendering. Hence portals are usually created in doorways or entryways that are crucial for the player to get from one part of the map to another.&lt;br /&gt;
&lt;br /&gt;
There are several types of portals. 'Visportals' are the most basic and simply won't render the area behind it when it itself isn't on-screen (or is too small to be considered worth rendering). Other portals are used to control the flow of light and to alter the ambient lighting within the different interior sections of maps. However, all portals are created in the same way and follow the same basic rules.&lt;br /&gt;
&lt;br /&gt;
== Creating a portal ==&lt;br /&gt;
A portal is created by assigning all but one face of a brush the [[Common Textures#common/nodraw|nodraw]] texture. The remaining face should be given the portal texture ([[Common Textures#common/visportal|visportal]], [[Common Textures#common/outsideportal|outsideportal]], or [[Common Textures|otherwise]].) The face with the chosen portal should cut completely through the area to be portalled - that is, the portal-textured face should touch ceiling, floor, and walls on both sides. Usually, this means portals are rectangular.&lt;br /&gt;
&lt;br /&gt;
[[Image:Portals_goodbad.jpg|frame|none|How to set up a simple portal correctly.]]&lt;br /&gt;
&lt;br /&gt;
It is also important to note that '''portals must completely seal areas from each other'''. So if you have two rooms joined by three doorways, if you add a portal to one doorway, you need to add a portal to the other two doorways as well. In other words, it should be impossible to look at one side of a portal and then look at the other side without needing to pass through a portal to do so.&lt;br /&gt;
&lt;br /&gt;
== Portal types ==&lt;br /&gt;
&lt;br /&gt;
=== visportal ===&lt;br /&gt;
* Texture: &amp;lt;tt&amp;gt;[[Common Textures#editor/visportal|/editor/visportal]]&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The most common portal, used to hide areas of a map that should not be rendered when the portal is not in view. Note how the green visportal texture is placed in doorways - when those doorways are not in view, the areas behind them will not be rendered. Also note how the purple 'nodraw' texture in the first screenshot is actually the backside of the bigger portal in the second screenshot.&lt;br /&gt;
&lt;br /&gt;
[[Image:P_vis1.jpg|frame|left|visportal placement in Sewer]] [[Image:P_vis2.jpg|frame|left|visportal placement in Sewer]]&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
==== Uses ====&lt;br /&gt;
Visportals serve two main purposes:&lt;br /&gt;
# They can reduce the number of polygons that need to be drawn, hence&lt;br /&gt;
# They can reduce the number of textures that need to be in memory&lt;br /&gt;
&lt;br /&gt;
The combination of these means that portals can lead to significant performance gains, as the renderer has less work to do. Hence some areas can use more detail than normal, knowing the additional detail will be culled away by portals when not in sight. Conversely, portals can also make the game more accessible on lower-spec machines as the renderer knows which areas can be safely culled without affecting the experience for the user.&lt;br /&gt;
&lt;br /&gt;
The difficulty is placing portals and geometry appropriately. If placed badly, it can mean that two high-detail areas are in view at the same time, so the engine renders many more polygons and uses more texture memory, in some cases leading to a sudden decrease in performance.&lt;br /&gt;
&lt;br /&gt;
=== ambientportal ===&lt;br /&gt;
* Texture: &amp;lt;tt&amp;gt;[[Common Textures#editor/ambientportal|/editor/ambientportal]]&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Used to separate ambient lighting areas defined by [[Entity light_ambient|light_ambient]] entities.&lt;br /&gt;
&lt;br /&gt;
=== audioportal ===&lt;br /&gt;
* Texture: &amp;lt;tt&amp;gt;/textures/editor/audioportal&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Used to separate areas of sound, for example to make sure the sound of machinery in one room doesn't leak into an adjacent room.&lt;br /&gt;
&lt;br /&gt;
=== aasclusterportal ===&lt;br /&gt;
* Texture: &amp;lt;tt&amp;gt;/textures/common/aasclusterportal&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Distinguishes to areas for AAS generation purposes. &lt;br /&gt;
&lt;br /&gt;
=== outsideportal ===&lt;br /&gt;
* Texture: &amp;lt;tt&amp;gt;[[Common Textures#editor/outsideportal|/textures/editor/outsideportal]]&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Used to separate the inside (indoors) and outside (outdoors) of a level, in order to control light (and shadow) from sunlight.&lt;br /&gt;
&lt;br /&gt;
=== playzoneportal ===&lt;br /&gt;
* Texture: &amp;lt;tt&amp;gt;/textures/editor/playzoneportal&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Used to separate a map into two or more playzones - in the same manner that Slipgate is split across two environments. Each of Slipgate's environments are surrounded with a playzone portal hull.&lt;br /&gt;
&lt;br /&gt;
== Developer Commands ==&lt;br /&gt;
[[Image:Portals_showportals.jpg|frame|left|r_showPortals in action]]&lt;br /&gt;
* {{consolecmd|r_showPortals 0/1/2/3}} - turns on rendering of portal outlines so it's possible to see which portals are active (rendered green) and which are not (rendered red). This is a good command to use to help understand how portals work and where they are placed in other maps. Setting {{consolecmd|r_showPortals 3}} displays what type each portal is.&lt;br /&gt;
* {{consolecmd|r_usePortals 0/1}} - turns on/off portals (when turned off, everything is drawn, whether it is visible or not)&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
== Additional Resources ==&lt;br /&gt;
* [http://www.iddevnet.com/doom3/visportals.php Vis Portals] - a good overview of visportals and explanation of how they work&lt;br /&gt;
* [http://www.modwiki.net/wiki/Visportal Visportal topic on modwiki] - a slightly simpler explanation&lt;br /&gt;
&lt;br /&gt;
[[Category:Basic Level Design]]&lt;/div&gt;</summary>
		<author><name>MoP</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.splashdamage.com/index.php?title=How_do_I&amp;diff=3954</id>
		<title>How do I</title>
		<link rel="alternate" type="text/html" href="https://wiki.splashdamage.com/index.php?title=How_do_I&amp;diff=3954"/>
		<updated>2007-12-11T10:36:20Z</updated>

		<summary type="html">&lt;p&gt;MoP: /* General Editing */ selecting is LMB not RMB&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''This is your quick reference guide for all those tasks you know are possible, but just can't quite remember how to do...'''&lt;br /&gt;
&lt;br /&gt;
The commands listed below assume default key shortcuts.&lt;br /&gt;
&lt;br /&gt;
== Views ==&lt;br /&gt;
* '''Move the 2D view''' - drag with the {{accelbtn|RMB}} in a 2D view&lt;br /&gt;
* '''Zoom the 2D view''' - use {{accelbtn|mouse wheel}} in a 2D view&lt;br /&gt;
* '''Change the grid size''' - use the {{accelkey|]}} and {{accelkey|[}} keys, numbers {{accelkey|1}} to {{accelkey|9}} on the keyboard, or the 'Grid' menu&lt;br /&gt;
* '''Place camera at cursor''' in 2D view - {{accelkey|ctrl}}{{accelbtn|LMB}} on new camera position&lt;br /&gt;
* '''Aim camera at cursor''' in 2D view - {{accelbtn|MMB}} at new camera target&lt;br /&gt;
&lt;br /&gt;
== General Editing ==&lt;br /&gt;
* '''Create a brush''' - {{accelbtn|LMB}}-drag in a 2D view&lt;br /&gt;
* '''Create an entity''' - {{accelbtn|RMB}}-click in a 2D view&lt;br /&gt;
* '''Select an object''' - use {{accelkey|shift}}{{accelbtn|LMB}} or {{accelkey|alt}}{{accelkey|shift}}{{accelbtn|LMB}}&lt;br /&gt;
* '''Select several objects''' (box-selection) - {{accelkey|alt}}{{accelbtn|LMB}}-drag a box around the objects to select.&lt;br /&gt;
* '''Move an object''' - select it, then click {{accelbtn|LMB}} inside the object to drag around&lt;br /&gt;
* '''Rotate an object''' - select it, then press {{accelkey|ctrl}}{{accelkey|R}} followed by {{accelkey|ctrl}}{{accelkey|X}}, {{accelkey|ctrl}}{{accelkey|Y}} or {{accelkey|ctrl}}{{accelkey|Z}} (depending on axis)&lt;br /&gt;
* '''Rotate an object arbitrarily''' - select it, then press {{accelkey|R}} for rotation mode&lt;br /&gt;
* '''Duplicate the selected object''' - press {{accelkey|space}}&lt;br /&gt;
* '''Delete the selected object''' - press {{accelkey|backspace}}&lt;br /&gt;
* '''Deselect an object''' - use {{accelkey|shift}}{{accelbtn|LMB}}&lt;br /&gt;
* '''Deselect all''' - press {{accelkey|Escape}}&lt;br /&gt;
* '''Stretch a brush''' - select it, then {{accelbtn|LMB}}-click outside the brush to drag the nearest face&lt;br /&gt;
* '''Shear a brush''' - select it, then use {{accelkey|ctrl}}{{accelbtn|LMB}} outside the brush to drag the nearest face.&lt;br /&gt;
* '''Vertex manipulate a brush or patch''' - select it, then press {{accelkey|E}} or {{accelkey|V}}&lt;br /&gt;
* '''Clip/Slice a brush''' - select it, then use {{accelkey|ctrl}}{{accelbtn|RMB}} to place clipping points (up to 3), and {{accelkey|enter}}/{{accelkey|shift}}{{accelkey|enter}}/{{accelkey|ctrl}}{{accelkey|enter}} to finish&lt;br /&gt;
* '''Select a face''' - in the 3D view, use {{accelkey|ctrl}}{{accelkey|shift}}{{accelbtn|LMB}}&lt;br /&gt;
* '''Copy texture from a face''' - in the 3D view, with a target face selected, {{accelbtn|MMB}}-click on the face with the texture to copy&lt;br /&gt;
* '''Copy texture to a face''' - in the 3D view, with a source face selected, {{accelkey|ctrl}}{{accelbtn|MMB}}-click on the face with the texture to overwrite&lt;br /&gt;
* '''Shift or rotate a texture''' - select the brush(es) or face(s) to modify, and press {{accelkey|S}} for the surface inspector&lt;br /&gt;
* '''Edit an entity's properties''' - select the entity and press {{accelkey|N}} for the entity inspector&lt;br /&gt;
* '''Export selected brushes as .obj''' - press {{accelkey|ctrl}}{{accelkey|E}}&lt;br /&gt;
* '''Snap selected objects to grid''' - press {{accelkey|ctrl}}{{accelkey|G}}&lt;br /&gt;
&lt;br /&gt;
== Map Features ==&lt;br /&gt;
* '''Spawn a player''' - place a player spawn entity, for example [[Entity info_team_gdf_spawn|info_team_gdf_spawn]]&lt;br /&gt;
* '''Spawn a vehicle''' - place a deployable entity, for example [[Entity deployable_spawn_icarus|deployable_spawn_icarus]]&lt;br /&gt;
&lt;br /&gt;
== Map Technicalities ==&lt;br /&gt;
* '''Create a [[LOD Group]]''' - go to the ''Groups Inspector'' ({{accelkey|L}}), press the ''LOD Groups'' button and press the green plus sign.&lt;br /&gt;
* '''Assign objects to a LOD Group''' - select the objects, then {{accelbtn|RMB}} on the LOD Group and choose 'Add Selection''&lt;br /&gt;
* '''Change the fade in/out distances of a LOD Group''' - select the LOD Group, then alter its {{keyname|MinVisDist}} and {{keyname|MaxVisDist}} settings&lt;br /&gt;
&lt;br /&gt;
== Map Organisation ==&lt;br /&gt;
* '''Hide unselected objects''' - press {{accelkey|ctrl}}{{accelkey|shift}}{{accelkey|h}}&lt;br /&gt;
* '''Hide selected objects''' - press {{accelkey|h}}&lt;br /&gt;
* '''Show hidden objects''' - press {{accelkey|shift}}{{accelkey|h}}&lt;br /&gt;
* '''Show/Hide Caulk''' - toggle with {{accelkey|Alt}}{{accelkey|6}}&lt;br /&gt;
* '''Show/Hide Clips''' - toggle with {{accelkey|Alt}}{{accelkey|7}}&lt;br /&gt;
* '''Show/Hide Entities''' - toggle with {{accelkey|Alt}}{{accelkey|2}}&lt;br /&gt;
* '''Show/Hide Patches''' - toggle with {{accelkey|ctrl}}{{accelkey|p}}&lt;br /&gt;
* '''Show/Hide References''' - toggle with {{accelkey|alt}}{{accelkey|r}}&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
* '''Toggle the real-time renderer''' - press {{accelkey|F3}}&lt;br /&gt;
* '''Load the game window''' - press {{accelkey|F2}}&lt;br /&gt;
* '''Load my map''' - get the game window up, go to the console, and use the {{consolecmd|devmap}} command (e.g. {{consolecmd|devmap mymap}})&lt;br /&gt;
&lt;br /&gt;
== In-game console commands ==&lt;br /&gt;
The console can be accessed by pressing the tilde button (above the TAB key). Also see [[Developer cheats]]&lt;br /&gt;
* '''Fly around''' - {{consolecmd|noclip}} toggles no clipping mode&lt;br /&gt;
* '''Be invincible''' - {{consolecmd|god}}&lt;br /&gt;
* '''Spawn a vehicle''' - {{consolecmd|spawn}}, e.g. {{consolecmd|spawn vehicle_husky}}&lt;br /&gt;
* '''Render portal outlines''' - {{consolecmd|r_showPortals}}&lt;br /&gt;
* '''Render face outline/wireframe''' - {{consolecmd|t_showTris}}&lt;br /&gt;
* '''Render coloured batch groups''' - {{consolecmd|r_showBatches}}&lt;br /&gt;
* '''Render occlusion tested objects''' - {{consolecmd|r_showOcclusions}}&lt;br /&gt;
* '''Test vis distances''' - {{consolecmd|r_visDistOfs}} e.g. {{consolecmd|r_visDistOfs 16384}} to be 16k units further away.&lt;br /&gt;
&lt;br /&gt;
[[Category:Level Design]]&lt;/div&gt;</summary>
		<author><name>MoP</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.splashdamage.com/index.php?title=MegaTexture&amp;diff=3949</id>
		<title>MegaTexture</title>
		<link rel="alternate" type="text/html" href="https://wiki.splashdamage.com/index.php?title=MegaTexture&amp;diff=3949"/>
		<updated>2007-12-07T17:24:35Z</updated>

		<summary type="html">&lt;p&gt;MoP: links so this page isn't entirely useless&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The MegaTexture is a very large texture (32,768x32,768 pixels per map in ETQW), used on terrain models.&lt;br /&gt;
&lt;br /&gt;
If you have [[A Simple First Terrain|made a terrain model]], you can create a MegaTexture using the [[Terrain Editor]], and then compile it by following [[Generate a MegaTexture|this tutorial]].&lt;br /&gt;
&lt;br /&gt;
== Related Articles ==&lt;br /&gt;
*[[An Advanced Terrain and Megatexture]]&lt;br /&gt;
*[[Surface Tree]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Art]]&lt;br /&gt;
[[Category:Level Design]]&lt;/div&gt;</summary>
		<author><name>MoP</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.splashdamage.com/index.php?title=Surface_Tree&amp;diff=3948</id>
		<title>Surface Tree</title>
		<link rel="alternate" type="text/html" href="https://wiki.splashdamage.com/index.php?title=Surface_Tree&amp;diff=3948"/>
		<updated>2007-12-07T17:21:46Z</updated>

		<summary type="html">&lt;p&gt;MoP: don't edit SFT manually!&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A Surface Tree (''.sft'' file) is a set of nodes containing references to textures, roads, stamps and projectors used to create a [[MegaTexture]] for a terrain mesh.&amp;lt;includeonly&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{main|Surface tree}}&amp;lt;/includeonly&amp;gt;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A surface tree is needed if your map contains a terrain model. You can create a surface tree using [[editWorld]]'s [[Terrain Editor]].&lt;br /&gt;
&lt;br /&gt;
Do not edit ''.sft'' files manually, since they are generated by editWorld and will be overwritten every time the Terrain Editor content is saved.&lt;br /&gt;
&lt;br /&gt;
[[Category:Art]]&lt;br /&gt;
[[Category:Level Design]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>MoP</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.splashdamage.com/index.php?title=Generate_a_MegaTexture&amp;diff=3947</id>
		<title>Generate a MegaTexture</title>
		<link rel="alternate" type="text/html" href="https://wiki.splashdamage.com/index.php?title=Generate_a_MegaTexture&amp;diff=3947"/>
		<updated>2007-12-07T17:19:19Z</updated>

		<summary type="html">&lt;p&gt;MoP: Updated with paths image at Jared's request, RLT info at Hoffa's request.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;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!&lt;br /&gt;
&lt;br /&gt;
Each section contains a ''&amp;quot;View Command Line&amp;quot;'' 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.&lt;br /&gt;
&lt;br /&gt;
= Using the tools =&lt;br /&gt;
[[Image:sdk_launcher_paths.png|300px|right|The &amp;quot;Launch The SDK&amp;quot; tab of the ETQW SDK Launcher.]]&lt;br /&gt;
&lt;br /&gt;
=== Paths setup ===&lt;br /&gt;
Firstly you need to select a valid game path, and a valid save path in the main ''&amp;quot;Launch the SDK&amp;quot;'' tab. If you have already set this up to work with your custom maps and mods, you shouldn't have to change anything here.&lt;br /&gt;
&lt;br /&gt;
Just make sure you have the correct ''&amp;quot;Save Path&amp;quot;'' and ''&amp;quot;Mod Name&amp;quot;'' which contain your custom terrains, textures and maps selected.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
== Generate a MegaTexture ==&lt;br /&gt;
[[Image:sdk_launcher_megatexture.png|300px|right|The &amp;quot;Generate a MegaTexture&amp;quot; tab of the ETQW SDK Launcher.]]&lt;br /&gt;
To access the MegaTexture generation tools, run the ETQW SDK Launcher, and go to the ''&amp;quot;Generate a MegaTexture&amp;quot;'' tab.&lt;br /&gt;
&lt;br /&gt;
=== Load a Surface Tree ===&lt;br /&gt;
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.&lt;br /&gt;
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!&lt;br /&gt;
&lt;br /&gt;
* Click the ''&amp;quot;Browse...&amp;quot;'' button next to the &amp;quot;1. Choose a Surface Tree&amp;quot; field.&lt;br /&gt;
* Browse to your save path's ''/maps/'' folder and select your {{filename|&amp;lt;mapname&amp;gt;.sft}} file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Create a RenderLight Template ===&lt;br /&gt;
Before you can compile a full MegaTexture, you will need to create a ''.rlt'' template. You can find examples of these in {{filename|base/renderlight/}}. You can create one by making a blank ''.txt'' file and renaming the extension to ''.rlt''.&lt;br /&gt;
&lt;br /&gt;
A RenderLight template looks like this:&lt;br /&gt;
 {&lt;br /&gt;
 	mesh		&amp;quot;models/terrain/&amp;lt;mapname&amp;gt;.lwo&amp;quot;&lt;br /&gt;
 	diffuse		&amp;quot;maps/&amp;lt;mapname&amp;gt;_d.tga&amp;quot;&lt;br /&gt;
 	bump		&amp;quot;maps/&amp;lt;mapname&amp;gt;_local.tga&amp;quot;&lt;br /&gt;
 	out		&amp;quot;megatextures/&amp;lt;mapname&amp;gt;_lit.tga&amp;quot;&lt;br /&gt;
 	map 		&amp;quot;maps/&amp;lt;mapname&amp;gt;.entities&amp;quot;&lt;br /&gt;
 	atmosphere	&amp;quot;&amp;lt;atmosphere name&amp;gt;&amp;quot;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
* '''mesh''' - this should point to the relative path of your terrain model.&lt;br /&gt;
* '''diffuse''' - this is the path to the output diffuse texture tiles from the MegaGen stage.&lt;br /&gt;
* '''bump''' - this is the path to the output local normal-map texture tiles from the MegaGen stage.&lt;br /&gt;
* '''out''' - this is where RenderLight will output the lit texture tiles.&lt;br /&gt;
* '''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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Important notes ===&lt;br /&gt;
* You must have fully compiled your map successfully at least once before these processes will work.&lt;br /&gt;
* Your map's terrain model must have a &amp;quot;MegaTexture material&amp;quot; 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]].&lt;br /&gt;
* 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.&lt;br /&gt;
* Make sure all your paths are set up correctly, otherwise files may be missing.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= The processes =&lt;br /&gt;
== MegaGen ==&lt;br /&gt;
[[MegaGen]] is the first stage of making a MegaTexture. It scans your ''.sft'' file for textures and then renders them all to flat &amp;quot;tiles&amp;quot;, 4096x4096 pixels across. Each tile comes in two parts, a &amp;quot;diffuse&amp;quot; tile (contains un-lit surface color), and a &amp;quot;local normal&amp;quot; tile (for the bump and directional information).&lt;br /&gt;
&lt;br /&gt;
These tiles will be outputted to your ''/maps'' folder, in the format {{filename|&amp;lt;mapname&amp;gt;_d_0_0.tga}}, and {{filename|&amp;lt;mapname&amp;gt;_local_0_0.tga}}.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Click on the &amp;quot;MegaGen Options &amp;gt;&amp;gt;&amp;quot; button to expand the option list. The settings are fairly straightforward:&lt;br /&gt;
* '''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 &amp;quot;preview&amp;quot; compiles, or for smaller terrain sizes.&lt;br /&gt;
* '''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.&lt;br /&gt;
* '''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.&lt;br /&gt;
* '''Additional Options''' - this is for advanced users to choose specific settings. A more comprehensive guide can be found in the [[MegaGen]] article.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== RenderLight ==&lt;br /&gt;
[[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 &amp;quot;tiles&amp;quot; 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&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Click on the &amp;quot;RenderLight Options &amp;gt;&amp;gt;&amp;quot; button to expand the option list. The settings are as follows:&lt;br /&gt;
* '''Bake lighting''' - when checked, this option will bake the atmospheric sunlight into the MegaTexture.&lt;br /&gt;
* '''Bake ambient''' - when checked, this option will bake the ambient atmospheric light into the MegaTexture.&lt;br /&gt;
* 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}}.&lt;br /&gt;
* '''Additional Options''' - this is for advanced users to choose specific settings. A more comprehensive guide can be found in the [[RenderLight]] article.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Make MegaTexture ==&lt;br /&gt;
[[MakeMegaTexture]] is the process which compiles the tiles output from the RenderLight process into a compressed ''.mega'' file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Click on the &amp;quot;Make MegaTexture Options &amp;gt;&amp;gt;&amp;quot; to expand the option list. The settings are as follows:&lt;br /&gt;
* '''Best Quality''' - denotes using the best quality compression. You should usually leave this enabled.&lt;br /&gt;
* '''Luminance Error''' - controls the brightness compression quality, where lower amounts mean better quality but larger file sizes.&lt;br /&gt;
* '''Chrominance Error''' - controls the colour compression quality, where lower amounts mean better quality but larger file sizes.&lt;br /&gt;
* '''Alpha Error''' - controls the alpha compression quality, where lower amounts mean better quality but larger file sizes.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For our retail Megatextures, we used 3-channel output from RenderLight, with all the MakeMegaTexture Error settings at 1, for best quality.&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Run the processes =&lt;br /&gt;
Once you have set up all of the options for your MegaTexture, you can set the processes running.&lt;br /&gt;
* Each process can be launched individually by clicking the ''&amp;quot;Run&amp;quot;'' button on the right of each section.&lt;br /&gt;
* The ''&amp;quot;Run Selected Tasks&amp;quot;'' button in the bottom right will launch all of the checked processes.&lt;br /&gt;
** If this is the first time you're compiling a MegaTexture, check all 3 boxes for MegaGen, RenderLight and MegaTexture.&lt;br /&gt;
* 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 ''&amp;quot;Run Selected Tasks&amp;quot;''.&lt;br /&gt;
** Alternately, you can just click the ''&amp;quot;Make MegaTexture&amp;quot;'' button in the MegaTexture field.&lt;br /&gt;
&lt;br /&gt;
[[Category:Art]]&lt;br /&gt;
[[Category:Level Design]]&lt;/div&gt;</summary>
		<author><name>MoP</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.splashdamage.com/index.php?title=File:Sdk_launcher_paths.png&amp;diff=3946</id>
		<title>File:Sdk launcher paths.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.splashdamage.com/index.php?title=File:Sdk_launcher_paths.png&amp;diff=3946"/>
		<updated>2007-12-07T17:10:39Z</updated>

		<summary type="html">&lt;p&gt;MoP: SDK Launcher Paths&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;SDK Launcher Paths&lt;/div&gt;</summary>
		<author><name>MoP</name></author>
		
	</entry>
</feed>