 |
Flutter Impeller
|
|
Go to the documentation of this file.
5 #ifndef FLUTTER_IMPELLER_SCENE_MATERIAL_H_
6 #define FLUTTER_IMPELLER_SCENE_MATERIAL_H_
14 #include "impeller/scene/importer/scene_flatbuffers.h"
21 struct SceneContextOptions;
25 class PhysicallyBasedMaterial;
44 const fb::Material& material,
45 const std::vector<std::shared_ptr<Texture>>&
textures);
47 static std::unique_ptr<UnlitMaterial>
MakeUnlit();
76 const fb::Material& material,
77 const std::vector<std::shared_ptr<Texture>>&
textures);
95 std::shared_ptr<Texture> color_texture_;
101 const fb::Material& material,
102 const std::vector<std::shared_ptr<Texture>>&
textures);
112 std::shared_ptr<Texture> metallic_roughness_texture);
131 std::shared_ptr<Texture> albedo_texture_;
132 std::shared_ptr<Texture> metallic_roughness_texture_;
133 std::shared_ptr<Texture> normal_texture_;
134 std::shared_ptr<Texture> occlusion_texture_;
136 std::shared_ptr<Texture> environment_map_;
142 #endif // FLUTTER_IMPELLER_SCENE_MATERIAL_H_
void SetEnvironmentMap(std::shared_ptr< Texture > environment_map)
virtual MaterialType GetMaterialType() const =0
void BindToCommand(const SceneContext &scene_context, HostBuffer &buffer, RenderPass &pass) const override
void SetMetallic(Scalar metallic)
void SetMetallicRoughnessTexture(std::shared_ptr< Texture > metallic_roughness_texture)
@ kKeep
Don't modify the current stencil value.
void SetAlbedo(Color albedo)
void SetColorTexture(std::shared_ptr< Texture > color_texture)
static std::unique_ptr< PhysicallyBasedMaterial > MakePhysicallyBased()
BlendFactor destination_alpha_factor
void SetBlendConfig(BlendConfig blend_config)
BlendConfig blend_config_
SceneContextOptions GetContextOptions(const RenderPass &pass) const
MaterialType GetMaterialType() const override
BlendFactor source_color_factor
StencilOperation operation
BlendFactor source_alpha_factor
void SetVertexColorWeight(Scalar weight)
void SetColor(Color color)
void SetStencilConfig(StencilConfig stencil_config)
void SetNormalTexture(std::shared_ptr< Texture > normal_texture)
static constexpr Color White()
BlendFactor destination_color_factor
static std::unique_ptr< UnlitMaterial > MakeFromFlatbuffer(const fb::Material &material, const std::vector< std::shared_ptr< Texture >> &textures)
void SetOcclusionTexture(std::shared_ptr< Texture > occlusion_texture)
@ kAlways
Comparison test passes always passes.
MaterialType GetMaterialType() const override
static std::unique_ptr< Material > MakeFromFlatbuffer(const fb::Material &material, const std::vector< std::shared_ptr< Texture >> &textures)
Render passes encode render commands directed as one specific render target into an underlying comman...
void SetRoughness(Scalar roughness)
std::vector< std::shared_ptr< FakeTexture > > textures
static std::unique_ptr< UnlitMaterial > MakeUnlit()
void SetAlbedoTexture(std::shared_ptr< Texture > albedo_texture)
void BindToCommand(const SceneContext &scene_context, HostBuffer &buffer, RenderPass &pass) const override
Scalar vertex_color_weight_
virtual void BindToCommand(const SceneContext &scene_context, HostBuffer &buffer, RenderPass &pass) const =0
~PhysicallyBasedMaterial()
static std::unique_ptr< PhysicallyBasedMaterial > MakeFromFlatbuffer(const fb::Material &material, const std::vector< std::shared_ptr< Texture >> &textures)
StencilConfig stencil_config_
void SetTranslucent(bool is_translucent)