Aego Русский

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.
Open in AegoDownload example project
Scene2 nodes
Camera
position[0, 0, 5]rotation[0, 0, 0, 1]scale[1, 1, 1]
Camera 3D
fovfloat55clearColorColor#111827ffactivebooltrue
Back-facing plane
position[0, 0, 0]rotation[-0.7071068, 0, 0, 0.7071068]scale[3, 1, 3]
Mesh Renderer
meshMeshasset("ae900000000000000000000000000002")colorColor#e07b39ffdoubleSidedboolfalse

Fields

NameTypeDefaultDescription
MeshMeshnone

Mesh to draw: an imported .obj or a builtin Cube, Plane, Sphere or Cylinder.

TextureTexturenone

Texture mapped onto the mesh. Empty uses white.

ColorColorrgba(1, 1, 1, 1)

Color multiplied with the texture.

Blendenumopaque

Opaque writes depth. Premultiplied and additive are drawn after opaque meshes.

one of: premultiplied, opaque, additive
Double Sidedboolfalse

Draws the back faces too.

Layerint0

Sorting layer for transparent meshes.

Filterenumlinear

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}
    }
}