-
Notifications
You must be signed in to change notification settings - Fork 11
Blender Addons: materials
In Blender, materials are used to paint the model; the same happens with Spore. When using the Blender addons to create new models, you will have to change the materials so the model looks exactly how you want. Materials are edited in the Properties panel (usually in the right side of the screen), under this tab:
If you scroll down the panel, you will see one section called RenderWare4 Material Config; that's the one the addons use when exporting the model, the rest of Blender material settings are ignored:
There are multiple material types that are used for different kind of models:
-
SkinPaint Part
: Used for creature, cell, outfitter, plant parts. -
MineralPaint Part
: Used for building and vehicle parts. -
Static Model
: Used for almost anything else. It's like the models you see in other videogames, this is used for: rocks, editor backgrounds, tribe huts, civ walls, adventure props,... -
Custom Shader Material
: With this, your model will use a custom shader.
A single model can have multiple mesh objects, and each of these objects can have multiple materials. Each face in the model can only have one material assigned: you can do that by going to the Edit mode (pressing Tab) and clicking the Assign
button with the faces and the material selected:
SkinPaint parts never use multiple objects or materials. For the rest, multiple materials are quite common since they allow you to use different settings for different regions of your model: for example, in building parts mumltiple materials are used so that different regions can use different paints.
Having said this, material types are rarely mixed: you cannot have a model that is both a MineralPaint Part and a Static Model. The only ones that can be combined are Static Model and Custom Shader Material
SkinPaint is the texturing system used for creatures and plants. So the SkinPaint Part
is the material you should use if you want to create a part for the creature (cell, outfitters) or plant editors.
The only important attribute is Diffuse Texture
, which points to .dds
texture that is painted into the part. The texture can have transparecny: pixels with transparency will be filled with the creature color. If you leave the attribute empty, an empty transparent texture will be used (so the creature color will be used on all the part).
MineralPaint is the texturing system used for buildings and vehicles. It is not comparable to texturing in other games because the texture remains the same even when you stretch or modify the part. For most building/vehicle parts, both the texture and the UV coordinates of the part will be ignored; instead, Spore will calculate UV coordinates automatically using projections.
The Paint Mode
attributes decides the type of region:
This is the standard mode used for building/vehicle parts: the model will use whatever paint the player assigned in the editor.
The first important property is the Paint Region
. You probably know that most building parts let you use more than one paint in the same part, painting it in different regions: this property is used to differentiate those regions. All the meshes in your model that use the same number as paint region will use the same paint in the game. Be warned: some numbers make the paint not display properly, we don't really know why; 7 works fine.
Then comes the UV Projection
; as we mentioned, Spore ignores the UV coordinates and automatically maps them using projections. At the final of this page there's a tutorial that will show you some of these projections.
The UV Scale
is used if you want the paint texture to be painted smaller/bigger: small values will make the texture look bigger, big values will make the texture look smaller. UV Offset
can be used to move the texture so it starts at a different point.
Sometimes you will want a region to be painted all the same, but there's no projection that fits it correctly. In that case, you should split it into separate materials, each one using the appropriate projection, and then assign the same Paint Region
number so they all use the same paint.
This means the model will use the color painted by the player, but not the paint texture itself. By default, these regions are painted gray instead of the usual white color of building/vehicle parts.
It only has the Paint Region
attribute, which has the same use as in the other mode.
The most simple one:instead of using the paint decided by the player, this mode will always display the texture assigned in the model. This is the only mode where UV coordinates and texture will be used.
Used in most models in the games, it can be used for almost anything as long as it's not a part: editor backgrounds, rocks, tribe huts, adventure objects,...
Static models use two textures:
-
Diffuse Texture
: The color texture that is painted into the model. In some game engines it is known as "albedo". -
Normal Texture
: Normal mapping is used to define more detail. A normal texture is used to make the lighting system believe there's bumpiness in your part. More info on wikipedia. The alpha channel of the texture is used as a specular map.
Some other attributes:
-
Material Opacity
: By default the models are set toOpaque
; however, it's possible to make the model semi-transparent, so you can see objects behind it. That's what the optionAlpha
does: the regions of the diffuse texture that have transparecny will look transparent in the model too. The optionExcluding
will discard pixels of the texture that have less than 50% of transparency (that's what the trees in the editor background do). -
Specular Exponent
,Inverse Bumpiness
,Gloss
,Material Params[3]
: Attributes related to how the model reflects light, the last one is unknown. More info on wikipedia.
It is possible to use multiple meshes or meshes with multiple materials with static models. This is usually used to provide different textures, or different specular settings...
Since it's possible to create custom shaders with SporeModder FX, the Blender addons have a material so you can use your custom shader in your model.
The Shader Name
property is the ID (or name) of either an Standard Shader or a Shader Builder.
We'll see how the projections work by trying to export this as a building part:
You can download the .blend
file here: https://mega.nz/#!iQM22SZL!w4zC_Uyw_ws5evuhsiGUvibeQsB9gT_NLyOJ3dG8jn8
We want the base and top of the part to always use the same paint, and the laterals to use another paint; this means that we will have to use two different Paint Region
s.
Also notice how the model contains three different regions: one is a cylindrical lateral, then there is the flat lateral, and then the bottom/top flat planes; it seems pretty clear that a single projection setting won't work correctly on all these three components.
The first thing we are going to do is switch to the Material panel and delete all existing materials. Now, create a new material, which we will use for the cylinder region. Scroll down to the RenderWare4 Material Config
panel and set the material type to MineralPaint Part
. Ensure that the paint mode is set to Paint (Texture)
.
These are the available projection modes:
There are three Cylindrical, which seem the obvious choice here. Now the question is, which of the three do we pick, X, Y or Z?
The letter on the cylindrical options means the axis the cylinder is around:
So it seems clear that our model needs a Cylindrical Z. If we export the part and add it to the building editor, this is how it looks now:
If you think the texture looks too small, you can try changing the UV Scale
setting.
The top and bottom parts of our model don't look good with the cylindrical projection, so we'll assign it a new one. Create a new material in the model. Now, how do we make it so that it only affects the top and bottom planes?
Enter Edit Mode (by pressing Tab) and select ONLY the faces that must be affected by the new material (if you are selecting vertices, select all the vertices of those faces). Now click on the Assign
button under the material name:
Now those faces have been deassigned from the other material and assigned to this new one. This is how you can have multiple materials in a single mesh object.
So, what projection do we use? In the projections list there are three with a plane icon: the letters next to them are the axes to which the plane is parallel. For example: Project XY means the plane is parallel to the X and Y axes, so it is facing the Z axis. That's what happens with the top/bottom regions of our model, so it's the projection we want.
Remember how we said we wanted these region to use a different paint than the laterals? We have to change the Paint Region
for that. The other material used 7, so we will use 9 for this one.
Now the part looks perfect, and it uses two separate paints! Notice how I've decreased the UV Scale
to 0.25 so that the paint texture looks bigger. You can download the final .blend
file here: https://mega.nz/#!DEUQ1QCQ!Gnjhk5SFRbWleUzCE25vLp7UHV30ipNrCgFcw4ZTBHQ