Open3D (C++ API)  0.19.0
Loading...
Searching...
No Matches
MaterialRecord.h
Go to the documentation of this file.
1// ----------------------------------------------------------------------------
2// - Open3D: www.open3d.org -
3// ----------------------------------------------------------------------------
4// Copyright (c) 2018-2024 www.open3d.org
5// SPDX-License-Identifier: MIT
6// ----------------------------------------------------------------------------
7
8#pragma once
9
10#include <Eigen/Core>
11#include <string>
12#include <unordered_map>
13
17
18namespace open3d {
19namespace visualization {
20namespace rendering {
21
23 std::string name;
24
25 // Rendering attributes
26 bool has_alpha = false;
27
28 // PBR Material properties and maps
29 Eigen::Vector4f base_color = Eigen::Vector4f(1.f, 1.f, 1.f, 1.f);
30 float base_metallic = 0.f;
31 float base_roughness = 1.f;
32 float base_reflectance = 0.5f;
33 float base_clearcoat = 0.f;
35 float base_anisotropy = 0.f;
36 Eigen::Vector4f emissive_color = Eigen::Vector4f(0.f, 0.f, 0.f, 1.f);
37
38 // PBR material properties for refractive materials
39 float thickness = 1.f;
40 float transmission = 1.f;
41 Eigen::Vector3f absorption_color =
42 Eigen::Vector3f(1.f, 1.f, 1.f); // linear color
44
45 float point_size = 3.f;
46 float line_width = 1.f; // only used with shader = "unlitLine"
47
48 std::shared_ptr<geometry::Image> albedo_img;
49 std::shared_ptr<geometry::Image> normal_img;
50 std::shared_ptr<geometry::Image> ao_img;
51 std::shared_ptr<geometry::Image> metallic_img;
52 std::shared_ptr<geometry::Image> roughness_img;
53 std::shared_ptr<geometry::Image> reflectance_img;
54 std::shared_ptr<geometry::Image> clearcoat_img;
55 std::shared_ptr<geometry::Image> clearcoat_roughness_img;
56 std::shared_ptr<geometry::Image> anisotropy_img;
57
58 // Combined images
59 std::shared_ptr<geometry::Image> ao_rough_metal_img;
60
61 // Colormap (incompatible with other settings except point_size)
62 // Values for 'value' must be in [0, 1] and the vector must be sorted
63 // by increasing value. 'shader' must be "unlitGradient".
64 std::shared_ptr<Gradient> gradient;
65 float scalar_min = 0.0f;
66 float scalar_max = 1.0f;
67
68 // Colors are assumed to be sRGB and tone-mapped accordingly.
69 // If tone-mapping is disabled, then colors would be in linear RGB space,
70 // in which case this should be set to false. If necessary, colors will be
71 // linearized on the CPU.
72 bool sRGB_color = false;
73
74 // Unlike the material property sRGB_color which is used to indicate that
75 // source colors are in sRGB colorspace, sRGB_vertex_color indicates that
76 // per-vertex colors are in sRGB space and should be passed to the GPU as
77 // sRGB color.
78 bool sRGB_vertex_color = false;
79
80 // Background image (shader = "unlitBackground")
81 float aspect_ratio = 0.0f; // 0: uses base_color; >0: uses albedo_img
82
83 // Infinite ground plane
84 float ground_plane_axis = 0.f; // 0: XZ; >0: XY; <0: YZ
85
86 // Max Spherical Harmonic degree for rendering gaussian splats.
88
89 // Minimum splat alpha value when rendering gaussian splats.
95 float gaussian_splat_min_alpha = 1.0f / 255.0f;
96
97 // Enable anti-aliasing density compensation for gaussian splats.
98 // Multiplies each splat's opacity by sqrt(det(Sigma) / det(Sigma_blurred))
99 // to counteract the over-brightening caused by the fixed +0.3 blur kernel.
101
102 // Hard per-splat cap on the number of screen tiles a single splat may
103 // cover; splats whose footprint would exceed this are culled (dropped)
104 // entirely rather than rendered from a smaller tile rectangle, which
105 // would otherwise show up as a hard-edged, wrongly-opaque block. Raise
106 // for very large / close-up splats. Decoupled from GPU memory use: only
107 // `gaussian_splat_avg_tiles_per_splat` below affects buffer sizing.
109
110 // Expected mean tiles-per-splat across the scene, used only to size the
111 // shared tile-entry buffers (a statistical estimate, not an enforced
112 // limit). Raise for scenes with many large/overlapping splats at the
113 // cost of higher GPU memory use; unlike max_tiles_per_splat above, this
114 // does not clip individual splats.
116
117 // Total tile-coverage entry budget for the whole scene.
118 // Raise this for dense or high-resolution scenes at the cost of GPU memory.
119 uint32_t gaussian_splat_max_tile_entries_total = 32u * 1024u * 1024u;
120
121 // Generic material properties
122 std::unordered_map<std::string, Eigen::Vector4f> generic_params;
123 std::unordered_map<std::string, geometry::Image> generic_imgs;
124
125 std::string shader = "defaultUnlit";
126};
127
128} // namespace rendering
129} // namespace visualization
130} // namespace open3d
Definition PinholeCameraIntrinsic.cpp:16
uint32_t gaussian_splat_max_tiles_per_splat
Definition MaterialRecord.h:108
float base_anisotropy
Definition MaterialRecord.h:35
Eigen::Vector3f absorption_color
Definition MaterialRecord.h:41
std::shared_ptr< geometry::Image > ao_img
Definition MaterialRecord.h:50
bool has_alpha
Definition MaterialRecord.h:26
std::shared_ptr< geometry::Image > metallic_img
Definition MaterialRecord.h:51
std::shared_ptr< geometry::Image > albedo_img
Definition MaterialRecord.h:48
float transmission
Definition MaterialRecord.h:40
uint32_t gaussian_splat_max_tile_entries_total
Definition MaterialRecord.h:119
float scalar_max
Definition MaterialRecord.h:66
std::shared_ptr< geometry::Image > ao_rough_metal_img
Definition MaterialRecord.h:59
int gaussian_splat_sh_degree
Definition MaterialRecord.h:87
Eigen::Vector4f base_color
Definition MaterialRecord.h:29
std::string name
Definition MaterialRecord.h:23
std::shared_ptr< Gradient > gradient
Definition MaterialRecord.h:64
std::shared_ptr< geometry::Image > reflectance_img
Definition MaterialRecord.h:53
bool sRGB_color
Definition MaterialRecord.h:72
std::shared_ptr< geometry::Image > roughness_img
Definition MaterialRecord.h:52
std::unordered_map< std::string, Eigen::Vector4f > generic_params
Definition MaterialRecord.h:122
float line_width
Definition MaterialRecord.h:46
std::shared_ptr< geometry::Image > clearcoat_roughness_img
Definition MaterialRecord.h:55
std::shared_ptr< geometry::Image > anisotropy_img
Definition MaterialRecord.h:56
float aspect_ratio
Definition MaterialRecord.h:81
float absorption_distance
Definition MaterialRecord.h:43
float thickness
Definition MaterialRecord.h:39
float base_metallic
Definition MaterialRecord.h:30
float ground_plane_axis
Definition MaterialRecord.h:84
float point_size
Definition MaterialRecord.h:45
float base_reflectance
Definition MaterialRecord.h:32
float base_clearcoat
Definition MaterialRecord.h:33
bool sRGB_vertex_color
Definition MaterialRecord.h:78
std::unordered_map< std::string, geometry::Image > generic_imgs
Definition MaterialRecord.h:123
float scalar_min
Definition MaterialRecord.h:65
float base_clearcoat_roughness
Definition MaterialRecord.h:34
std::shared_ptr< geometry::Image > clearcoat_img
Definition MaterialRecord.h:54
Eigen::Vector4f emissive_color
Definition MaterialRecord.h:36
uint32_t gaussian_splat_avg_tiles_per_splat
Definition MaterialRecord.h:115
float base_roughness
Definition MaterialRecord.h:31
std::string shader
Definition MaterialRecord.h:125
float gaussian_splat_min_alpha
Definition MaterialRecord.h:95
std::shared_ptr< geometry::Image > normal_img
Definition MaterialRecord.h:49
bool gaussian_splat_antialias
Definition MaterialRecord.h:100