30 #include <unordered_map> 31 #include <unordered_set> 56 namespace visualization {
88 MaterialHandle CreateMaterial(
const void* material_data,
size_t data_size);
93 TextureHandle CreateTexture(
const std::shared_ptr<geometry::Image>& image,
111 size_t index_stride);
113 std::weak_ptr<filament::Material> GetMaterial(
const MaterialHandle&
id);
114 std::weak_ptr<filament::MaterialInstance> GetMaterialInstance(
116 std::weak_ptr<filament::Texture> GetTexture(
const TextureHandle&
id);
117 std::weak_ptr<filament::IndirectLight> GetIndirectLight(
119 std::weak_ptr<filament::Skybox> GetSkybox(
const SkyboxHandle&
id);
120 std::weak_ptr<filament::VertexBuffer> GetVertexBuffer(
122 std::weak_ptr<filament::IndexBuffer> GetIndexBuffer(
130 template <
class ResourceType>
132 std::shared_ptr<ResourceType>
ptr;
133 size_t use_count = 0;
142 filament::Engine& engine_;
144 template <
class ResourceType>
145 using ResourcesContainer =
146 std::unordered_map<REHandle_abstract, BoxedResource<ResourceType>>;
148 ResourcesContainer<filament::MaterialInstance> material_instances_;
149 ResourcesContainer<filament::Material> materials_;
150 ResourcesContainer<filament::Texture> textures_;
151 ResourcesContainer<filament::IndirectLight> ibls_;
152 ResourcesContainer<filament::Skybox> skyboxes_;
153 ResourcesContainer<filament::VertexBuffer> vertex_buffers_;
154 ResourcesContainer<filament::IndexBuffer> index_buffers_;
160 std::unordered_map<REHandle_abstract, std::unordered_set<REHandle_abstract>>
163 filament::Texture* LoadTextureFromImage(
164 const std::shared_ptr<geometry::Image>& image,
bool srgb);
165 filament::Texture* LoadFilledTexture(
const Eigen::Vector3f&
color,
static const MaterialInstanceHandle kColorMapMaterial
Definition: FilamentResourceManager.h:78
BoxedResource()
Definition: FilamentResourceManager.h:135
BoxedResource(std::shared_ptr< ResourceType > p)
Definition: FilamentResourceManager.h:136
static const MaterialHandle kDefaultUnlitWithTransparency
Definition: FilamentResourceManager.h:68
static const MaterialHandle kDefaultDepthShader
Definition: FilamentResourceManager.h:70
Definition: RendererHandle.h:115
static const MaterialHandle kDefaultUnlitSolidColorShader
Definition: FilamentResourceManager.h:72
Definition: FilamentResourceManager.h:62
Definition: FilamentResourceManager.h:131
static const MaterialHandle kDefaultUnlitBackgroundShader
Definition: FilamentResourceManager.h:73
static const TextureHandle kDefaultNormalMap
Definition: FilamentResourceManager.h:81
static const MaterialHandle kDefaultLineShader
Definition: FilamentResourceManager.h:74
static const MaterialHandle kDefaultNormalShader
Definition: FilamentResourceManager.h:69
static const MaterialHandle kDefaultUnlit
Definition: FilamentResourceManager.h:67
math::float4 color
Definition: LineSetBuffers.cpp:64
Definition: Renderer.h:45
static const MaterialHandle kDefaultLitSSR
Definition: FilamentResourceManager.h:66
static const MaterialInstanceHandle kDepthMaterial
Definition: FilamentResourceManager.h:76
std::shared_ptr< ResourceType > ptr
Definition: FilamentResourceManager.h:132
static const TextureHandle kDefaultColorMap
Definition: FilamentResourceManager.h:80
static const MaterialHandle kDefaultUnlitGradientShader
Definition: FilamentResourceManager.h:71
static const MaterialInstanceHandle kNormalsMaterial
Definition: FilamentResourceManager.h:77
Definition: PinholeCameraIntrinsic.cpp:35
static const MaterialHandle kDefaultLit
Definition: FilamentResourceManager.h:64
std::shared_ptr< ResourceType > operator->()
Definition: FilamentResourceManager.h:138
Definition: RendererHandle.h:72
static const TextureHandle kDefaultTexture
Definition: FilamentResourceManager.h:79
static const MaterialHandle kDefaultLitWithTransparency
Definition: FilamentResourceManager.h:65
Definition: FilamentEngine.h:31
The Image class stores image with customizable width, height, num of channels and bytes per channel...
Definition: Image.h:53
static const MaterialHandle kDefaultUnlitPolygonOffsetShader
Definition: FilamentResourceManager.h:75