11 auto mat = std::make_shared<material>(*
this);
45 uint64_t states = 0 | BGFX_STATE_WRITE_RGB | BGFX_STATE_WRITE_A | BGFX_STATE_MSAA;
49 states |= BGFX_STATE_WRITE_Z;
54 states |= BGFX_STATE_DEPTH_TEST_LESS;
62 states |= BGFX_STATE_CULL_CCW;
66 states |= BGFX_STATE_CULL_CW;
76 auto mat = std::make_shared<pbr_material>(*
this);
Class representing a GPU program.
Base class for materials used in rendering.
static auto default_normal_map() -> asset_handle< gfx::texture > &
Gets the default normal map.
static auto default_color_map() -> asset_handle< gfx::texture > &
Gets the default color map.
std::shared_ptr< material > sptr
void set_cull_type(cull_type val)
Sets the culling type of the material.
virtual auto submit(gpu_program *program) const -> bool
Submits the material properties to the GPU program.
virtual auto get_render_states(bool apply_cull=true, bool depth_write=true, bool depth_test=true) const -> uint64_t
Gets the render states for the material.
cull_type cull_type_
< The culling type for this material.
auto get_cull_type() const -> cull_type
Gets the culling type of the material.
virtual auto clone() const -> material::sptr
Clones a materiial.
auto clone() const -> std::shared_ptr< material > override
cull_type
Enum representing the type of culling to be used.
@ counter_clockwise
Cull counter-clockwise faces.
@ clockwise
Cull clockwise faces.
Represents a handle to an asset, providing access and management functions.