Difference between revisions of "Planting Some Grass"

m (Adding a bit of soil)
(Replacing page with '== Adding a patch of grass == == Adding a tree ==')
Line 1: Line 1:
Ok, "planting grass" is obviously a metaphor for texturing your age.
+
== Adding a patch of grass ==
  
In this chapter, we're going to texture the rocks, add some grass, and add sky.
+
== Adding a tree ==
 
+
== UV Mapping ==
+
 
+
If you read the Blender Noob To Pro tutorial, you probably already know about creating textures.
+
But you may have missed what '''UV Mapping''' is.
+
 
+
Basically, UV mapping is precisely assigning vertices or faces to parts of your texture.<br/>
+
The coordinates that a vertex gets assigned on the texture are called U and V - hence the name UV mapping.
+
 
+
* '''Note:'''
+
*:In Uru, UV Coordinates are set per-vertex, while in Blender they are set per-face (meaning that a vertex can have separate UV
+
coordinates for each face that it's attached to).
+
*:The plugin does accurately handle this (by duplicating vertices for each face that has different UV coordinates), so don't worry too much - but to avoid getting too many vertexes duplicated, it's always best to have similar uv coordinates for as much vertices as possible.
+
*: Most automatic UV calculations already put uv coordinates
+
 
+
We're going to let blender automatically unwrap the island we just made, into nice UV coordinates.
+
 
+
You can start by making one Blender window a '''UV/Image Editor''' window.<br/>
+
After that, you can select your object (when you're in object-mode) and press [F] to switch to UV editing mode.<br/>
+
It's best to put the view from straight above by pressing the [7] key on your numpad. (That makes automatic mapping easier later on) <br/>
+
Don't forget to select all the faces by using the [A]-key.
+
 
+
It should look like this, when you're in UV Edit mode now: <br/>
+
[[Image:Tutorial UVMap Start.png]]<br/>
+
 
+
As you can see, the '''UV/Image Editor''' window, shows the UV coordinates for each selected face.<br/>
+
Right now, all faces use the same part of the texture - you can imagine how ugly that must look....
+
 
+
We're going to fix that by having blender "unwrap" the texture.<br/>
+
Press [U]-key on your keyboard to bring up the following pop-op menu that gives us a few options:<br/>
+
[[Image:Tutorial UV Automatic.png]]
+
 
+
We are going to use '''Unwrap''', the topmost option.<br/>
+
As you can see in the result below, it tries to accurately map the surface to a flat sheet of texture, but at the same time it  translates the relative size of the faces correctly to texture space. (Letting larger faces have a bigger part of the texture than smaller faces)
+
 
+
The result if this operation is below:<br/>
+
[[Image:Tutorial Unwrap.png]]<br>
+
It looks a bit weird, I know, but it has a texture map that is balanced to the size of the faces, and that is the most important here.
+
 
+
== Making the island rocky ==
+
First, we are going to give the entire island a rocky material. After all, we need a bit of solid surface to plant something on.
+
 
+
To do this, we are going to use the following two textures:
+
 
+
[[Image:Rock_.png]][[Image:Rock_detail.png]]
+
 
+
=== Base Rock ===
+
The first texture, we will apply as a basic terrain.<br/>
+
Make a new material to the mesh, and add a texture to it - call it '''Rock'''  or something like that:<br/>
+
[[Image:Tutorial_AddRockMaterial.png]]
+
 
+
Make the color something like in the image above.<br/>
+
Since we are making a rock, we can get away with letting it have a bit of specularity if you wish.<br/>
+
To do that, set the specularity slider and hardness slider.<br/>
+
 
+
Now, we are going to add the texture.<br/>
+
Go to the textures panel, and load in the rocky texture from above. Make it look like below:<br/>
+
[[Image:Tutorial_AddRockTexture.png]]<br/>
+
By having the '''MIPMAP''' button pressed, PyPRP is told to make MipMaps of the image (a set of continually smaller images used to render at greater distances.)<br/>
+
The '''INTERPOL''' button tells PyPRP to compress the texture.<br/>
+
 
+
Now, it's probably a bad idea to have this entire texture encompass the entire island. So, we're going to scale it up a little...
+
In the Material Tab, select the '''Rock''' texture, and then select the '''Map Input''' panel:<br/>
+
[[Image:Tutorial_RockMapInput.png]]<br/>
+
 
+
Set the map input button to '''UV''', telling PyPRP to use the UV map.<br/>
+
For scaling it up, we're going to use the SizeX and SizeY fields.<br/>
+
As in the example picture, set them both to '''6.0'''. This will make the texture image 6 times smaller in rendering. That way it's a bit smaller and more realistic.
+
 
+
=== Rocky Detail ===
+
We now have a bit of a problem:<br/>
+
If we make the texture any smaller - it will get too repetitive, not showing us large outlines of the rocks, as we are used to in real life. But on the other hand, at the moment, it does not give enough detail to convey a realistic result.
+
 
+
To solve this, we will use the second texture I provided - '''Rock_detail.png''' This image has a lot of transparency (alpha),  except on the areas that are close to the edges. It will be used to give the a more detailed rocky effect to the terrain.
+
 
+
'''''Note:'' This image was made in GIMP from the first rocky texture by adding an layer mask for transparency, and using the result of an 'edge detect' for the mask.'''
+
 
+
Add it to the material like you did before (call it '''RockDetail'''), but this time, make the SizeX and SizeY quite a bit larger, as this texture must be a lot smaller. Around '''32.0''' for both should be ok.<br/>
+
[[Image:Tutorial_RockDetailMapInput.png]]<br/>
+
 
+
Now, we have another trick:<br/>
+
It would be nice if the influence of this map would fade a bit with distance. To accomplish this, we are going to influence the creation of the mipmaps, so that each new mipmap level gets a little more transparency than the previous one.
+
 
+
Go to the Texture tab, and make your settings look like this:<br/>
+
[[Image:Tutorial_RockDetailTexture.png]]<br/>
+
The '''USEALPHA''' button will ensure that your texture gets compressed in a format that preserves transparency. (Even though pyprp should detect that automatically)
+
 
+
Our fading trick however, is accomplished by the '''filter''' field.<br/>
+
On every new mipmap level that is created, the transparency (alpha) of the texture is multiplied wiht this number.<br/>
+
So, by setting it '''''lower''''' than '''1.0''', each mimpap level gets a little ''more'' transparent than the last one.<br/>
+
The influence of the texture will thus fade with distance.<br/>
+
But by setting it '''''higher''''' than '''1.0''', each mipmap level gets a little ''less'' transparent than the last one.<br/>
+
That way, the influence of the texture will increase with distance.
+
 
+
If you did all this, the terrain will have a nice rocky texture that has both detail, and is not too repetitive.
+
 
+
 
+
== Adding a bit of soil ==
+
Now, we should have a little vegetation on our island. However, it is a well known fact that plants don't grow that well on rock alone.<br/>
+
We will need to add a patch of fertile soil for us to have that grass upon.<br/>
+

Revision as of 14:36, 21 January 2008

Adding a patch of grass

Adding a tree