Difference between revisions of "Mesh:setInstanceCount"
From GiderosMobile
m (Text replacement - "<source" to "<syntaxhighlight") |
m (Text replacement - "</source>" to "</syntaxhighlight>") |
||
Line 7: | Line 7: | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
Mesh:setInstanceCount(count) | Mesh:setInstanceCount(count) | ||
− | </ | + | </syntaxhighlight> |
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''). | 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''). |
Latest revision as of 14:30, 13 July 2023
Available since: Gideros 2019.12
Class: Mesh
Description
Enables instanced rendering and sets the number of instances to draw.
Mesh:setInstanceCount(count)
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
- Mesh
- Mesh.new
- Mesh:clearColorArray
- Mesh:clearIndexArray
- Mesh:clearTexture
- Mesh:clearTextureCoordinateArray
- Mesh:clearVertexArray
- Mesh:getColor
- Mesh:getColorArraySize
- Mesh:getIndex
- Mesh:getIndexArraySize
- Mesh:getTextureCoordinate
- Mesh:getTextureCoordinateArraySize
- Mesh:getVertex
- Mesh:getVertexArraySize
- Mesh:resizeColorArray
- Mesh:resizeIndexArray
- Mesh:resizeTextureCoordinateArray
- Mesh:resizeVertexArray
- Mesh:setAutoSort
- Mesh:setColor
- Mesh:setColorArray
- Mesh:setColors
- Mesh:setCullMode
- Mesh:setGenericArray
- Mesh:setIndex
- Mesh:setIndexArray
- Mesh:setIndices
- Mesh:setInstanceCount
- Mesh:setPrimitiveType
- Mesh:setTexture
- Mesh:setTextureCoordinate
- Mesh:setTextureCoordinateArray
- Mesh:setTextureCoordinates
- Mesh:setVertex
- Mesh:setVertexArray
- Mesh:setVertices