# render_component.h ## Overview
Render Graph ray tracing interface
## Index
`TM_TT_TYPE__RENDER_COMPONENT`
`TM_TT_TYPE_HASH__RENDER_COMPONENT__REQUEST_ACCELERATION_STRUCTURES`
`TM_RENDER_GRAPH_BLACKBOARD__RENDER_COMPONENT__DEFAULT_TLAS`
`struct tm_render_component_tlas_shader_instance_t`
`struct tm_render_component_tlas_shader_instances_t`
`TM_RENDER_GRAPH_BLACKBOARD__RENDER_COMPONENT__DEFAULT_TLAS_SHADER_INSTANCES`
`enum TM_TT_PROP__RENDER_COMPONENT`
`struct tm_render_component_public_t`
`TM_ENTITY_SYSTEM__RENDER`

`struct tm_render_component_api`
`draw_call()`
`draw_calls()`
`set_culling_enable()`
`set_draws_enable()`
`set_creation_graph()`
`can_request_tlas()`
`component_properties()`

`tm_render_component_api_version`
## API
### `TM_TT_TYPE__RENDER_COMPONENT`
~~~c #define TM_TT_TYPE__RENDER_COMPONENT "tm_render_component" #define TM_TT_TYPE_HASH__RENDER_COMPONENT TM_STATIC_HASH("tm_render_component", 0xc8e2133c522d2218ULL) ~~~
### `TM_TT_TYPE_HASH__RENDER_COMPONENT__REQUEST_ACCELERATION_STRUCTURES`
~~~c #define TM_TT_TYPE_HASH__RENDER_COMPONENT__REQUEST_ACCELERATION_STRUCTURES TM_STATIC_HASH("tm_render_component__request_acceleration_structures", 0xb90fc10685f083bULL) ~~~
### `TM_RENDER_GRAPH_BLACKBOARD__RENDER_COMPONENT__DEFAULT_TLAS`
~~~c #define TM_RENDER_GRAPH_BLACKBOARD__RENDER_COMPONENT__DEFAULT_TLAS ~~~ Render Graph blackboard keys for storling TLAS render handle and TLAS shader instances.
### `struct tm_render_component_tlas_shader_instance_t`
~~~c typedef struct tm_render_component_tlas_shader_instance_t { struct tm_shader_o *shader; uint32_t cbuffer; uint32_t rbinder; struct tm_shader_system_o *vertex_system; uint32_t vertex_system_cbuffer; uint32_t vertex_system_rbinder; } tm_render_component_tlas_shader_instance_t; ~~~
### `struct tm_render_component_tlas_shader_instances_t`
~~~c typedef struct tm_render_component_tlas_shader_instances_t { // Validity hash of `shader_instance`. Useful for caching and invalidating shader binding tables and pipelines. uint64_t validity_hash; // Array of shader instances, one instance per TLAS instance. /* carray */ tm_render_component_tlas_shader_instance_t *shader_instances; } tm_render_component_tlas_shader_instances_t; ~~~
### `TM_RENDER_GRAPH_BLACKBOARD__RENDER_COMPONENT__DEFAULT_TLAS_SHADER_INSTANCES`
~~~c #define TM_RENDER_GRAPH_BLACKBOARD__RENDER_COMPONENT__DEFAULT_TLAS_SHADER_INSTANCES ~~~
### `enum TM_TT_PROP__RENDER_COMPONENT`
Render Component interface ~~~c enum { TM_TT_PROP__RENDER_COMPONENT__CREATION_GRAPH, // subobject [[TM_TT_TYPE__CREATION_GRAPH]] }; ~~~
### `struct tm_render_component_public_t`
~~~c typedef struct tm_render_component_public_t { // Merged bounding volume from all bounding volume nodes present in the creation graph. tm_vec3_t bounding_box[2]; // True if no bounding volumes are generated by the creation graph, or user has called tm_render_component_api->set_culling_enable(c, false) bool culling_disabled; // Set this to true to force an update of the shader variables from another component. bool update_shader_variables; TM_PAD(2); } tm_render_component_public_t; ~~~
### `TM_ENTITY_SYSTEM__RENDER`
~~~c #define TM_ENTITY_SYSTEM__RENDER ~~~ Entity system for rendering.
### `struct tm_render_component_api`
#### `draw_call()` ~~~c const struct tm_creation_graph_draw_call_data_t *(*draw_call)(tm_render_component_public_t *c, tm_strhash_t name); ~~~ If the render component `c` has a draw call tagged with hashed `name` its data will be returned, else null. #### `draw_calls()` ~~~c uint32_t (*draw_calls)(tm_render_component_public_t *c, const struct tm_creation_graph_draw_call_data_t **draw_calls_data); ~~~ Retrieves all `draw_calls_data` associated with component and returns the count. #### `set_culling_enable()` ~~~c void (*set_culling_enable)(tm_render_component_public_t *c, bool state); ~~~ Enable / disable view frustum culling of component. #### `set_draws_enable()` ~~~c void (*set_draws_enable)(tm_render_component_public_t *c, bool state); ~~~ Enable / disable draw call scheduling. #### `set_creation_graph()` ~~~c void (*set_creation_graph)(struct tm_entity_context_o *ctx, tm_render_component_public_t *c, const struct tm_the_truth_o *tt, tm_tt_id_t creation_graph); ~~~ Sets the creation graph used by the specified render component to the specified truth object. #### `can_request_tlas()` ~~~c bool (*can_request_tlas)(struct tm_entity_context_o *ctx); ~~~ Gets whether a top-level acceleration structure can be created for the specified entity context. #### `component_properties()` ~~~c struct tm_component_properties_i *(*component_properties)(void); ~~~ Returns the component properties interface associated with the render component.
### `tm_render_component_api_version`
~~~c #define tm_render_component_api_version ~~~