From 59ea29d8ff9dad751659a0a42d76a5534f7b4b97 Mon Sep 17 00:00:00 2001 From: jussi Date: Mon, 16 May 2022 13:44:10 +0300 Subject: New GenMeshCustom, UpdateMesh and lightmap example. --- API.md | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) (limited to 'API.md') diff --git a/API.md b/API.md index b4e23f4..486e1cf 100644 --- a/API.md +++ b/API.md @@ -635,6 +635,18 @@ int id. Defines 3d camera position/orientation int id. Vertex data defining a mesh +``` +mesh{} = { + vertices = { Vector3, ... }, + texcoords = { Vector2, ... }, + texcoords2 = { Vector2, ... }, + normals = { Vector3, ... }, + tangents = { Vector4, ... }, + colors = { Color, ... }, + indices = { int, ... }, +} +``` + --- > Material = MaterialId @@ -642,7 +654,7 @@ int id. Vertex data defining a mesh int id. Material type ``` -table = { +material{} = { shader = Shader, maps = { { @@ -3200,15 +3212,24 @@ Generate heightmap mesh from image data --- -> mesh = RL_GenMeshCustom( Vector3{} vertices, Vector2{} texCoords, Vector3{} normals ) +> mesh = RL_GenMeshCustom( Mesh{}, bool dynamic ) -Generate custom mesh +Generate custom mesh from vertex attribute data and uploads it into a VAO ( if supported ) and VBO - Failure return -1 - Success return int --- +> success = RL_UpdateMesh( Mesh{} ) + +Update mesh vertex data in GPU. ( Mainly intented to be used with custom meshes ) + +- Failure return false +- Success return true + +--- + > success = RL_UnloadMesh( Mesh mesh ) Unload mesh data from CPU and GPU -- cgit v1.2.3