Mesh Renderer
Draws an unlit mesh at the node transform.
component engine.MeshRenderer
On this page
Try it
Double-sided mesh
The camera faces the back of an orange plane. Its back face is culled while Double Sided is off.
Enable Double Sided to show the back face. Reset restores one-sided rendering.
Starts the scene; open the example parameters to experiment.
Scene2 nodes
Fields
| Name | Type | Default | Description |
|---|---|---|---|
| Mesh | Mesh | none | Mesh to draw: an imported .obj or a builtin Cube, Plane, Sphere or Cylinder. |
| Texture | Texture | none | Texture mapped onto the mesh. Empty uses white. |
| Color | Color | rgba(1, 1, 1, 1) | Color multiplied with the texture. |
| Blend | enum | opaque | Opaque writes depth. Premultiplied and additive are drawn after opaque meshes. one of: premultiplied, opaque, additive |
| Double Sided | bool | false | Draws the back faces too. |
| Layer | int | 0 | Sorting layer for transparent meshes. |
| Filter | enum | linear | Texture sampling: nearest or linear. one of: nearest, linear |
From a script
Pulse the mesh colour, for example on a pickup.
package game
import (
"aego/math"
"aego/time"
)
script Pulse {
var Speed float = 3
func Update(dt float) {
mr := node.Get<MeshRenderer>()
k := 0.75 + 0.25*math.Sin(time.Elapsed()*Speed)
mr.Color = Color{k, k, 1, 1}
}
}