lv_gltf_environment.h
API reference for lv_gltf_environment.h
Functions
lv_gltf_ibl_sampler_set_cube_map_pixel_resolution
Set the resolution for each cubemap face
void lv_gltf_ibl_sampler_set_cube_map_pixel_resolution(lv_gltf_ibl_sampler_t *sampler, uint32_t resolution)| Name | Type | Description |
|---|---|---|
sampler | lv_gltf_ibl_sampler_t * | pointer to a sampler |
resolution | uint32_t | resolution of each cube map face in pixels (recommended: 64-512 for embedded) |
lv_gltf_environment_set_angle
Set the rotation angle of the environment map
void lv_gltf_environment_set_angle(lv_gltf_environment_t *env, float angle)| Name | Type | Description |
|---|---|---|
env | lv_gltf_environment_t * | pointer to the environment |
angle | float | rotation angle in degrees |
lv_gltf_ibl_sampler_create
Create an IBL sampler for processing environment images
lv_gltf_ibl_sampler_t * lv_gltf_ibl_sampler_create(void)Returns: lv_gltf_ibl_sampler_t * — pointer to the created sampler, or NULL on failure
Can be safely deleted after environments are created
lv_gltf_ibl_sampler_delete
Delete an IBL sampler
void lv_gltf_ibl_sampler_delete(lv_gltf_ibl_sampler_t *sampler)| Name | Type | Description |
|---|---|---|
sampler | lv_gltf_ibl_sampler_t * | pointer to the sampler to delete May be NULL. |
lv_gltf_environment_create
Create an environment from an HDR or JPEG panoramic image for IBL rendering
lv_gltf_environment_t * lv_gltf_environment_create(lv_gltf_ibl_sampler_t *sampler, const char *file_path)| Name | Type | Description |
|---|---|---|
sampler | lv_gltf_ibl_sampler_t * | IBL sampler defining output resolution, must not be NULL (can be deleted after this call) |
file_path | const char * | path to equirectangular environment image. May be NULL.. Pass NULL to use default embedded image |
Returns: lv_gltf_environment_t * — pointer to the created environment, or NULL on failure
The image is read through the LVGL file system, so file_path takes a drive letter like any other LVGL path.
An image that cannot be read is reported with a warning and the default embedded image is used instead
The source image will be downsampled to the sampler's texture_size
The environment can be shared across multiple glTF objects
lv_gltf_environment_delete
Delete an environment
void lv_gltf_environment_delete(lv_gltf_environment_t *environment)| Name | Type | Description |
|---|---|---|
environment | lv_gltf_environment_t * | pointer to the environment to delete May be NULL. |
Macros
LV_GLTF_DEFAULT_CUBE_MAP_RESOLUTION
#define LV_GLTF_DEFAULT_CUBE_MAP_RESOLUTION 128Dependencies
Last updated on