From c6f47f2920dc4a7301b195c28c03be6e0233cd4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jhonny=20Go=CC=88ransson?= Date: Thu, 29 Jan 2026 14:17:02 +0100 Subject: [PATCH 1/2] Small note about setting non-v4 and m4 attributes with less data --- docs/en/manuals/material.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/docs/en/manuals/material.md b/docs/en/manuals/material.md index df7c85b8..d4abd81b 100644 --- a/docs/en/manuals/material.md +++ b/docs/en/manuals/material.md @@ -140,6 +140,16 @@ There are some caveats to updating the vertex attributes however, whether or not Setting custom vertex data in runtime is currently only supported for sprite components. ::: +In the case that a vertex attribute is either a scalar or a vector type other than a `Vec4` you can still set the data using `go.set`: + +```lua +-- The last two components in the vec4 will not be used! +go.set("#sprite", "sprite_position_2d", vmath.vector4(my_x,my_y,0,0)) +go.animate("#sprite", "sprite_position_2d", go.PLAYBACK_LOOP_PINGPONG, vmath.vector4(1,2,0,0), go.EASING_LINEAR, 2) +``` + +The same is true for matrix attributes, if the attribute is a matrix type other than a `Mat4` you can still set the data using `go.set`. + ### Instancing Instancing is a technique used to efficiently draw multiple copies of the same object in a scene. Instead of creating a separate copy of the object each time it's used, instancing allows the graphics engine to create a single object and then reuse it multiple times. For example, in a game with a large forest, instead of creating a separate tree model for each tree, instancing allows you to create one tree model and then place it hundreds or thousands of times with different positions and scales. The forest can now be rendered with a single draw call instead of individual draw calls for each tree. From e6e200f4ce6cc0594e50471cb32d876efa9cd7a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jhonny=20G=C3=B6ransson?= Date: Tue, 3 Feb 2026 09:51:05 +0100 Subject: [PATCH 2/2] Update material.md --- docs/en/manuals/material.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/en/manuals/material.md b/docs/en/manuals/material.md index d4abd81b..deb9e9b9 100644 --- a/docs/en/manuals/material.md +++ b/docs/en/manuals/material.md @@ -140,7 +140,7 @@ There are some caveats to updating the vertex attributes however, whether or not Setting custom vertex data in runtime is currently only supported for sprite components. ::: -In the case that a vertex attribute is either a scalar or a vector type other than a `Vec4` you can still set the data using `go.set`: +In cases where that a vertex attribute is either a scalar or a vector type other than a `Vec4` you can still set the data using `go.set`: ```lua -- The last two components in the vec4 will not be used!