-
Notifications
You must be signed in to change notification settings - Fork 133
Exporting from Blender
It is highly recommended you use the BAM Exporter to export your models. Just follow the instructions in the readme to install it. After you successfully installed and configured it, continue to read.
You should also read Materials first to understand how materials work in the render pipeline.
Every material can have up to 5 textures, and must have at least 4, in the following order:
- BaseColor
- Normal
- Specular IOR
- Roughness
- Displace (Optional)
Your texture slot setup should look like this (note that it matters at which slot the textures are):
You can use the "Fill default PBS textures" option to automatically fill in dummy textures (like in the image above, where empty_roughness was inserted to complete the material). Notice that the blender modifiers are irrelevant for the pipeline, e.g. setting the influence to the normal, or alpha, will have absolutely no effect. Instead the order of the texture slot contains its functionality.
All textures sizes should be a power-of two. It is recommended to choose 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 texture for the basecolor, but a 2048x2048 texture for the normals to increase detail.
Your basecolor texture should be 8bit sRGBA (notice the sRGB color space! otherwise it will look greyish), storing the alpha mask in the alpha channel. If your texture is RGB only, no alpha mask will be used. A sample basecolor texture could look like this:
If your material is nonmetallic, the basecolor texture will be used as the diffuse texture. Otherwise it will be used as the specular texture. See the Materials page for information. The materials base color is computed as material_basecolor * sampled_basecolor
.
Your normal texture should be 8bit RGB. It is important that you don't use the normal texture to modify the intensity of the bump mapping, but instead the normalmap-strength parameter, and store the full intensity in the normal map. The values in the normal map should be range from 0 .. 1 in Tangent Space (most exporters like crazyBump, shaderMap, bitmap2material already do that). Again, a sample normal texture:
The specular texture should be 8bit RGB, although only the R channel is used (You can use a single channel texture, too, but it might be necessary to set the correct format then). Sample specular ior texture:
NOTICE: Remember, the specular ior, and thus the specular ior texture has no effect on metallics.
The final index of refraction is determined by 1 + max(0, material_specular - 1) * sampled_specular_ior * 2
.
Example: If you have an index of refraction of 1.5 set as your material IOR, and your specular ior texture contains a value of 0.5, you end up getting an ior of 1 + 0.5 * 0.5 * 2 = 1.5
. In general, a value of 0.5 in your specular gets the IOR specified in your material, and a higher/lower value gets a higher/lower IOR.
The roughness texture will be plain white the most time, but you can use it to add scratches or rust to the surface.
The final roughness is determined by material.roughness * roughness_texture
.
Rendering Pipeline by tobspr (c) 2014 - 2016
For developers: