Dash
04-17-2006, 01:47 AM
Alrighty, I'm writing this tutorial for the many many mappers out there that have trouble with making nice smooth displacements and keep their maps optimized at the same time.
My technique is very simple and it is based on powers of 2 to work. This is a VERY important concept to achieve smooth and leak-free displacements.
Rule #1: Powers of 2
Almost all the models you will use and all the entities are based on powers of 2, this is a very important concept for displacements, as their precision factor ("power" in the displacements window) is also based on the power of 2 (2^2, 2^3 and 2^4).
The best way to make displacements is to choose a magic trio number that consist of 3 numbers from the power of 2 such as 16, 32, 64, 128, 256, 512, 1024 (you get the idea).
Each displacement will be a square of the size of one of these numbers, so you will need to plan in advance. You ABSOLUTELY HAVE to choose 3 numbers in a row (16,32,64 is good, but 16 64 128 isn't).
Most maps usually use the 1024,512,256 trio or the 512,256,128 for more precision. More on that later.
For this tutorial I will be using the 256x256, 128x128 and 64x64 trio.
Rule #2: Subdivisions
This is directly linked to Rule #1. Subdivisions are what are making your displacement. A displacement is built with triangles, or rather divided squares. The more subdivisions, the higher the amount of detail you'll be going into.
Rule #3: Splitting
Splitting your terrain is extremily important. try to make the smaller squares near buildings, and large squares in empty fields. This way you'll be able to optimize easier in the end (more on that later).
Rule #4: Sewing!!!!
Sewing is your god here. Always Click "Sew" whenever you are modifying the geometry of your displacements to verify for correct connectivity between displacements. This will avoid you from having displacement leaks and spot bad optimization faster.
ONTO THE TUTORIAL!!!!
http://www.daretogame.com/maps/tutorial_displacements/01.jpg
Displacements are faces of polygons that have been extracted and subdivided. Before doing any displacements, place square brushes (also known as polygons) around your buildings. Each brush will need to be a square of the size of your chosen trio (in this case it's large 256 by 256, medium 128 by 128 and small 64 by 64).
Be sure to apply the NODRAW texture to the brushes you'll be making and do NOT make them overlap. Always be sure that ALL THE EDGES ARE ALIGNED TOGETHER.
http://www.daretogame.com/maps/tutorial_displacements/02.jpg
Apply a "Blend" texture or any other texture you wish to use on your displacement on the top face of all the brushes. It's wise to check the "Treat as One" option here, especially when dealing with grass. Be sure to set the rotation and scale to your preferences here.
http://www.daretogame.com/maps/tutorial_displacements/03.jpg
It's not time to create the displacement. On the displacement tab, click "CREATE" and select Power: 2.
You will see your terrain split up in different sized subdivisions.
http://www.daretogame.com/maps/tutorial_displacements/04.jpg
In fact, this subdivision is problematic. Using AUTO-SEW (check it), start making mountains around the house.
http://www.daretogame.com/maps/tutorial_displacements/05.jpg
You'll notice that the edges aren't lining up together nicely because the subdivisions are different. This is where the Rule of Power of 2 and Subdivisions kick in. If you followed the rules, this is an easy issue to fix.
Right now, all the displacement pieces have the power of 2. This means that no matter what size your displacement is, it will be split up in 4 pieces (which will then be subdivided to form 32 triangles).
This little equation will be useful:
16x16 fits 4 times in 32x32, 32x32 fits 4 times in 64x64.
Basically, everytime you go up one number of the magic trio, the number of squares formed by the displacement power (which is 2 for all) is upped to the square.
We will be working on the smalled scale here which is 64x64. If you want to have uniform displacements, all displacements will need to have 32 triangles per 64x64 region. This is where the play on powers comes handy.
64x64 will keep the power of 2, since this displacement is the root size of others.
128x128 will need to have its triangle count squared, as I explained above. This means its power will be bumped up one more square, so 128x128 becomes power of 3.
256x256 will need to double square its triangle count, so we add 2 to its power, which is 4, and also the maximum power a displacement can have! Pretty neat huh?
http://www.daretogame.com/maps/tutorial_displacements/06.jpg
After changing the power of each displacement, this is how our terrain now looks like subdivided. Pretty smooth and uniform isn't it?
http://www.daretogame.com/maps/tutorial_displacements/07.jpg
Here you can see a 64x64 displacement selected on the left and the 256x256 displacement on the right. They look the same.
My technique is very simple and it is based on powers of 2 to work. This is a VERY important concept to achieve smooth and leak-free displacements.
Rule #1: Powers of 2
Almost all the models you will use and all the entities are based on powers of 2, this is a very important concept for displacements, as their precision factor ("power" in the displacements window) is also based on the power of 2 (2^2, 2^3 and 2^4).
The best way to make displacements is to choose a magic trio number that consist of 3 numbers from the power of 2 such as 16, 32, 64, 128, 256, 512, 1024 (you get the idea).
Each displacement will be a square of the size of one of these numbers, so you will need to plan in advance. You ABSOLUTELY HAVE to choose 3 numbers in a row (16,32,64 is good, but 16 64 128 isn't).
Most maps usually use the 1024,512,256 trio or the 512,256,128 for more precision. More on that later.
For this tutorial I will be using the 256x256, 128x128 and 64x64 trio.
Rule #2: Subdivisions
This is directly linked to Rule #1. Subdivisions are what are making your displacement. A displacement is built with triangles, or rather divided squares. The more subdivisions, the higher the amount of detail you'll be going into.
Rule #3: Splitting
Splitting your terrain is extremily important. try to make the smaller squares near buildings, and large squares in empty fields. This way you'll be able to optimize easier in the end (more on that later).
Rule #4: Sewing!!!!
Sewing is your god here. Always Click "Sew" whenever you are modifying the geometry of your displacements to verify for correct connectivity between displacements. This will avoid you from having displacement leaks and spot bad optimization faster.
ONTO THE TUTORIAL!!!!
http://www.daretogame.com/maps/tutorial_displacements/01.jpg
Displacements are faces of polygons that have been extracted and subdivided. Before doing any displacements, place square brushes (also known as polygons) around your buildings. Each brush will need to be a square of the size of your chosen trio (in this case it's large 256 by 256, medium 128 by 128 and small 64 by 64).
Be sure to apply the NODRAW texture to the brushes you'll be making and do NOT make them overlap. Always be sure that ALL THE EDGES ARE ALIGNED TOGETHER.
http://www.daretogame.com/maps/tutorial_displacements/02.jpg
Apply a "Blend" texture or any other texture you wish to use on your displacement on the top face of all the brushes. It's wise to check the "Treat as One" option here, especially when dealing with grass. Be sure to set the rotation and scale to your preferences here.
http://www.daretogame.com/maps/tutorial_displacements/03.jpg
It's not time to create the displacement. On the displacement tab, click "CREATE" and select Power: 2.
You will see your terrain split up in different sized subdivisions.
http://www.daretogame.com/maps/tutorial_displacements/04.jpg
In fact, this subdivision is problematic. Using AUTO-SEW (check it), start making mountains around the house.
http://www.daretogame.com/maps/tutorial_displacements/05.jpg
You'll notice that the edges aren't lining up together nicely because the subdivisions are different. This is where the Rule of Power of 2 and Subdivisions kick in. If you followed the rules, this is an easy issue to fix.
Right now, all the displacement pieces have the power of 2. This means that no matter what size your displacement is, it will be split up in 4 pieces (which will then be subdivided to form 32 triangles).
This little equation will be useful:
16x16 fits 4 times in 32x32, 32x32 fits 4 times in 64x64.
Basically, everytime you go up one number of the magic trio, the number of squares formed by the displacement power (which is 2 for all) is upped to the square.
We will be working on the smalled scale here which is 64x64. If you want to have uniform displacements, all displacements will need to have 32 triangles per 64x64 region. This is where the play on powers comes handy.
64x64 will keep the power of 2, since this displacement is the root size of others.
128x128 will need to have its triangle count squared, as I explained above. This means its power will be bumped up one more square, so 128x128 becomes power of 3.
256x256 will need to double square its triangle count, so we add 2 to its power, which is 4, and also the maximum power a displacement can have! Pretty neat huh?
http://www.daretogame.com/maps/tutorial_displacements/06.jpg
After changing the power of each displacement, this is how our terrain now looks like subdivided. Pretty smooth and uniform isn't it?
http://www.daretogame.com/maps/tutorial_displacements/07.jpg
Here you can see a 64x64 displacement selected on the left and the 256x256 displacement on the right. They look the same.