13 #include <unordered_map>
14 #include <unordered_set>
45 namespace visualization {
104 const std::shared_ptr<geometry::Image>
image,
120 size_t index_stride);
141 template <
class ResourceType>
143 std::shared_ptr<ResourceType>
ptr;
153 filament::Engine& engine_;
155 template <
class ResourceType>
156 using ResourcesContainer =
157 std::unordered_map<REHandle_abstract, BoxedResource<ResourceType>>;
159 ResourcesContainer<filament::MaterialInstance> material_instances_;
160 ResourcesContainer<filament::Material> materials_;
161 ResourcesContainer<filament::Texture> textures_;
162 ResourcesContainer<filament::RenderTarget> render_targets_;
163 ResourcesContainer<filament::IndirectLight> ibls_;
164 ResourcesContainer<filament::Skybox> skyboxes_;
165 ResourcesContainer<filament::VertexBuffer> vertex_buffers_;
166 ResourcesContainer<filament::IndexBuffer> index_buffers_;
172 std::unordered_map<REHandle_abstract, std::unordered_set<REHandle_abstract>>
175 filament::Texture* LoadTextureFromImage(
176 const std::shared_ptr<geometry::Image>&
image,
bool srgb);
179 filament::Texture* LoadFilledTexture(
const Eigen::Vector3f&
color,
std::shared_ptr< core::Tensor > image
std::vector< UVAtlasVertex > vb
The Image class stores image with customizable width, height, num of channels and bytes per channel.
The Image class stores image with customizable rows, cols, channels, dtype and device.
IndexBufferHandle CreateIndexBuffer(size_t indices_count, size_t index_stride)
static const MaterialHandle kDefaultUnlitSolidColorShader
static const MaterialHandle kDefaultUnlitPolygonOffsetShader
TextureHandle CreateTextureFilled(const Eigen::Vector3f &color, size_t dimension)
std::weak_ptr< filament::Material > GetMaterial(const MaterialHandle &id)
static const MaterialHandle kDefaultLit
static const MaterialHandle kDefaultDepthValueShader
std::weak_ptr< filament::IndexBuffer > GetIndexBuffer(const IndexBufferHandle &id)
void Destroy(const REHandle_abstract &id)
std::weak_ptr< filament::IndirectLight > GetIndirectLight(const IndirectLightHandle &id)
static const MaterialHandle kDefaultLitSSR
static const MaterialInstanceHandle kNormalsMaterial
static const MaterialHandle kInfinitePlaneShader
bool UpdateTexture(TextureHandle texture, const std::shared_ptr< geometry::Image > image, bool srgb)
static const MaterialHandle kGaussianSplatShader
static const TextureHandle kDefaultColorMap
std::weak_ptr< filament::RenderTarget > GetRenderTarget(const RenderTargetHandle &id)
std::weak_ptr< filament::Texture > GetTexture(const TextureHandle &id)
std::weak_ptr< filament::Skybox > GetSkybox(const SkyboxHandle &id)
SkyboxHandle CreateColorSkybox(const Eigen::Vector3f &color)
TextureHandle CreateTexture(const char *path, bool srgb)
TextureHandle CreateColorAttachmentTexture(int width, int height)
static const TextureHandle kDefaultNormalMap
static const MaterialHandle kDefaultLitWithTransparency
RenderTargetHandle CreateRenderTarget(TextureHandle color, TextureHandle depth)
static const MaterialInstanceHandle kColorMapMaterial
void ReuseVertexBuffer(VertexBufferHandle vb)
std::weak_ptr< filament::VertexBuffer > GetVertexBuffer(const VertexBufferHandle &id)
static const MaterialHandle kDefaultUnlitWithTransparency
std::weak_ptr< filament::MaterialInstance > GetMaterialInstance(const MaterialInstanceHandle &id)
SkyboxHandle CreateSkybox(const ResourceLoadRequest &request)
MaterialInstanceHandle CreateMaterialInstance(const MaterialHandle &id)
static const MaterialInstanceHandle kDepthMaterial
TextureHandle CreateDepthAttachmentTexture(int width, int height)
FilamentResourceManager(filament::Engine &engine)
IndirectLightHandle CreateIndirectLight(const ResourceLoadRequest &request)
~FilamentResourceManager()
static const MaterialHandle kDefaultLineShader
static const MaterialHandle kDefaultUnlit
MaterialHandle CreateMaterial(const void *material_data, size_t data_size)
static const MaterialHandle kDefaultUnlitBackgroundShader
static const MaterialHandle kDefaultUnlitGradientShader
static const MaterialHandle kDefaultDepthShader
VertexBufferHandle AddVertexBuffer(filament::VertexBuffer *vertex_buffer)
static const TextureHandle kDefaultTexture
static const MaterialHandle kDefaultNormalShader
static const std::string path
Generic file read and write utility for python interface.
std::shared_ptr< ResourceType > operator->()
std::shared_ptr< ResourceType > ptr
BoxedResource(std::shared_ptr< ResourceType > p)