-
Notifications
You must be signed in to change notification settings - Fork 133
Exporting from Blender
This pipeline uses Physically Based Shading. In order to create your materials properly in Blender, there are a few important things:
First, every material has 4 or 5 textures, in the following order:
- Diffuse
- Normal
- Specular
- Roughness
- Displace (Optional)
It is important that you don't skip any of the slots, as the indices change then! If you have a material which does not require a normal texture for example, setup an empty texture for it. There are empty textures included in the pipeline at Data/Textures/EmptyXXXTexture.png. It could look like this then:
You should use the empty textures provided by the pipeline, as they contain some fixed (necessary) values. Remember to use UV-Mapped coordinates for all textures, otherwise yabee can not export them properly.
All textures sizes should be a power-of two. I recommend a size of 1024x1024 or less, but for highly detailed materials you can use higher resolutions. Notice that not all textures have to have the same size. You can for example use a 512x512 for the diffuse, but a 2048x2048 texture for the specular to increase detail.
Your diffuse texture should be 8bit RGBA, storing the alpha mask in the alpha channel. If your texture is RGB only, no alpha mask will be used. A sample diffuse texture could look like this:
Your normal texture should be 8bit RGB, and store values from 0 to 1. It is important that you don't use the normal texture to modify the intensity of the bump mapping, but instead the bump-map-strength parameter (see below), and store the full intensity in the normal map. The values in the normal map should be normalized from -1 .. 1 to 0 .. 1 (most exporters like crazyBump, shaderMap already do that). Again, a sample normal texture:
The specular texture should be 8bit RGB, although only the R channel is used. When packing the pipeline (todo: link to manual page), it will be merged with the other textures. The values should range from 0 .. 1, again, don't use this texture to adjust the specular intensity! Modify the specular-factor instead (see below). Sample specular texture:
The roughness texture will be empty the most time, but you can use it to add scratches or rust to the surface. The same rules as for the specular texture apply.
Now, that you have setup the textures, you want to adjust the material scalars. There are multiple of them, each should be tweaked carefully:
Base Color
The base color is also known as diffuse or albedo. When the material is not metallic, this is the diffuse color. When the material is metallic, this represents the specular color. Your diffuse texture will get multiplied with that. The diffuse texture is stored in the Diffuse section of the material properties:
Specular Factor
This factor controls the specular intensity. Your specular texture get's multiplied with this factor to determine the final specular factor. The specular factor is stored in the R component of the Specular Color in Blender:
You have to set specular intensity to 1.0 in order to get proper results! Otherwise all your factors will get multiplied by the specular intensity, what do you don't want! This also applies for all other scalars which are stored in the specular component.
Metallic
This determines wheter your material is metallic or not. It should be either 0.0 or 1.0, but very rarely something between. It is stored in the G component of the specular.
Roughness
This stores how rough your material is. (Todo: Link wiki page to scalars). It should be between 0 and 1, but mostly will be something inbetween, like 0.2. It is stored in the B component of the specular. Again, your roughness texture gets multiplied with this to compute the final roughness value.
Bump-Map Strength
This scalar gets multiplied with your normal map. It controls the intensity of the normal map, and should be stored in the alpha component. To make the alpha component available, first enable transparency:
Then, set the transparency mode to mask and store the bump map strength in the alpha field:
Done!
Notice: Your objects might now look strange in blender. This is okay, as we misused blenders material properties to store our own properties. If you followed this guide correctly, they should look okay in the pipeline.
Rendering Pipeline by tobspr (c) 2014 - 2016
For developers: