Work in progress

Godot documentation is being updated to reflect the latest changes in version 4.0. Some documentation pages may still state outdated information. This banner will tell you if you're reading one of such pages.

The contents of this page are up to date. If you can still find outdated information, please open an issue.

ImmediateMesh

Inherits: Mesh < Resource < RefCounted < Object

Mesh optimized for creating geometry manually.

Description

Mesh optimized for creating geometry manually, similar to OpenGL1.x immediate mode.

Methods

void

clear_surfaces ( )

void

surface_add_vertex ( Vector3 vertex )

void

surface_add_vertex_2d ( Vector2 vertex )

void

surface_begin ( PrimitiveType primitive, Material material=null )

void

surface_end ( )

void

surface_set_color ( Color color )

void

surface_set_normal ( Vector3 normal )

void

surface_set_tangent ( Plane tangent )

void

surface_set_uv ( Vector2 uv )

void

surface_set_uv2 ( Vector2 uv2 )


Method Descriptions

void clear_surfaces ( )

Clear all surfaces.


void surface_add_vertex ( Vector3 vertex )

Add a 3D vertex using the current attributes previously set.


void surface_add_vertex_2d ( Vector2 vertex )

Add a 2D vertex using the current attributes previously set.


void surface_begin ( PrimitiveType primitive, Material material=null )

Begin a new surface.


void surface_end ( )

End and commit current surface. Note that surface being created will not be visible until this function is called.


void surface_set_color ( Color color )

Set the color attribute that will be pushed with the next vertex.


void surface_set_normal ( Vector3 normal )

Set the normal attribute that will be pushed with the next vertex.


void surface_set_tangent ( Plane tangent )

Set the tangent attribute that will be pushed with the next vertex.


void surface_set_uv ( Vector2 uv )

Set the UV attribute that will be pushed with the next vertex.


void surface_set_uv2 ( Vector2 uv2 )

Set the UV2 attribute that will be pushed with the next vertex.