Module material

Source
Expand description

Material specific structs, enums and functions.

§Examples

which are also unit tests:

Material Material Transparency Material Face Cull Material Parameter Info Material Parameter Info with id

Structs§

Material
A Material describes the surface of anything drawn on the graphics card! It is typically composed of a Shader, and shader properties like colors, textures, transparency info, etc.
MaterialBuffer
This is a chunk of memory that will get bound to all shaders at a particular register slot. StereoKit uses this to provide engine values to the shader, and you can also use this to drive graphical shader systems of your own!
ParamInfo
One Info of a Material. This is only useful for Material::get_all_param_info iterator. https://stereokit.net/Pages/StereoKit/Material/GetAllParamInfo.html
ParamInfos
Infos of a Material. This includes all global shader variables and textures. Warning, you have to be cautious when settings some infos https://stereokit.net/Pages/StereoKit/Material/GetAllParamInfo.html
_MaterialBufferT
StereoKit internal type.
_MaterialT
StereoKit internal type.

Enums§

Cull
Culling is discarding an object from the render pipeline! This enum describes how mesh faces get discarded on the graphics card. With culling set to none, you can double the number of pixels the GPU ends up drawing, which can have a big impact on performance. None can be appropriate in cases where the mesh is designed to be ‘double sided’. Front can also be helpful when you want to flip a mesh ‘inside-out’! https://stereokit.net/Pages/StereoKit/Cull.html
DepthTest
Depth test describes how this material looks at and responds to depth information in the zbuffer! The default is Less, which means if the material pixel’s depth is Less than the existing depth data, (basically, is this in front of some other object) it will draw that pixel. Similarly, Greater would only draw the material if it’s ‘behind’ the depth buffer. Always would just draw all the time, and not read from the depth buffer at all. https://stereokit.net/Pages/StereoKit/DepthTest.html
MaterialParam
TODO: v0.4 This may need significant revision? What type of data does this material parameter need? This is used to tell the shader how large the data is, and where to attach it to on the shader. https://stereokit.net/Pages/StereoKit/MaterialParam.html
Transparency
Also known as ‘alpha’ for those in the know. But there’s actually more than one type of transparency in rendering! The horrors. We’re keepin’ it fairly simple for now, so you get three options! https://stereokit.net/Pages/StereoKit/Transparency.html

Functions§

material_addref
material_buffer_create
material_buffer_release
material_buffer_set_data
material_copy
material_copy_id
material_create
material_find
material_get_bool
material_get_chain
material_get_color
material_get_cull
material_get_depth_test
material_get_depth_write
material_get_float
material_get_id
material_get_int
material_get_matrix
material_get_param
material_get_param_count
material_get_param_id
material_get_param_info
material_get_queue_offset
material_get_shader
material_get_texture
material_get_transparency
material_get_uint
material_get_vector2
material_get_vector3
material_get_vector4
material_get_wireframe
material_has_param
material_release
material_set_bool
material_set_chain
material_set_color
material_set_cull
material_set_depth_test
material_set_depth_write
material_set_float
material_set_id
material_set_int
material_set_int2
material_set_int3
material_set_int4
material_set_matrix
material_set_param
material_set_param_id
material_set_queue_offset
material_set_shader
material_set_texture
material_set_texture_id
material_set_transparency
material_set_uint
material_set_uint2
material_set_uint3
material_set_uint4
material_set_vector2
material_set_vector3
material_set_vector4
material_set_wireframe

Type Aliases§

MaterialBufferT
StereoKit ffi type.
MaterialT
StereoKit ffi type.