Mesh:setInstanceCount: Difference between revisions

From GiderosMobile
Created page with "__NOTOC__ '''Available since:''' Gideros 2019.12<br/> '''Class:''' Mesh<br/> === Description === Enables instanced rendering and sets the number of instances to draw. <so..."
 
m Text replacement - "<source" to "<syntaxhighlight"
Line 5: Line 5:
=== Description ===
=== Description ===
Enables instanced rendering and sets the number of instances to draw.
Enables instanced rendering and sets the number of instances to draw.
<source lang="lua">
<syntaxhighlight lang="lua">
Mesh:setInstanceCount(count)
Mesh:setInstanceCount(count)
</source>
</source>

Revision as of 13:28, 13 July 2023

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