Version 1 vs 2
Version 1 vs 2
Edits
Edits
- Edit by 0xseantasker, Version 2
- Oct 21 2015 1:20 AM
- Edit by 0xseantasker, Version 1
- Jul 9 2015 2:02 PM
Original Change | Most Recent Change |
Edit Older Version 1... | Edit Current Version 2... |
Content Changes
Content Changes
Materials define how a mesh is going to be rendered. Materials are more than just a texture that is applied to the mesh. It also defines other things such as how the mesh will interact with the existing scene, whether it will be affected by lighting, and a variety of other settings.
==RenderPass==
Materials are actually a little more complicated than just defining properties that apply to the render system, in fact Materials are little more than a holder for `RenderPass` objects. For each `RenderPass` the `Mesh` is rendered. Why is this useful? By defining multiple render passes you can set up the second pass to interact with the first pass to create effects.
These two images show the output of the MultiPassRenderTest where the alpha of the second pass loops from full alpha to no alpha. The second pass is rendered with additive blending which gives a more intense glow effect.
{F1139}
{F1141}
You can accomplish the same thing by using two meshes and even multiple texture units. This is a trivial example though.
==TextureUnits==
`TextureUnits` are a component of RenderPass.
Materials define how a mesh is going to be rendered. Materials are more than just a texture that is applied to the mesh. It also defines other things such as how the mesh will interact with the existing scene, whether it will be affected by lighting, the objects base colour, and a variety of other settings.
==RenderPass==
Materials are actually a little more complicated than just defining properties that apply to the render system, in fact Material objects are just containers for `RenderPass` objects. For each `RenderPass` the `Mesh` is also rendered. Why is this useful? By defining multiple render passes you can set up the second pass to interact with the first pass to create effects.
These two images show the output of the MultiPassRenderTest where the alpha of the second pass loops from full alpha to no alpha. The second pass is rendered with additive blending which gives a more intense glow effect.
{F1139}
{F1141}
You can accomplish the same thing by using two meshes and even multiple texture units. This is just a trivial example though.
==TextureUnits==
A RenderPass may be made up of one or more `TextureUnit` objects. These define an image that will be rendered to the object. The image will be "wrapped" around the mesh based on the mesh's texture coordinates. A simple `Material` that has a single `RenderPass` which has a single `TextureUnit` would normally just define the image. For example:
```
pass
{
texture_unit
{
image: "resources/EchoLogo.png"
}
}
```
This is probably one of the simplest materials you can define. It defines a single `RenderPass` with a single `TextureUnit` and what image that texture unit should use.
Using multiple `TextureUnits` can be useful for performing effects such as static lighting, also known as "baked lighting". The following example is adapted from the "MultiStageTexturing" test. Here are the textures to give you a better idea of how the textures are combined.
LightMap.png
{F1598}
EchoLogo.png
{F1600}
```
pass
{
texture_unit
{
image: "data/LightMap.png"
}
texture_unit
{
image: "data/EchoLogo.png"
blend_mode: MODULATE
}
}
```
And here is the blended result:
{F1602}
Materials define how a mesh is going to be rendered. Materials are more than just a texture that is applied to the mesh. It also defines other things such as how the mesh will interact with the existing scene, whether it will be affected by lighting, the objects base colour, and a variety of other settings.
==RenderPass==
Materials are actually a little more complicated than just defining properties that apply to the render system, in fact Materials are little more than a holder objects are just containers for `RenderPass` objects. For each `RenderPass` the `Mesh` is also rendered. Why is this useful? By defining multiple render passes you can set up the second pass to interact with the first pass to create effects.
These two images show the output of the MultiPassRenderTest where the alpha of the second pass loops from full alpha to no alpha. The second pass is rendered with additive blending which gives a more intense glow effect.
{F1139}
{F1141}
You can accomplish the same thing by using two meshes and even multiple texture units. This is just a trivial example though.
==TextureUnits==
`TextureUnits` are a component of RenderPass.A RenderPass may be made up of one or more `TextureUnit` objects. These define an image that will be rendered to the object. The image will be "wrapped" around the mesh based on the mesh's texture coordinates. A simple `Material` that has a single `RenderPass` which has a single `TextureUnit` would normally just define the image. For example:
```
pass
{
texture_unit
{
image: "resources/EchoLogo.png"
}
}
```
This is probably one of the simplest materials you can define. It defines a single `RenderPass` with a single `TextureUnit` and what image that texture unit should use.
Using multiple `TextureUnits` can be useful for performing effects such as static lighting, also known as "baked lighting". The following example is adapted from the "MultiStageTexturing" test. Here are the textures to give you a better idea of how the textures are combined.
LightMap.png
{F1598}
EchoLogo.png
{F1600}
```
pass
{
texture_unit
{
image: "data/LightMap.png"
}
texture_unit
{
image: "data/EchoLogo.png"
blend_mode: MODULATE
}
}
```
And here is the blended result:
{F1602}