2#include <engine/engine_export.h>
78 auto get_lods()
const ->
const std::vector<asset_handle<mesh>>&;
90 auto get_materials()
const ->
const std::vector<asset_handle<material>>&;
155 void submit(
const math::mat4& world_transform,
158 const std::vector<pose_mat4>& skinning_matrices,
178 void recalulate_lod_limits();
187 std::vector<asset_handle<material>> materials_;
189 std::vector<material::sptr> material_instances_;
192 std::vector<asset_handle<mesh>> mesh_lods_;
194 std::vector<urange32_t> lod_limits_;
Base class for materials used in rendering.
std::shared_ptr< material > sptr
Main class representing a 3D mesh with support for different LODs, submeshes, and skinning.
Structure describing a LOD group (set of meshes), LOD transitions, and their materials.
auto get_material(uint32_t index) const -> asset_handle< material >
Gets the material for the specified index.
void set_lod_limits(const std::vector< urange32_t > &limits)
Sets the LOD limits.
auto get_lod(uint32_t lod) const -> asset_handle< mesh >
Gets the LOD (Level of Detail) mesh for the specified level.
static auto fallback_material() -> asset_handle< material > &
Gets the fallback material.
void set_material(asset_handle< material > material, uint32_t index)
Sets the material for the specified index.
auto is_valid() const -> bool
Checks if the model is valid.
auto get_lod_limits() const -> const std::vector< urange32_t > &
Gets the LOD limits.
void set_materials(const std::vector< asset_handle< material > > &materials)
Sets the materials.
void set_material_instances(const std::vector< material::sptr > &materials)
static auto default_material() -> asset_handle< material > &
Gets the default material.
void submit(const math::mat4 &world_transform, const pose_mat4 &submesh_transforms, const pose_mat4 &bone_transforms, const std::vector< pose_mat4 > &skinning_matrices, unsigned int lod, const submit_callbacks &callbacks) const
Submits the model for rendering.
auto get_material_instance(uint32_t index) const -> material::sptr
auto get_material_instances() const -> const std::vector< material::sptr > &
void set_material_instance(material::sptr material, uint32_t index)
void set_lods(const std::vector< asset_handle< mesh > > &lods)
Sets the LOD meshes.
auto get_or_emplace_material_instance(uint32_t index) -> material::sptr
void set_lod(asset_handle< mesh > mesh, uint32_t lod)
Sets the LOD (Level of Detail) mesh for the specified level.
auto get_materials() const -> const std::vector< asset_handle< material > > &
Gets all the materials.
auto get_lods() const -> const std::vector< asset_handle< mesh > > &
Gets all the LOD meshes.
Represents a handle to an asset, providing access and management functions.
Parameters for the submit callbacks.
bool skinned
Indicates if the model is skinned.
Callbacks for submitting the model for rendering.
std::function< void(const params &info, const material &)> setup_params_per_submesh
Callback for setting up per submesh.
std::function< void(const params &info)> setup_begin
Callback for setup begin.
std::function< void(const params &info)> setup_params_per_instance
Callback for setting up per instance.
std::function< void(const params &info)> setup_end
Callback for setup end.
std::vector< math::mat4 > transforms
Vector of bone transforms.