5#ifndef FLUTTER_IMPELLER_SCENE_MATERIAL_H_
6#define FLUTTER_IMPELLER_SCENE_MATERIAL_H_
14#include "impeller/scene/importer/scene_flatbuffers.h"
21struct SceneContextOptions;
25class 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_;
Render passes encode render commands directed as one specific render target into an underlying comman...
static std::unique_ptr< Material > MakeFromFlatbuffer(const fb::Material &material, const std::vector< std::shared_ptr< Texture > > &textures)
Scalar vertex_color_weight_
void SetVertexColorWeight(Scalar weight)
virtual void BindToCommand(const SceneContext &scene_context, HostBuffer &buffer, RenderPass &pass) const =0
void SetStencilConfig(StencilConfig stencil_config)
void SetTranslucent(bool is_translucent)
SceneContextOptions GetContextOptions(const RenderPass &pass) const
static std::unique_ptr< PhysicallyBasedMaterial > MakePhysicallyBased()
virtual MaterialType GetMaterialType() const =0
StencilConfig stencil_config_
void SetBlendConfig(BlendConfig blend_config)
static std::unique_ptr< UnlitMaterial > MakeUnlit()
BlendConfig blend_config_
void SetEnvironmentMap(std::shared_ptr< Texture > environment_map)
void SetMetallicRoughnessTexture(std::shared_ptr< Texture > metallic_roughness_texture)
static std::unique_ptr< PhysicallyBasedMaterial > MakeFromFlatbuffer(const fb::Material &material, const std::vector< std::shared_ptr< Texture > > &textures)
MaterialType GetMaterialType() const override
void SetNormalTexture(std::shared_ptr< Texture > normal_texture)
void SetAlbedoTexture(std::shared_ptr< Texture > albedo_texture)
void SetOcclusionTexture(std::shared_ptr< Texture > occlusion_texture)
~PhysicallyBasedMaterial()
void SetRoughness(Scalar roughness)
void SetMetallic(Scalar metallic)
void BindToCommand(const SceneContext &scene_context, HostBuffer &buffer, RenderPass &pass) const override
void SetAlbedo(Color albedo)
static std::unique_ptr< UnlitMaterial > MakeFromFlatbuffer(const fb::Material &material, const std::vector< std::shared_ptr< Texture > > &textures)
MaterialType GetMaterialType() const override
void BindToCommand(const SceneContext &scene_context, HostBuffer &buffer, RenderPass &pass) const override
void SetColorTexture(std::shared_ptr< Texture > color_texture)
void SetColor(Color color)
std::vector< std::shared_ptr< FakeTexture > > textures
static const uint8_t buffer[]
@ kAlways
Comparison test passes always passes.
@ kKeep
Don't modify the current stencil value.
static constexpr Color White()
BlendFactor source_alpha_factor
BlendFactor source_color_factor
BlendFactor destination_alpha_factor
BlendFactor destination_color_factor
StencilOperation operation