Kohi Game Engine
kmaterial_system.h
Go to the documentation of this file.
1 
13 #pragma once
14 
15 #include "core_render_types.h"
16 
17 #include <defines.h>
18 #include <strings/kname.h>
19 
20 #define KMATERIAL_STANDARD_NAME_DEFAULT "DefaultMaterial"
21 #define KMATERIAL_WATER_NAME_DEFAULT "MaterialStandardWater"
22 #define KMATERIAL_BLENDED_NAME_DEFAULT "MaterialStandardBlended"
23 
24 #define KMATERIAL_MAX_IRRADIANCE_CUBEMAP_COUNT 4
25 #define KMATERIAL_MAX_SHADOW_CASCADES 4
26 #define KMATERIAL_MAX_WATER_PLANES 4
27 // One view for regular camera, plus one reflection view per water plane.
28 #define KMATERIAL_MAX_POINT_LIGHTS 10
29 
30 #define KMATERIAL_DEFAULT_BASE_COLOUR_VALUE (vec4){1.0f, 1.0f, 1.0f, 1.0f}
31 #define KMATERIAL_DEFAULT_NORMAL_VALUE (vec3){0.0f, 0.0f, 1.0f}
32 #define KMATERIAL_DEFAULT_NORMAL_ENABLED true
33 #define KMATERIAL_DEFAULT_METALLIC_VALUE 0.0f
34 #define KMATERIAL_DEFAULT_ROUGHNESS_VALUE 0.5f
35 #define KMATERIAL_DEFAULT_AO_VALUE 1.0f
36 #define KMATERIAL_DEFAULT_AO_ENABLED true
37 #define KMATERIAL_DEFAULT_MRA_VALUE (vec3){0.0f, 0.5f, 1.0f}
38 #define KMATERIAL_DEFAULT_MRA_ENABLED true
39 #define KMATERIAL_DEFAULT_HAS_TRANSPARENCY false
40 #define KMATERIAL_DEFAULT_MASKED false
41 #define KMATERIAL_DEFAULT_DOUBLE_SIDED false
42 #define KMATERIAL_DEFAULT_RECIEVES_SHADOW true
43 #define KMATERIAL_DEFAULT_CASTS_SHADOW true
44 #define KMATERIAL_DEFAULT_USE_VERTEX_COLOUR_AS_BASE_COLOUR false
45 
46 struct kmaterial_system_state;
47 struct frame_data;
48 
50 typedef struct kmaterial_system_config {
53 
57 
59  // Forms the base colour of a material. Albedo for PBR, sometimes known as a "diffuse" colour. Specifies per-pixel colour.
61  // Texture specifying per-pixel normal vector.
63  // Texture specifying per-pixel metallic value.
65  // Texture specifying per-pixel roughness value.
67  // Texture specifying per-pixel ambient occlusion value.
69  // Texture specifying per-pixel emissive value.
71  // Texture specifying the reflection (only used for water materials)
73  // Texture specifying per-pixel refraction strength.
75  // Texture specifying the reflection depth (only used for water materials)
77  // Texture specifying the refraction depth.
80  // Texture holding per-pixel metallic (r), roughness (g) and ambient occlusion (b) value.
82  // The size of the material_texture_input enumeration.
85 
86 typedef enum kmaterial_state {
91 
93  // Instance is available
95  // Instance was issued while base material was loading, and needs initialization.
97  // Instance is ready to be used.
100 
101 // Represents the data for a single instance of a material.
102 // This can be thought of as "per-draw" data.
103 typedef struct kmaterial_instance_data {
105 
106  // A handle to the material to which this instance references.
108 
109  // Multiplied by albedo/diffuse texture. Overrides the value set in the base material.
111 
112  // Overrides the flags set in the base material.
114 
115  // Added to UV coords of vertex data.
117  // Multiplied against uv coords of vertex data.
119 
121 
122 // Represents a base material.
123 // This can be thought of as "per-group" data.
124 typedef struct kmaterial_data {
126 
128  // The state of the material (loaded vs not, etc.)
134 
137 
140 
144 
148 
152 
156 
159 
164 
173 
174  // Base set of flags for the material. Copied to the material instance when created.
176 
177  // Added to UV coords of vertex data. Overridden by instance data.
179  // Multiplied against uv coords of vertex data. Overridden by instance data.
181 
182  // Affects the strength of waves for a water type material.
184  // Affects wave movement speed for a water material.
187 
188  // Shader binding set id for base material data.
190 
192 
203 b8 kmaterial_system_initialize(u64* memory_requirement, struct kmaterial_system_state* state, const kmaterial_system_config* config);
204 
205 b8 kmaterial_system_setup_defaults(struct kmaterial_system_state* state);
206 
212 void kmaterial_system_shutdown(struct kmaterial_system_state* state);
213 
214 // -------------------------------------------------
215 // ---------------- MATERIAL -----------------------
216 // -------------------------------------------------
217 
227 KAPI b8 kmaterial_system_get_handle(struct kmaterial_system_state* state, kname name, kmaterial* out_material);
228 
229 KAPI b8 kmaterial_is_loaded_get(struct kmaterial_system_state* state, kmaterial material);
230 
231 KAPI ktexture kmaterial_texture_get(struct kmaterial_system_state* state, kmaterial material, kmaterial_texture_input tex_input);
232 KAPI void kmaterial_texture_set(struct kmaterial_system_state* state, kmaterial material, kmaterial_texture_input tex_input, ktexture texture);
233 
234 KAPI texture_channel kmaterial_metallic_texture_channel_get(struct kmaterial_system_state* state, kmaterial material);
235 KAPI void kmaterial_metallic_texture_channel_set(struct kmaterial_system_state* state, kmaterial material, texture_channel value);
236 
237 KAPI texture_channel kmaterial_roughness_texture_channel_get(struct kmaterial_system_state* state, kmaterial material);
238 KAPI void kmaterial_roughness_texture_channel_set(struct kmaterial_system_state* state, kmaterial material, texture_channel value);
239 
240 KAPI texture_channel kmaterial_ao_texture_channel_get(struct kmaterial_system_state* state, kmaterial material);
241 KAPI void kmaterial_ao_texture_channel_set(struct kmaterial_system_state* state, kmaterial material, texture_channel value);
242 
243 KAPI texture_filter kmaterial_texture_filter_get(struct kmaterial_system_state* state, kmaterial material);
244 KAPI void kmaterial_texture_filter_set(struct kmaterial_system_state* state, kmaterial material, texture_filter value);
245 
246 KAPI texture_repeat kmaterial_texture_mode_get(struct kmaterial_system_state* state, kmaterial material);
247 KAPI void kmaterial_texture_mode_set(struct kmaterial_system_state* state, kmaterial material, texture_repeat value);
248 
249 KAPI b8 kmaterial_has_transparency_get(struct kmaterial_system_state* state, kmaterial material);
250 KAPI void kmaterial_has_transparency_set(struct kmaterial_system_state* state, kmaterial material, b8 value);
251 
252 KAPI b8 kmaterial_double_sided_get(struct kmaterial_system_state* state, kmaterial material);
253 KAPI void kmaterial_double_sided_set(struct kmaterial_system_state* state, kmaterial material, b8 value);
254 
255 KAPI b8 kmaterial_recieves_shadow_get(struct kmaterial_system_state* state, kmaterial material);
256 KAPI void kmaterial_recieves_shadow_set(struct kmaterial_system_state* state, kmaterial material, b8 value);
257 
258 KAPI b8 kmaterial_casts_shadow_get(struct kmaterial_system_state* state, kmaterial material);
259 KAPI void kmaterial_casts_shadow_set(struct kmaterial_system_state* state, kmaterial material, b8 value);
260 
261 KAPI b8 kmaterial_normal_enabled_get(struct kmaterial_system_state* state, kmaterial material);
262 KAPI void kmaterial_normal_enabled_set(struct kmaterial_system_state* state, kmaterial material, b8 value);
263 
264 KAPI b8 kmaterial_ao_enabled_get(struct kmaterial_system_state* state, kmaterial material);
265 KAPI void kmaterial_ao_enabled_set(struct kmaterial_system_state* state, kmaterial material, b8 value);
266 
267 KAPI b8 kmaterial_emissive_enabled_get(struct kmaterial_system_state* state, kmaterial material);
268 KAPI void kmaterial_emissive_enabled_set(struct kmaterial_system_state* state, kmaterial material, b8 value);
269 
270 KAPI b8 kmaterial_refraction_enabled_get(struct kmaterial_system_state* state, kmaterial material);
271 KAPI void kmaterial_refraction_enabled_set(struct kmaterial_system_state* state, kmaterial material, b8 value);
272 
273 KAPI f32 kmaterial_refraction_scale_get(struct kmaterial_system_state* state, kmaterial material);
274 KAPI void kmaterial_refraction_scale_set(struct kmaterial_system_state* state, kmaterial material, f32 value);
275 
276 KAPI b8 kmaterial_use_vertex_colour_as_base_colour_get(struct kmaterial_system_state* state, kmaterial material);
277 KAPI void kmaterial_use_vertex_colour_as_base_colour_set(struct kmaterial_system_state* state, kmaterial material, b8 value);
278 
288 KAPI b8 kmaterial_flag_set(struct kmaterial_system_state* state, kmaterial material, kmaterial_flag_bits flag, b8 value);
289 
298 KAPI b8 kmaterial_flag_get(struct kmaterial_system_state* state, kmaterial material, kmaterial_flag_bits flag);
299 
300 // -------------------------------------------------
301 // ------------- MATERIAL INSTANCE -----------------
302 // -------------------------------------------------
303 
313 KAPI b8 kmaterial_system_acquire(struct kmaterial_system_state* state, kname name, kmaterial_instance* out_instance);
314 
321 KAPI void kmaterial_system_release(struct kmaterial_system_state* state, kmaterial_instance* instance);
322 
323 KAPI const kmaterial_data* kmaterial_get_base_material_data(struct kmaterial_system_state* state, kmaterial base_material);
324 
325 KAPI const kmaterial_data* kmaterial_system_get_all_base_materials(struct kmaterial_system_state* state);
326 
327 KAPI const kmaterial_instance_data* kmaterial_get_material_instance_data(struct kmaterial_system_state* state, kmaterial_instance instance);
328 
338 KAPI b8 kmaterial_instance_flag_set(struct kmaterial_system_state* state, kmaterial_instance instance, kmaterial_flag_bits flag, b8 value);
339 
348 KAPI b8 kmaterial_instance_flag_get(struct kmaterial_system_state* state, kmaterial_instance instance, kmaterial_flag_bits flag);
349 
358 KAPI b8 kmaterial_instance_base_colour_get(struct kmaterial_system_state* state, kmaterial_instance instance, vec4* out_value);
359 
368 KAPI b8 kmaterial_instance_base_colour_set(struct kmaterial_system_state* state, kmaterial_instance instance, vec4 value);
369 
378 KAPI b8 kmaterial_instance_uv_offset_get(struct kmaterial_system_state* state, kmaterial_instance instance, vec3* out_value);
379 
388 KAPI b8 kmaterial_instance_uv_offset_set(struct kmaterial_system_state* state, kmaterial_instance instance, vec3 value);
389 
398 KAPI b8 kmaterial_instance_uv_scale_get(struct kmaterial_system_state* state, kmaterial_instance instance, vec3* out_value);
399 
408 KAPI b8 kmaterial_instance_uv_scale_set(struct kmaterial_system_state* state, kmaterial_instance instance, vec3 value);
409 
416 KAPI kmaterial_instance kmaterial_system_get_default_standard(struct kmaterial_system_state* state);
417 
424 KAPI kmaterial_instance kmaterial_system_get_default_water(struct kmaterial_system_state* state);
425 
432 KAPI kmaterial_instance kmaterial_system_get_default_blended(struct kmaterial_system_state* state);
433 
439 KAPI void kmaterial_system_dump(struct kmaterial_system_state* state);
texture_channel
Definition: core_render_types.h:85
kmaterial_model
Definition: core_render_types.h:332
u16 ktexture
Represents a texture to be used for rendering purposes, stored on the GPU (VRAM)
Definition: core_render_types.h:299
u32 kmaterial_flags
Definition: core_render_types.h:375
texture_filter
Represents supported texture filtering modes.
Definition: core_render_types.h:70
u16 kmaterial
Definition: core_render_types.h:399
kmaterial_flag_bits
Definition: core_render_types.h:350
texture_repeat
Definition: core_render_types.h:77
kmaterial_type
Definition: core_render_types.h:323
This file contains global type definitions which are used throughout the entire engine and applicatio...
#define KAPI
Import/export qualifier.
Definition: defines.h:209
unsigned int u32
Unsigned 32-bit integer.
Definition: defines.h:27
_Bool b8
8-bit boolean type
Definition: defines.h:60
float f32
32-bit floating point number
Definition: defines.h:49
unsigned short u16
Unsigned 16-bit integer.
Definition: defines.h:24
unsigned long long u64
Unsigned 64-bit integer.
Definition: defines.h:30
KAPI void kmaterial_use_vertex_colour_as_base_colour_set(struct kmaterial_system_state *state, kmaterial material, b8 value)
KAPI b8 kmaterial_casts_shadow_get(struct kmaterial_system_state *state, kmaterial material)
KAPI b8 kmaterial_instance_base_colour_set(struct kmaterial_system_state *state, kmaterial_instance instance, vec4 value)
Sets the value of the material instance-specific base colour.
KAPI b8 kmaterial_use_vertex_colour_as_base_colour_get(struct kmaterial_system_state *state, kmaterial material)
KAPI ktexture kmaterial_texture_get(struct kmaterial_system_state *state, kmaterial material, kmaterial_texture_input tex_input)
KAPI texture_channel kmaterial_metallic_texture_channel_get(struct kmaterial_system_state *state, kmaterial material)
KAPI const kmaterial_instance_data * kmaterial_get_material_instance_data(struct kmaterial_system_state *state, kmaterial_instance instance)
KAPI b8 kmaterial_instance_flag_set(struct kmaterial_system_state *state, kmaterial_instance instance, kmaterial_flag_bits flag, b8 value)
Sets the given material instance flag's state.
KAPI void kmaterial_system_dump(struct kmaterial_system_state *state)
Dumps all of the registered materials and their reference counts/handles.
KAPI void kmaterial_double_sided_set(struct kmaterial_system_state *state, kmaterial material, b8 value)
KAPI void kmaterial_ao_texture_channel_set(struct kmaterial_system_state *state, kmaterial material, texture_channel value)
KAPI b8 kmaterial_instance_uv_scale_set(struct kmaterial_system_state *state, kmaterial_instance instance, vec3 value)
Sets the value of the material instance-specific UV scale. Can be used for animating the position of ...
KAPI void kmaterial_normal_enabled_set(struct kmaterial_system_state *state, kmaterial material, b8 value)
KAPI texture_channel kmaterial_ao_texture_channel_get(struct kmaterial_system_state *state, kmaterial material)
KAPI void kmaterial_system_release(struct kmaterial_system_state *state, kmaterial_instance *instance)
Releases the given material instance.
KAPI void kmaterial_roughness_texture_channel_set(struct kmaterial_system_state *state, kmaterial material, texture_channel value)
KAPI kmaterial_instance kmaterial_system_get_default_water(struct kmaterial_system_state *state)
Gets an instance of the default water material.
KAPI void kmaterial_ao_enabled_set(struct kmaterial_system_state *state, kmaterial material, b8 value)
b8 kmaterial_system_setup_defaults(struct kmaterial_system_state *state)
KAPI b8 kmaterial_flag_set(struct kmaterial_system_state *state, kmaterial material, kmaterial_flag_bits flag, b8 value)
Sets the given material flag's state.
KAPI b8 kmaterial_instance_uv_offset_set(struct kmaterial_system_state *state, kmaterial_instance instance, vec3 value)
Sets the value of the material instance-specific UV offset. Can be used for animating the position of...
KAPI kmaterial_instance kmaterial_system_get_default_standard(struct kmaterial_system_state *state)
Gets an instance of the default standard material.
KAPI void kmaterial_emissive_enabled_set(struct kmaterial_system_state *state, kmaterial material, b8 value)
KAPI void kmaterial_metallic_texture_channel_set(struct kmaterial_system_state *state, kmaterial material, texture_channel value)
KAPI b8 kmaterial_instance_uv_offset_get(struct kmaterial_system_state *state, kmaterial_instance instance, vec3 *out_value)
Gets the value of the material instance-specific UV offset. Can be used for animating the position of...
kmaterial_instance_state
Definition: kmaterial_system.h:92
@ KMATERIAL_INSTANCE_STATE_UNINITIALIZED
Definition: kmaterial_system.h:94
@ KMATERIAL_INSTANCE_STATE_LOADING
Definition: kmaterial_system.h:96
@ KMATERIAL_INSTANCE_STATE_LOADED
Definition: kmaterial_system.h:98
KAPI b8 kmaterial_instance_base_colour_get(struct kmaterial_system_state *state, kmaterial_instance instance, vec4 *out_value)
Gets the value of the material instance-specific base colour.
kmaterial_texture_input
Definition: kmaterial_system.h:58
@ KMATERIAL_TEXTURE_INPUT_REFRACTION_DEPTH
Definition: kmaterial_system.h:78
@ KMATERIAL_TEXTURE_INPUT_METALLIC
Definition: kmaterial_system.h:64
@ KMATERIAL_TEXTURE_INPUT_MRA
Definition: kmaterial_system.h:81
@ KMATERIAL_TEXTURE_INPUT_NORMAL
Definition: kmaterial_system.h:62
@ KMATERIAL_TEXTURE_INPUT_COUNT
Definition: kmaterial_system.h:83
@ KMATERIAL_TEXTURE_INPUT_EMISSIVE
Definition: kmaterial_system.h:70
@ KMATERIAL_TEXTURE_INPUT_BASE_COLOUR
Definition: kmaterial_system.h:60
@ KMATERIAL_TEXTURE_INPUT_REFRACTION
Definition: kmaterial_system.h:74
@ KMATERIAL_TEXTURE_INPUT_REFLECTION_DEPTH
Definition: kmaterial_system.h:76
@ KMATERIAL_TEXTURE_INPUT_DUDV
Definition: kmaterial_system.h:79
@ KMATERIAL_TEXTURE_INPUT_ROUGHNESS
Definition: kmaterial_system.h:66
@ KMATERIAL_TEXTURE_INPUT_REFLECTION
Definition: kmaterial_system.h:72
@ KMATERIAL_TEXTURE_INPUT_AMBIENT_OCCLUSION
Definition: kmaterial_system.h:68
KAPI b8 kmaterial_has_transparency_get(struct kmaterial_system_state *state, kmaterial material)
KAPI void kmaterial_refraction_enabled_set(struct kmaterial_system_state *state, kmaterial material, b8 value)
KAPI void kmaterial_texture_set(struct kmaterial_system_state *state, kmaterial material, kmaterial_texture_input tex_input, ktexture texture)
KAPI b8 kmaterial_recieves_shadow_get(struct kmaterial_system_state *state, kmaterial material)
KAPI void kmaterial_texture_mode_set(struct kmaterial_system_state *state, kmaterial material, texture_repeat value)
KAPI void kmaterial_has_transparency_set(struct kmaterial_system_state *state, kmaterial material, b8 value)
KAPI texture_repeat kmaterial_texture_mode_get(struct kmaterial_system_state *state, kmaterial material)
b8 kmaterial_system_initialize(u64 *memory_requirement, struct kmaterial_system_state *state, const kmaterial_system_config *config)
Initializes the material system. Should be called twice; once to get the memory requirement (passing ...
void kmaterial_system_shutdown(struct kmaterial_system_state *state)
Shuts down the material system.
KAPI b8 kmaterial_double_sided_get(struct kmaterial_system_state *state, kmaterial material)
KAPI texture_channel kmaterial_roughness_texture_channel_get(struct kmaterial_system_state *state, kmaterial material)
KAPI void kmaterial_refraction_scale_set(struct kmaterial_system_state *state, kmaterial material, f32 value)
KAPI const kmaterial_data * kmaterial_system_get_all_base_materials(struct kmaterial_system_state *state)
KAPI b8 kmaterial_ao_enabled_get(struct kmaterial_system_state *state, kmaterial material)
KAPI b8 kmaterial_instance_uv_scale_get(struct kmaterial_system_state *state, kmaterial_instance instance, vec3 *out_value)
Gets the value of the material instance-specific UV scale. Can be used for animating the position of ...
KAPI void kmaterial_texture_filter_set(struct kmaterial_system_state *state, kmaterial material, texture_filter value)
KAPI texture_filter kmaterial_texture_filter_get(struct kmaterial_system_state *state, kmaterial material)
struct kmaterial_data kmaterial_data
KAPI b8 kmaterial_system_get_handle(struct kmaterial_system_state *state, kname name, kmaterial *out_material)
Attempts to get the identifier of a material with the given name. If it has not yet been loaded,...
KAPI f32 kmaterial_refraction_scale_get(struct kmaterial_system_state *state, kmaterial material)
struct kmaterial_instance_data kmaterial_instance_data
KAPI b8 kmaterial_flag_get(struct kmaterial_system_state *state, kmaterial material, kmaterial_flag_bits flag)
Gets value of the given material flag's state.
KAPI b8 kmaterial_normal_enabled_get(struct kmaterial_system_state *state, kmaterial material)
KAPI kmaterial_instance kmaterial_system_get_default_blended(struct kmaterial_system_state *state)
Gets an instance of the default blended material.
struct kmaterial_system_config kmaterial_system_config
The configuration for the material system.
KAPI b8 kmaterial_refraction_enabled_get(struct kmaterial_system_state *state, kmaterial material)
KAPI b8 kmaterial_system_acquire(struct kmaterial_system_state *state, kname name, kmaterial_instance *out_instance)
Attempts to acquire an instance of the material with the given handle. Increases internal reference c...
KAPI void kmaterial_casts_shadow_set(struct kmaterial_system_state *state, kmaterial material, b8 value)
KAPI b8 kmaterial_instance_flag_get(struct kmaterial_system_state *state, kmaterial_instance instance, kmaterial_flag_bits flag)
Gets value of the given material instance flag's state.
KAPI const kmaterial_data * kmaterial_get_base_material_data(struct kmaterial_system_state *state, kmaterial base_material)
KAPI void kmaterial_recieves_shadow_set(struct kmaterial_system_state *state, kmaterial material, b8 value)
KAPI b8 kmaterial_is_loaded_get(struct kmaterial_system_state *state, kmaterial material)
kmaterial_state
Definition: kmaterial_system.h:86
@ KMATERIAL_STATE_LOADED
Definition: kmaterial_system.h:89
@ KMATERIAL_STATE_LOADING
Definition: kmaterial_system.h:88
@ KMATERIAL_STATE_UNINITIALIZED
Definition: kmaterial_system.h:87
KAPI b8 kmaterial_emissive_enabled_get(struct kmaterial_system_state *state, kmaterial material)
This files contains an implementation of knames.
u64 kname
A kname is a string hash made for quick comparisons versus traditional string comparisons.
Definition: kname.h:36
Engine-level current frame-specific data.
Definition: frame_data.h:15
Definition: kmaterial_system.h:124
f32 metallic
Definition: kmaterial_system.h:141
ktexture roughness_texture
Definition: kmaterial_system.h:146
vec3 uv_scale
Definition: kmaterial_system.h:180
ktexture dudv_texture
Definition: kmaterial_system.h:162
f32 wave_speed
Definition: kmaterial_system.h:185
vec3 uv_offset
Definition: kmaterial_system.h:178
kname name
Definition: kmaterial_system.h:127
kmaterial_model model
The material lighting model.
Definition: kmaterial_system.h:133
u32 binding_set_id
Definition: kmaterial_system.h:189
vec3 mra
Definition: kmaterial_system.h:165
ktexture base_colour_texture
Definition: kmaterial_system.h:136
vec4 base_colour
Definition: kmaterial_system.h:135
ktexture reflection_depth_texture
Definition: kmaterial_system.h:161
kmaterial_state state
Definition: kmaterial_system.h:129
texture_channel roughness_texture_channel
Definition: kmaterial_system.h:147
ktexture ao_texture
Definition: kmaterial_system.h:150
f32 ao
Definition: kmaterial_system.h:149
kmaterial_flags flags
Definition: kmaterial_system.h:175
ktexture reflection_texture
Definition: kmaterial_system.h:160
vec3 normal
Definition: kmaterial_system.h:138
ktexture refraction_depth_texture
Definition: kmaterial_system.h:163
ktexture metallic_texture
Definition: kmaterial_system.h:142
kmaterial_type type
The material type. Ultimately determines what shader the material is rendered with.
Definition: kmaterial_system.h:131
texture_channel ao_texture_channel
Definition: kmaterial_system.h:151
f32 roughness
Definition: kmaterial_system.h:145
texture_channel metallic_texture_channel
Definition: kmaterial_system.h:143
ktexture emissive_texture
Definition: kmaterial_system.h:154
f32 tiling
Definition: kmaterial_system.h:186
f32 emissive_texture_intensity
Definition: kmaterial_system.h:155
u16 index
Definition: kmaterial_system.h:125
vec4 emissive
Definition: kmaterial_system.h:153
f32 refraction_scale
Definition: kmaterial_system.h:158
ktexture normal_texture
Definition: kmaterial_system.h:139
ktexture mra_texture
This is a combined texture holding metallic/roughness/ambient occlusion all in one texture....
Definition: kmaterial_system.h:172
f32 wave_strength
Definition: kmaterial_system.h:183
ktexture refraction_texture
Definition: kmaterial_system.h:157
Definition: kmaterial_system.h:103
vec3 uv_scale
Definition: kmaterial_system.h:118
vec3 uv_offset
Definition: kmaterial_system.h:116
vec4 base_colour
Definition: kmaterial_system.h:110
kmaterial material
Definition: kmaterial_system.h:107
kmaterial_flags flags
Definition: kmaterial_system.h:113
kmaterial_instance_state state
Definition: kmaterial_system.h:104
A material instance, which contains handles to both the base material as well as the instance itself....
Definition: core_render_types.h:409
The configuration for the material system.
Definition: kmaterial_system.h:50
u32 max_material_count
The maximum number of loaded materials.
Definition: kmaterial_system.h:52
u32 max_instance_count
The maximum number of material instances.
Definition: kmaterial_system.h:55
A 3-element vector.
Definition: math_types.h:117
A 4-element vector.
Definition: math_types.h:229