natiny.material.create
Lua
natiny.material.create(shader [, tags]) -> material
Builds a material from a shader's reflected constants, textures and vertex
layout. Render pipelines are created lazily for the render states and target
layouts used when drawing.
Parameters
| Name |
Type |
Default |
Description |
shader |
number |
|
Shader handle from natiny.shader.load |
tags |
string or table |
nil |
Tag name or list of tag names |
Returns
| Type |
Description |
number |
Material handle; raises an error if creation fails |
Example
Lua
local material = natiny.material.create(shader, "world")