Flutter Engine
The Flutter Engine
Classes | Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
impeller::scene::Material Class Referenceabstract

#include <material.h>

Inheritance diagram for impeller::scene::Material:
impeller::scene::PhysicallyBasedMaterial impeller::scene::UnlitMaterial

Classes

struct  BlendConfig
 
struct  StencilConfig
 

Public Member Functions

virtual ~Material ()
 
void SetVertexColorWeight (Scalar weight)
 
void SetBlendConfig (BlendConfig blend_config)
 
void SetStencilConfig (StencilConfig stencil_config)
 
void SetTranslucent (bool is_translucent)
 
SceneContextOptions GetContextOptions (const RenderPass &pass) const
 
virtual MaterialType GetMaterialType () const =0
 
virtual void BindToCommand (const SceneContext &scene_context, HostBuffer &buffer, RenderPass &pass) const =0
 

Static Public Member Functions

static std::unique_ptr< MaterialMakeFromFlatbuffer (const fb::Material &material, const std::vector< std::shared_ptr< Texture > > &textures)
 
static std::unique_ptr< UnlitMaterialMakeUnlit ()
 
static std::unique_ptr< PhysicallyBasedMaterialMakePhysicallyBased ()
 

Protected Attributes

Scalar vertex_color_weight_ = 1
 
BlendConfig blend_config_
 
StencilConfig stencil_config_
 
bool is_translucent_ = false
 

Detailed Description

Definition at line 27 of file material.h.

Constructor & Destructor Documentation

◆ ~Material()

impeller::scene::Material::~Material ( )
virtualdefault

Member Function Documentation

◆ BindToCommand()

virtual void impeller::scene::Material::BindToCommand ( const SceneContext scene_context,
HostBuffer buffer,
RenderPass pass 
) const
pure virtual

◆ GetContextOptions()

SceneContextOptions impeller::scene::Material::GetContextOptions ( const RenderPass pass) const

Definition at line 62 of file material.cc.

62 {
63 // TODO(bdero): Pipeline blend and stencil config.
64 return {.sample_count = pass.GetRenderTarget().GetSampleCount()};
65}

◆ GetMaterialType()

virtual MaterialType impeller::scene::Material::GetMaterialType ( ) const
pure virtual

◆ MakeFromFlatbuffer()

std::unique_ptr< Material > impeller::scene::Material::MakeFromFlatbuffer ( const fb::Material &  material,
const std::vector< std::shared_ptr< Texture > > &  textures 
)
static

Definition at line 27 of file material.cc.

29 {
30 switch (material.type()) {
31 case fb::MaterialType::kUnlit:
32 return UnlitMaterial::MakeFromFlatbuffer(material, textures);
33 case fb::MaterialType::kPhysicallyBased:
34 return PhysicallyBasedMaterial::MakeFromFlatbuffer(material, textures);
35 }
36}
static std::unique_ptr< PhysicallyBasedMaterial > MakeFromFlatbuffer(const fb::Material &material, const std::vector< std::shared_ptr< Texture > > &textures)
Definition: material.cc:137
static std::unique_ptr< UnlitMaterial > MakeFromFlatbuffer(const fb::Material &material, const std::vector< std::shared_ptr< Texture > > &textures)
Definition: material.cc:71

◆ MakePhysicallyBased()

std::unique_ptr< PhysicallyBasedMaterial > impeller::scene::Material::MakePhysicallyBased ( )
static

Definition at line 42 of file material.cc.

42 {
43 return std::make_unique<PhysicallyBasedMaterial>();
44}

◆ MakeUnlit()

std::unique_ptr< UnlitMaterial > impeller::scene::Material::MakeUnlit ( )
static

Definition at line 38 of file material.cc.

38 {
39 return std::make_unique<UnlitMaterial>();
40}

◆ SetBlendConfig()

void impeller::scene::Material::SetBlendConfig ( BlendConfig  blend_config)

Definition at line 50 of file material.cc.

50 {
51 blend_config_ = blend_config;
52}
BlendConfig blend_config_
Definition: material.h:68

◆ SetStencilConfig()

void impeller::scene::Material::SetStencilConfig ( StencilConfig  stencil_config)

Definition at line 54 of file material.cc.

54 {
55 stencil_config_ = stencil_config;
56}
StencilConfig stencil_config_
Definition: material.h:69

◆ SetTranslucent()

void impeller::scene::Material::SetTranslucent ( bool  is_translucent)

Definition at line 58 of file material.cc.

58 {
59 is_translucent_ = is_translucent;
60}

◆ SetVertexColorWeight()

void impeller::scene::Material::SetVertexColorWeight ( Scalar  weight)

Definition at line 46 of file material.cc.

46 {
47 vertex_color_weight_ = weight;
48}

Member Data Documentation

◆ blend_config_

BlendConfig impeller::scene::Material::blend_config_
protected

Definition at line 68 of file material.h.

◆ is_translucent_

bool impeller::scene::Material::is_translucent_ = false
protected

Definition at line 70 of file material.h.

◆ stencil_config_

StencilConfig impeller::scene::Material::stencil_config_
protected

Definition at line 69 of file material.h.

◆ vertex_color_weight_

Scalar impeller::scene::Material::vertex_color_weight_ = 1
protected

Definition at line 67 of file material.h.


The documentation for this class was generated from the following files: