Mesh:setInstanceCount

From GiderosMobile
Revision as of 14:28, 13 July 2023 by Hgy29 (talk | contribs) (Text replacement - "<source" to "<syntaxhighlight")

Available since: Gideros 2019.12
Class: Mesh

Description

Enables instanced rendering and sets the number of instances to draw. <syntaxhighlight lang="lua"> Mesh:setInstanceCount(count) </source>

The GPU will draw your mesh a number of times instead of just once. This isn’t very useful unless you make a shader that is aware of it and can change vertices positions for each instance (please see Gideros Studio sample code).

Parameters

count: (number) number of instance to draw