Kohi Game Engine
material_system.h File Reference

The material system is responsible for managing materials in the engine, including reference counting and auto-unloading. More...

Go to the source code of this file.

Data Structures

struct  material_system_config
 The configuration for the material system. More...
 
struct  material_frame_data
 
struct  material_instance_draw_data
 

Macros

#define MATERIAL_DEFAULT_NAME_STANDARD   "Material.DefaultStandard"
 
#define MATERIAL_DEFAULT_NAME_WATER   "Material.DefaultWater"
 
#define MATERIAL_DEFAULT_NAME_BLENDED   "Material.DefaultBlended"
 
#define MATERIAL_MAX_IRRADIANCE_CUBEMAP_COUNT   4
 
#define MATERIAL_MAX_SHADOW_CASCADES   4
 
#define MATERIAL_MAX_POINT_LIGHTS   10
 
#define MATERIAL_MAX_VIEWS   4
 
#define MATERIAL_DEFAULT_BASE_COLOUR_VALUE   (vec4){1.0f, 1.0f, 1.0f, 1.0f}
 
#define MATERIAL_DEFAULT_NORMAL_VALUE   (vec3){0.0f, 0.0f, 1.0f}
 
#define MATERIAL_DEFAULT_NORMAL_ENABLED   true
 
#define MATERIAL_DEFAULT_METALLIC_VALUE   0.0f
 
#define MATERIAL_DEFAULT_ROUGHNESS_VALUE   0.5f
 
#define MATERIAL_DEFAULT_AO_VALUE   1.0f
 
#define MATERIAL_DEFAULT_AO_ENABLED   true
 
#define MATERIAL_DEFAULT_MRA_VALUE   (vec3){0.0f, 0.5f, 1.0f}
 
#define MATERIAL_DEFAULT_MRA_ENABLED   true
 
#define MATERIAL_DEFAULT_HAS_TRANSPARENCY   false
 
#define MATERIAL_DEFAULT_DOUBLE_SIDED   false
 
#define MATERIAL_DEFAULT_RECIEVES_SHADOW   true
 
#define MATERIAL_DEFAULT_CASTS_SHADOW   true
 
#define MATERIAL_DEFAULT_USE_VERTEX_COLOUR_AS_BASE_COLOUR   false
 

Typedefs

typedef struct material_system_config material_system_config
 The configuration for the material system. More...
 
typedef enum material_texture_input material_texture_input
 
typedef struct material_frame_data material_frame_data
 
typedef struct material_instance_draw_data material_instance_draw_data
 

Enumerations

enum  material_texture_input {
  MATERIAL_TEXTURE_INPUT_BASE_COLOUR , MATERIAL_TEXTURE_INPUT_NORMAL , MATERIAL_TEXTURE_INPUT_METALLIC , MATERIAL_TEXTURE_INPUT_ROUGHNESS ,
  MATERIAL_TEXTURE_INPUT_AMBIENT_OCCLUSION , MATERIAL_TEXTURE_INPUT_EMISSIVE , MATERIAL_TEXTURE_INPUT_REFLECTION , MATERIAL_TEXTURE_INPUT_REFRACTION ,
  MATERIAL_TEXTURE_INPUT_REFLECTION_DEPTH , MATERIAL_TEXTURE_INPUT_REFRACTION_DEPTH , MATERIAL_TEXTURE_INPUT_DUDV , MATERIAL_TEXTURE_INPUT_MRA ,
  MATERIAL_TEXTURE_INPUT_COUNT
}
 

Functions

b8 material_system_initialize (u64 *memory_requirement, struct material_system_state *state, const material_system_config *config)
 Initializes the material system. Should be called twice; once to get the memory requirement (passing state=0), and a second time passing an allocated block of memory to actually initialize the system. More...
 
void material_system_shutdown (struct material_system_state *state)
 Shuts down the material system. More...
 
KAPI b8 material_system_get_handle (struct material_system_state *state, kname name, khandle *out_material_handle)
 Attempts to get the identifier of a material with the given name. If it has not yet been loaded, this triggers it to load. If the material is not found, a handle of the default material is returned. More...
 
KAPI b8 material_is_loaded_get (struct material_system_state *state, khandle material)
 
KAPI ktexture material_texture_get (struct material_system_state *state, khandle material, material_texture_input tex_input)
 
KAPI void material_texture_set (struct material_system_state *state, khandle material, material_texture_input tex_input, ktexture texture)
 
KAPI texture_channel material_metallic_texture_channel_get (struct material_system_state *state, khandle material)
 
KAPI void material_metallic_texture_channel_set (struct material_system_state *state, khandle material, texture_channel value)
 
KAPI texture_channel material_roughness_texture_channel_get (struct material_system_state *state, khandle material)
 
KAPI void material_roughness_texture_channel_set (struct material_system_state *state, khandle material, texture_channel value)
 
KAPI texture_channel material_ao_texture_channel_get (struct material_system_state *state, khandle material)
 
KAPI void material_ao_texture_channel_set (struct material_system_state *state, khandle material, texture_channel value)
 
KAPI texture_filter material_texture_filter_get (struct material_system_state *state, khandle material)
 
KAPI void material_texture_filter_set (struct material_system_state *state, khandle material, texture_filter value)
 
KAPI texture_repeat material_texture_mode_get (struct material_system_state *state, khandle material)
 
KAPI void material_texture_mode_set (struct material_system_state *state, khandle material, texture_repeat value)
 
KAPI b8 material_has_transparency_get (struct material_system_state *state, khandle material)
 
KAPI void material_has_transparency_set (struct material_system_state *state, khandle material, b8 value)
 
KAPI b8 material_double_sided_get (struct material_system_state *state, khandle material)
 
KAPI void material_double_sided_set (struct material_system_state *state, khandle material, b8 value)
 
KAPI b8 material_recieves_shadow_get (struct material_system_state *state, khandle material)
 
KAPI void material_recieves_shadow_set (struct material_system_state *state, khandle material, b8 value)
 
KAPI b8 material_casts_shadow_get (struct material_system_state *state, khandle material)
 
KAPI void material_casts_shadow_set (struct material_system_state *state, khandle material, b8 value)
 
KAPI b8 material_normal_enabled_get (struct material_system_state *state, khandle material)
 
KAPI void material_normal_enabled_set (struct material_system_state *state, khandle material, b8 value)
 
KAPI b8 material_ao_enabled_get (struct material_system_state *state, khandle material)
 
KAPI void material_ao_enabled_set (struct material_system_state *state, khandle material, b8 value)
 
KAPI b8 material_emissive_enabled_get (struct material_system_state *state, khandle material)
 
KAPI void material_emissive_enabled_set (struct material_system_state *state, khandle material, b8 value)
 
KAPI b8 material_refraction_enabled_get (struct material_system_state *state, khandle material)
 
KAPI void material_refraction_enabled_set (struct material_system_state *state, khandle material, b8 value)
 
KAPI f32 material_refraction_scale_get (struct material_system_state *state, khandle material)
 
KAPI void material_refraction_scale_set (struct material_system_state *state, khandle material, f32 value)
 
KAPI b8 material_use_vertex_colour_as_base_colour_get (struct material_system_state *state, khandle material)
 
KAPI void material_use_vertex_colour_as_base_colour_set (struct material_system_state *state, khandle material, b8 value)
 
KAPI b8 material_flag_set (struct material_system_state *state, khandle material, kmaterial_flag_bits flag, b8 value)
 Sets the given material flag's state. More...
 
KAPI b8 material_flag_get (struct material_system_state *state, khandle material, kmaterial_flag_bits flag)
 Gets value of the given material flag's state. More...
 
KAPI b8 material_system_acquire (struct material_system_state *state, kname name, material_instance *out_instance)
 Attempts to acquire an instance of the material with the given handle. Increases internal reference count. More...
 
KAPI void material_system_release (struct material_system_state *state, material_instance *instance)
 Releases the given material instance. More...
 
b8 material_system_prepare_frame (struct material_system_state *state, material_frame_data mat_frame_data, struct frame_data *p_frame_data)
 
b8 material_system_apply (struct material_system_state *state, khandle material, struct frame_data *p_frame_data)
 
b8 material_system_apply_instance (struct material_system_state *state, const material_instance *instance, struct material_instance_draw_data draw_data, struct frame_data *p_frame_data)
 
KAPI b8 material_instance_flag_set (struct material_system_state *state, material_instance instance, kmaterial_flag_bits flag, b8 value)
 Sets the given material instance flag's state. More...
 
KAPI b8 material_instance_flag_get (struct material_system_state *state, material_instance instance, kmaterial_flag_bits flag)
 Gets value of the given material instance flag's state. More...
 
KAPI b8 material_instance_base_colour_get (struct material_system_state *state, material_instance instance, vec4 *out_value)
 Gets the value of the material instance-specific base colour. More...
 
KAPI b8 material_instance_base_colour_set (struct material_system_state *state, material_instance instance, vec4 value)
 Sets the value of the material instance-specific base colour. More...
 
KAPI b8 material_instance_uv_offset_get (struct material_system_state *state, material_instance instance, vec3 *out_value)
 Gets the value of the material instance-specific UV offset. Can be used for animating the position of materials. More...
 
KAPI b8 material_instance_uv_offset_set (struct material_system_state *state, material_instance instance, vec3 value)
 Sets the value of the material instance-specific UV offset. Can be used for animating the position of materials. More...
 
KAPI b8 material_instance_uv_scale_get (struct material_system_state *state, material_instance instance, vec3 *out_value)
 Gets the value of the material instance-specific UV scale. Can be used for animating the position of materials. More...
 
KAPI b8 material_instance_uv_scale_set (struct material_system_state *state, material_instance instance, vec3 value)
 Sets the value of the material instance-specific UV scale. Can be used for animating the position of materials. More...
 
KAPI material_instance material_system_get_default_standard (struct material_system_state *state)
 Gets an instance of the default standard material. More...
 
KAPI material_instance material_system_get_default_water (struct material_system_state *state)
 Gets an instance of the default water material. More...
 
KAPI material_instance material_system_get_default_blended (struct material_system_state *state)
 Gets an instance of the default blended material. More...
 
KAPI void material_system_dump (struct material_system_state *state)
 Dumps all of the registered materials and their reference counts/handles. More...
 

Detailed Description

The material system is responsible for managing materials in the engine, including reference counting and auto-unloading.

Author
Travis Vroman (travi.nosp@m.s@ko.nosp@m.hieng.nosp@m.ine..nosp@m.com)
Version
1.0
Date
2022-01-11

Macro Definition Documentation

◆ MATERIAL_DEFAULT_AO_ENABLED

#define MATERIAL_DEFAULT_AO_ENABLED   true

◆ MATERIAL_DEFAULT_AO_VALUE

#define MATERIAL_DEFAULT_AO_VALUE   1.0f

◆ MATERIAL_DEFAULT_BASE_COLOUR_VALUE

#define MATERIAL_DEFAULT_BASE_COLOUR_VALUE   (vec4){1.0f, 1.0f, 1.0f, 1.0f}

◆ MATERIAL_DEFAULT_CASTS_SHADOW

#define MATERIAL_DEFAULT_CASTS_SHADOW   true

◆ MATERIAL_DEFAULT_DOUBLE_SIDED

#define MATERIAL_DEFAULT_DOUBLE_SIDED   false

◆ MATERIAL_DEFAULT_HAS_TRANSPARENCY

#define MATERIAL_DEFAULT_HAS_TRANSPARENCY   false

◆ MATERIAL_DEFAULT_METALLIC_VALUE

#define MATERIAL_DEFAULT_METALLIC_VALUE   0.0f

◆ MATERIAL_DEFAULT_MRA_ENABLED

#define MATERIAL_DEFAULT_MRA_ENABLED   true

◆ MATERIAL_DEFAULT_MRA_VALUE

#define MATERIAL_DEFAULT_MRA_VALUE   (vec3){0.0f, 0.5f, 1.0f}

◆ MATERIAL_DEFAULT_NAME_BLENDED

#define MATERIAL_DEFAULT_NAME_BLENDED   "Material.DefaultBlended"

◆ MATERIAL_DEFAULT_NAME_STANDARD

#define MATERIAL_DEFAULT_NAME_STANDARD   "Material.DefaultStandard"

◆ MATERIAL_DEFAULT_NAME_WATER

#define MATERIAL_DEFAULT_NAME_WATER   "Material.DefaultWater"

◆ MATERIAL_DEFAULT_NORMAL_ENABLED

#define MATERIAL_DEFAULT_NORMAL_ENABLED   true

◆ MATERIAL_DEFAULT_NORMAL_VALUE

#define MATERIAL_DEFAULT_NORMAL_VALUE   (vec3){0.0f, 0.0f, 1.0f}

◆ MATERIAL_DEFAULT_RECIEVES_SHADOW

#define MATERIAL_DEFAULT_RECIEVES_SHADOW   true

◆ MATERIAL_DEFAULT_ROUGHNESS_VALUE

#define MATERIAL_DEFAULT_ROUGHNESS_VALUE   0.5f

◆ MATERIAL_DEFAULT_USE_VERTEX_COLOUR_AS_BASE_COLOUR

#define MATERIAL_DEFAULT_USE_VERTEX_COLOUR_AS_BASE_COLOUR   false

◆ MATERIAL_MAX_IRRADIANCE_CUBEMAP_COUNT

#define MATERIAL_MAX_IRRADIANCE_CUBEMAP_COUNT   4

◆ MATERIAL_MAX_POINT_LIGHTS

#define MATERIAL_MAX_POINT_LIGHTS   10

◆ MATERIAL_MAX_SHADOW_CASCADES

#define MATERIAL_MAX_SHADOW_CASCADES   4

◆ MATERIAL_MAX_VIEWS

#define MATERIAL_MAX_VIEWS   4

Typedef Documentation

◆ material_frame_data

Holds internal state for per-frame data (i.e across all standard materials);

◆ material_instance_draw_data

◆ material_system_config

The configuration for the material system.

◆ material_texture_input

Enumeration Type Documentation

◆ material_texture_input

Enumerator
MATERIAL_TEXTURE_INPUT_BASE_COLOUR 
MATERIAL_TEXTURE_INPUT_NORMAL 
MATERIAL_TEXTURE_INPUT_METALLIC 
MATERIAL_TEXTURE_INPUT_ROUGHNESS 
MATERIAL_TEXTURE_INPUT_AMBIENT_OCCLUSION 
MATERIAL_TEXTURE_INPUT_EMISSIVE 
MATERIAL_TEXTURE_INPUT_REFLECTION 
MATERIAL_TEXTURE_INPUT_REFRACTION 
MATERIAL_TEXTURE_INPUT_REFLECTION_DEPTH 
MATERIAL_TEXTURE_INPUT_REFRACTION_DEPTH 
MATERIAL_TEXTURE_INPUT_DUDV 
MATERIAL_TEXTURE_INPUT_MRA 
MATERIAL_TEXTURE_INPUT_COUNT 

Function Documentation

◆ material_ao_enabled_get()

KAPI b8 material_ao_enabled_get ( struct material_system_state *  state,
khandle  material 
)

◆ material_ao_enabled_set()

KAPI void material_ao_enabled_set ( struct material_system_state *  state,
khandle  material,
b8  value 
)

◆ material_ao_texture_channel_get()

KAPI texture_channel material_ao_texture_channel_get ( struct material_system_state *  state,
khandle  material 
)

◆ material_ao_texture_channel_set()

KAPI void material_ao_texture_channel_set ( struct material_system_state *  state,
khandle  material,
texture_channel  value 
)

◆ material_casts_shadow_get()

KAPI b8 material_casts_shadow_get ( struct material_system_state *  state,
khandle  material 
)

◆ material_casts_shadow_set()

KAPI void material_casts_shadow_set ( struct material_system_state *  state,
khandle  material,
b8  value 
)

◆ material_double_sided_get()

KAPI b8 material_double_sided_get ( struct material_system_state *  state,
khandle  material 
)

◆ material_double_sided_set()

KAPI void material_double_sided_set ( struct material_system_state *  state,
khandle  material,
b8  value 
)

◆ material_emissive_enabled_get()

KAPI b8 material_emissive_enabled_get ( struct material_system_state *  state,
khandle  material 
)

◆ material_emissive_enabled_set()

KAPI void material_emissive_enabled_set ( struct material_system_state *  state,
khandle  material,
b8  value 
)

◆ material_flag_get()

KAPI b8 material_flag_get ( struct material_system_state *  state,
khandle  material,
kmaterial_flag_bits  flag 
)

Gets value of the given material flag's state.

Parameters
stateA pointer to the material system state.
materialThe identifier of the material.
material_flag_bitsThe flag whose value to get.
Returns
True if the flag is set; otherwise false.

◆ material_flag_set()

KAPI b8 material_flag_set ( struct material_system_state *  state,
khandle  material,
kmaterial_flag_bits  flag,
b8  value 
)

Sets the given material flag's state.

Parameters
stateA pointer to the material system state.
materialThe identifier of the material.
material_flag_bitsThe flag to set.
valueThe value of the flag.
Returns
True if successfully set; otherwise false.

◆ material_has_transparency_get()

KAPI b8 material_has_transparency_get ( struct material_system_state *  state,
khandle  material 
)

◆ material_has_transparency_set()

KAPI void material_has_transparency_set ( struct material_system_state *  state,
khandle  material,
b8  value 
)

◆ material_instance_base_colour_get()

KAPI b8 material_instance_base_colour_get ( struct material_system_state *  state,
material_instance  instance,
vec4 out_value 
)

Gets the value of the material instance-specific base colour.

Parameters
stateA pointer to the material system state.
instanceThe material instance.
out_valueA pointer to hold the value. Required.
Returns
True if value was gotten successfully; otherwise false.

◆ material_instance_base_colour_set()

KAPI b8 material_instance_base_colour_set ( struct material_system_state *  state,
material_instance  instance,
vec4  value 
)

Sets the value of the material instance-specific base colour.

Parameters
stateA pointer to the material system state.
instanceThe material instance.
valueThe value to be set.
Returns
True if value was set successfully; otherwise false.

◆ material_instance_flag_get()

KAPI b8 material_instance_flag_get ( struct material_system_state *  state,
material_instance  instance,
kmaterial_flag_bits  flag 
)

Gets value of the given material instance flag's state.

Parameters
stateA pointer to the material system state.
instanceThe material instance.
material_flag_bitsThe flag whose value to get.
Returns
True if the flag is set; otherwise false.

◆ material_instance_flag_set()

KAPI b8 material_instance_flag_set ( struct material_system_state *  state,
material_instance  instance,
kmaterial_flag_bits  flag,
b8  value 
)

Sets the given material instance flag's state.

Parameters
stateA pointer to the material system state.
instanceThe the material instance.
material_flag_bitsThe flag to set.
valueThe value of the flag.
Returns
True if successfully set; otherwise false.

◆ material_instance_uv_offset_get()

KAPI b8 material_instance_uv_offset_get ( struct material_system_state *  state,
material_instance  instance,
vec3 out_value 
)

Gets the value of the material instance-specific UV offset. Can be used for animating the position of materials.

Parameters
stateA pointer to the material system state.
instanceThe material instance.
out_valueA pointer to hold the value. Required.
Returns
True if value was set successfully; otherwise false.

◆ material_instance_uv_offset_set()

KAPI b8 material_instance_uv_offset_set ( struct material_system_state *  state,
material_instance  instance,
vec3  value 
)

Sets the value of the material instance-specific UV offset. Can be used for animating the position of materials.

Parameters
stateA pointer to the material system state.
instanceThe material instance.
valueThe value to be set.
Returns
True if value was gotten successfully; otherwise false.

◆ material_instance_uv_scale_get()

KAPI b8 material_instance_uv_scale_get ( struct material_system_state *  state,
material_instance  instance,
vec3 out_value 
)

Gets the value of the material instance-specific UV scale. Can be used for animating the position of materials.

Parameters
stateA pointer to the material system state.
instanceThe material instance.
out_valueA pointer to hold the value. Required.
Returns
True if value was gotten successfully; otherwise false.

◆ material_instance_uv_scale_set()

KAPI b8 material_instance_uv_scale_set ( struct material_system_state *  state,
material_instance  instance,
vec3  value 
)

Sets the value of the material instance-specific UV scale. Can be used for animating the position of materials.

Parameters
stateA pointer to the material system state.
instanceThe material instance.
valueThe value to be set.
Returns
True if value was set successfully; otherwise false.

◆ material_is_loaded_get()

KAPI b8 material_is_loaded_get ( struct material_system_state *  state,
khandle  material 
)

◆ material_metallic_texture_channel_get()

KAPI texture_channel material_metallic_texture_channel_get ( struct material_system_state *  state,
khandle  material 
)

◆ material_metallic_texture_channel_set()

KAPI void material_metallic_texture_channel_set ( struct material_system_state *  state,
khandle  material,
texture_channel  value 
)

◆ material_normal_enabled_get()

KAPI b8 material_normal_enabled_get ( struct material_system_state *  state,
khandle  material 
)

◆ material_normal_enabled_set()

KAPI void material_normal_enabled_set ( struct material_system_state *  state,
khandle  material,
b8  value 
)

◆ material_recieves_shadow_get()

KAPI b8 material_recieves_shadow_get ( struct material_system_state *  state,
khandle  material 
)

◆ material_recieves_shadow_set()

KAPI void material_recieves_shadow_set ( struct material_system_state *  state,
khandle  material,
b8  value 
)

◆ material_refraction_enabled_get()

KAPI b8 material_refraction_enabled_get ( struct material_system_state *  state,
khandle  material 
)

◆ material_refraction_enabled_set()

KAPI void material_refraction_enabled_set ( struct material_system_state *  state,
khandle  material,
b8  value 
)

◆ material_refraction_scale_get()

KAPI f32 material_refraction_scale_get ( struct material_system_state *  state,
khandle  material 
)

◆ material_refraction_scale_set()

KAPI void material_refraction_scale_set ( struct material_system_state *  state,
khandle  material,
f32  value 
)

◆ material_roughness_texture_channel_get()

KAPI texture_channel material_roughness_texture_channel_get ( struct material_system_state *  state,
khandle  material 
)

◆ material_roughness_texture_channel_set()

KAPI void material_roughness_texture_channel_set ( struct material_system_state *  state,
khandle  material,
texture_channel  value 
)

◆ material_system_acquire()

KAPI b8 material_system_acquire ( struct material_system_state *  state,
kname  name,
material_instance out_instance 
)

Attempts to acquire an instance of the material with the given handle. Increases internal reference count.

Parameters
stateA pointer to the material system state.
nameThe name of the material to acquire an instance for.
out_instanceA pointer to hold the acquired material instance. Required.
Returns
True on success; otherwise false.

◆ material_system_apply()

b8 material_system_apply ( struct material_system_state *  state,
khandle  material,
struct frame_data p_frame_data 
)

◆ material_system_apply_instance()

b8 material_system_apply_instance ( struct material_system_state *  state,
const material_instance instance,
struct material_instance_draw_data  draw_data,
struct frame_data p_frame_data 
)

◆ material_system_dump()

KAPI void material_system_dump ( struct material_system_state *  state)

Dumps all of the registered materials and their reference counts/handles.

Parameters
stateA pointer to the material system state.

◆ material_system_get_default_blended()

KAPI material_instance material_system_get_default_blended ( struct material_system_state *  state)

Gets an instance of the default blended material.

Parameters
stateA pointer to the material system state.
Returns
A material instance with handles to the material and instance of it.

◆ material_system_get_default_standard()

KAPI material_instance material_system_get_default_standard ( struct material_system_state *  state)

Gets an instance of the default standard material.

Parameters
stateA pointer to the material system state.
Returns
A material instance with handles to the material and instance of it.

◆ material_system_get_default_water()

KAPI material_instance material_system_get_default_water ( struct material_system_state *  state)

Gets an instance of the default water material.

Parameters
stateA pointer to the material system state.
Returns
A material instance with handles to the material and instance of it.

◆ material_system_get_handle()

KAPI b8 material_system_get_handle ( struct material_system_state *  state,
kname  name,
khandle out_material_handle 
)

Attempts to get the identifier of a material with the given name. If it has not yet been loaded, this triggers it to load. If the material is not found, a handle of the default material is returned.

Parameters
stateA pointer to the material system state.
nameThe name of the material to get the identifier of.
out_material_handleA pointer to hold the material handle.
Returns
True if the material was found; otherwise false if the default material was returned.

◆ material_system_initialize()

b8 material_system_initialize ( u64 memory_requirement,
struct material_system_state *  state,
const material_system_config config 
)

Initializes the material system. Should be called twice; once to get the memory requirement (passing state=0), and a second time passing an allocated block of memory to actually initialize the system.

Parameters
memory_requirementA pointer to hold the memory requirement as it is calculated.
stateA block of memory to hold the state or, if gathering the memory requirement, 0.
configThe configuration (material_system_config) for this system.
Returns
True on success; otherwise false.

◆ material_system_prepare_frame()

b8 material_system_prepare_frame ( struct material_system_state *  state,
material_frame_data  mat_frame_data,
struct frame_data p_frame_data 
)

◆ material_system_release()

KAPI void material_system_release ( struct material_system_state *  state,
material_instance instance 
)

Releases the given material instance.

Parameters
stateA pointer to the material system state.
instanceA pointer to the material instance to unload. Handles are invalidated. Required.

◆ material_system_shutdown()

void material_system_shutdown ( struct material_system_state *  state)

Shuts down the material system.

Parameters
stateThe state block of memory.

◆ material_texture_filter_get()

KAPI texture_filter material_texture_filter_get ( struct material_system_state *  state,
khandle  material 
)

◆ material_texture_filter_set()

KAPI void material_texture_filter_set ( struct material_system_state *  state,
khandle  material,
texture_filter  value 
)

◆ material_texture_get()

KAPI ktexture material_texture_get ( struct material_system_state *  state,
khandle  material,
material_texture_input  tex_input 
)

◆ material_texture_mode_get()

KAPI texture_repeat material_texture_mode_get ( struct material_system_state *  state,
khandle  material 
)

◆ material_texture_mode_set()

KAPI void material_texture_mode_set ( struct material_system_state *  state,
khandle  material,
texture_repeat  value 
)

◆ material_texture_set()

KAPI void material_texture_set ( struct material_system_state *  state,
khandle  material,
material_texture_input  tex_input,
ktexture  texture 
)

◆ material_use_vertex_colour_as_base_colour_get()

KAPI b8 material_use_vertex_colour_as_base_colour_get ( struct material_system_state *  state,
khandle  material 
)

◆ material_use_vertex_colour_as_base_colour_set()

KAPI void material_use_vertex_colour_as_base_colour_set ( struct material_system_state *  state,
khandle  material,
b8  value 
)