Mapdev:howto height blender: Difference between revisions

From Spring
Jump to navigationJump to search
m spelling
more cleaning.
Line 5: Line 5:
Texture maps will have to be done externally for now, until I figure out a reliable solution to the large image size problem.
Texture maps will have to be done externally for now, until I figure out a reliable solution to the large image size problem.


== Begin ==  
== Begin ==
# open up blender
* Open up blender
# delete the default cube and the light, since they arent used
* Delete the default cube and the light, since they arent used


== Add a Plane ==
== Add a Plane ==
The plane is 2x2 units by default, so scale it up to the size you want.
Were going to be using blender units as Spring Map Units.
lets make an 8x8 map 8x64 = 512 units. 2*256 = 512.
The newly created plane size is 2x2, scale it by 4 to get 8x8 etc.


Add another plane to use for the water reference,scale it up roughly, and make it be on another layer so you can turn it on and off easily.
== Add another plane ==
* Add another plane to use for the water reference
* Scale it up to roughly
* Name it
* Put it on the second layer so you can turn it on and off easily.
* Turn off your ability to select it using the outliner


== Render Settings ==
== Render Settings ==
FIXME- need discussion on non square maps, pretty sure the largest dimension wins. anyway...
FIXME- need discussion on non square maps, pretty sure the largest dimension wins. anyway...
# change the render to cycles
 
# change render resolution to 513 and the percentage to 100%
* Change the renderer to cycles
* Change render resolution
The height map resolution is defined as SMU * 64 + 1, so for this map, 8x8 = 513x513
* Make sure render percentage is 100%


== Camera Settings ==
== Camera Settings ==
# move camera to 0,0,[higher than maximum terrain height], and rotation to 0,0,0
* Move camera to [0,0,?] z needs to be higher than he highest point on the map
# adjust clipping to be 0, [very large]
* Rotation to [0,0,0]
# change camera to orthographic
* Adjust clipping to be [0,?] as large as it needs to be so that the bottom of your map isnt cut off.
# Set orthographic scale to 512
* Change camera to orthographic
* Set orthographic scale to the largest SMU, our map is square so its 8
* Move the camera to layer 3 to make it managable
* Turn off your ability to select the camera in the outliner


== Shading ==
== Shading ==
# Select default new material
* Select your terrain
# change it to nodes
* Change the material to the only available option(default new material)
# change type from diffuse BSDF to emmission
* Select Use Nodes
* Change type from ''Diffuse BSDF'' to ''Emmission''
 
=== Height ===
=== Height ===
The image below shows the node setup I use to render a height map.
The image below shows the node setup I use to render a height map.
Line 35: Line 48:
Once you are finished sculpting you will modify the add value and the divide value based on your completed terrain.
Once you are finished sculpting you will modify the add value and the divide value based on your completed terrain.


* The Add node is used to raise the terrain height values to compensate for being negative z values or under water in this setup. it will have to be manually set
*The Add node is used to raise the terrain height values to compensate for being negative z values or under water in this setup. it will have to be manually set
* The Divide node is used to give maximum precision of black and white values and should be the maximum z dimension of your terrain, found in its transform properties.
*The Divide node is used to give maximum precision of black and white values and should be the maximum z dimension of your terrain, found in its transform properties.
 
[[File:Blender-node000.png]]
[[File:Blender-node000.png]]


=== Incline Map ===
=== Incline Map ===
The below image shows the node setup I use to do two things.
The below image shows the node setup I use to do two things:
# Check while sculpting if terrain is walkable or buildable
# Check while sculpting if terrain is walkable or buildable
# Generate helper map for Splat detail textures.
# Generate helper map for Splat detail textures.


to use for terrain build/walk checking connect the true normal to the cross product instead of the normal,it will show the face normal rather than the smoothed normal.
To use for terrain build/walk checking connect the true normal to the cross product instead of the normal, it will show the face normal rather than the smoothed normal.
 
The colour ramp will probably need adjusting depending on your needs. [[File:Blender-node001.png]]


the colour ramp will probably need adjusting depending on your needs.
[[File:Blender-node001.png]]
=== Examples ===
=== Examples ===
height map
Height map [[File:Blender-screen-000.png]] Visual of build/walk [[File:Blender-screen-001.png]] Detail distribution [[File:Blender-screen-002.png]]
[[File:Blender-screen-000.png]]
visual of build/walk
[[File:Blender-screen-001.png]]
detail distribution
[[File:Blender-screen-002.png]]


== Sculpting ==
== Sculpting ==
# subdivide the plane to create the exact number of verts that you will see in game
* subdivide the plane to create the exact number of verts that you will see in game
w+enter 9 times
 
2,4,8,16,32,64, 128, 256, 512
w,subdivide 9 times 2,4,8,16,32,64, 128, 256, 512
# pull out the sculpt mode and set up the restriction to only transform on the Z Axis
 
# sculpt away
* Change to sculpt mode and set up the restriction to only transform on the Z Axis
* Sculpt away
 
I also use basic mesh editing to flatten certain areas with falloff enabled, this lets me scale in the Z direction to give truly flat areas for building on etc.


== Render ==
== Render ==
# happy times!
* Happy times!


== FIXME ==
== FIXME ==
* make the height map node properties driven by the terrain values.. so no manual adjustment is needed after the fact.
* make the height map node properties driven by the terrain values.. so no manual adjustment is needed after the fact.

Revision as of 06:01, 23 May 2012

Preparation

Get the latest blender 2.63 and up should do it. Blender can render images as large as your ram allows.. I've found that on a system with four gig of ram I can render easily and reliably a 2049x2049 height(Displacement) map, translated into game units thats a 32x32 map size. more ram would allow larger maps, not sure what Spring's map size limit is.

Texture maps will have to be done externally for now, until I figure out a reliable solution to the large image size problem.

Begin

  • Open up blender
  • Delete the default cube and the light, since they arent used

Add a Plane

Were going to be using blender units as Spring Map Units. The newly created plane size is 2x2, scale it by 4 to get 8x8 etc.

Add another plane

  • Add another plane to use for the water reference
  • Scale it up to roughly
  • Name it
  • Put it on the second layer so you can turn it on and off easily.
  • Turn off your ability to select it using the outliner

Render Settings

FIXME- need discussion on non square maps, pretty sure the largest dimension wins. anyway...

  • Change the renderer to cycles
  • Change render resolution

The height map resolution is defined as SMU * 64 + 1, so for this map, 8x8 = 513x513

  • Make sure render percentage is 100%

Camera Settings

  • Move camera to [0,0,?] z needs to be higher than he highest point on the map
  • Rotation to [0,0,0]
  • Adjust clipping to be [0,?] as large as it needs to be so that the bottom of your map isnt cut off.
  • Change camera to orthographic
  • Set orthographic scale to the largest SMU, our map is square so its 8
  • Move the camera to layer 3 to make it managable
  • Turn off your ability to select the camera in the outliner

Shading

  • Select your terrain
  • Change the material to the only available option(default new material)
  • Select Use Nodes
  • Change type from Diffuse BSDF to Emmission

Height

The image below shows the node setup I use to render a height map.

Once you are finished sculpting you will modify the add value and the divide value based on your completed terrain.

  • The Add node is used to raise the terrain height values to compensate for being negative z values or under water in this setup. it will have to be manually set
  • The Divide node is used to give maximum precision of black and white values and should be the maximum z dimension of your terrain, found in its transform properties.

Incline Map

The below image shows the node setup I use to do two things:

  1. Check while sculpting if terrain is walkable or buildable
  2. Generate helper map for Splat detail textures.

To use for terrain build/walk checking connect the true normal to the cross product instead of the normal, it will show the face normal rather than the smoothed normal.

The colour ramp will probably need adjusting depending on your needs.

Examples

Height map Visual of build/walk Detail distribution

Sculpting

  • subdivide the plane to create the exact number of verts that you will see in game

w,subdivide 9 times 2,4,8,16,32,64, 128, 256, 512

  • Change to sculpt mode and set up the restriction to only transform on the Z Axis
  • Sculpt away

I also use basic mesh editing to flatten certain areas with falloff enabled, this lets me scale in the Z direction to give truly flat areas for building on etc.

Render

  • Happy times!

FIXME

  • make the height map node properties driven by the terrain values.. so no manual adjustment is needed after the fact.