Open3D (C++ API)  0.18.0+252c867
FilamentEntitiesMods.h
Go to the documentation of this file.
1 // ----------------------------------------------------------------------------
2 // - Open3D: www.open3d.org -
3 // ----------------------------------------------------------------------------
4 // Copyright (c) 2018-2023 www.open3d.org
5 // SPDX-License-Identifier: MIT
6 // ----------------------------------------------------------------------------
7 
8 #pragma once
9 
10 #include <memory>
11 
13 
15 namespace filament {
16 class MaterialInstance;
17 class TextureSampler;
18 } // namespace filament
20 
21 namespace open3d {
22 namespace visualization {
23 namespace rendering {
24 
26 public:
27  static filament::TextureSampler SamplerFromSamplerParameters(
28  const TextureSamplerParameters& sampler_config);
29 
30  FilamentMaterialModifier(const std::shared_ptr<filament::MaterialInstance>&
31  material_instance,
32  const MaterialInstanceHandle& id);
34 
35  void Reset();
36  void
37  Init(const std::shared_ptr<filament::MaterialInstance>& material_instance,
38  const MaterialInstanceHandle& id);
39 
40  MaterialModifier& SetParameter(const char* parameter, int value) override;
41  MaterialModifier& SetParameter(const char* parameter, float value) override;
42  MaterialModifier& SetParameter(const char* parameter,
43  const Eigen::Vector3f& value) override;
44  MaterialModifier& SetColor(const char* parameter,
45  const Eigen::Vector3f& value,
46  bool srgb) override;
47  MaterialModifier& SetColor(const char* parameter,
48  const Eigen::Vector4f& value,
49  bool srgb) override;
50 
52  const char* parameter,
53  const TextureHandle& texture,
54  const TextureSamplerParameters& sampler) override;
55 
56  MaterialModifier& SetDoubleSided(bool double_sided) override;
57 
58  MaterialInstanceHandle Finish() override;
59 
60 private:
61  MaterialInstanceHandle current_handle_;
62  std::shared_ptr<filament::MaterialInstance> material_instance_;
63 };
64 
65 } // namespace rendering
66 } // namespace visualization
67 } // namespace open3d
MaterialModifier & SetColor(const char *parameter, const Eigen::Vector3f &value, bool srgb) override
Definition: FilamentEntitiesMods.cpp:154
static filament::TextureSampler SamplerFromSamplerParameters(const TextureSamplerParameters &sampler_config)
Definition: FilamentEntitiesMods.cpp:51
MaterialModifier & SetDoubleSided(bool double_sided) override
Definition: FilamentEntitiesMods.cpp:203
void Init(const std::shared_ptr< filament::MaterialInstance > &material_instance, const MaterialInstanceHandle &id)
Definition: FilamentEntitiesMods.cpp:114
MaterialInstanceHandle Finish() override
Definition: FilamentEntitiesMods.cpp:210
void Reset()
Definition: FilamentEntitiesMods.cpp:104
MaterialModifier & SetParameter(const char *parameter, int value) override
Definition: FilamentEntitiesMods.cpp:126
MaterialModifier & SetTexture(const char *parameter, const TextureHandle &texture, const TextureSamplerParameters &sampler) override
Definition: FilamentEntitiesMods.cpp:180
Definition: MaterialModifier.h:107
Definition: FilamentEngine.h:12
Definition: PinholeCameraIntrinsic.cpp:16