Blue Brain BioExplorer
Properties.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2015-2024, EPFL/Blue Brain Project
3  *
4  * The Blue Brain BioExplorer is a tool for scientists to extract and analyse
5  * scientific data from visualization
6  *
7  * This file is part of Blue Brain BioExplorer <https://github.com/BlueBrain/BioExplorer>
8  *
9  * This library is free software; you can redistribute it and/or modify it under
10  * the terms of the GNU Lesser General Public License version 3.0 as published
11  * by the Free Software Foundation.
12  *
13  * This library is distributed in the hope that it will be useful, but WITHOUT
14  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
15  * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
16  * details.
17  *
18  * You should have received a copy of the GNU Lesser General Public License
19  * along with this library; if not, write to the Free Software Foundation, Inc.,
20  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21  */
22 
23 #pragma once
24 
26 
27 namespace core
28 {
29 /*
30 Camera properties
31 */
32 static const char* CAMERA_PROPERTY_TYPE_PERSPECTIVE = "perspective";
33 static const char* CAMERA_PROPERTY_TYPE_ORTHOGRAPHIC = "orthographic";
34 static const char* CAMERA_PROPERTY_TYPE_ANAGLYPH = "anaglyph";
35 
36 static const char* CAMERA_PROPERTY_POSITION = "pos";
37 static const char* CAMERA_PROPERTY_DIRECTION = "dir";
38 static const char* CAMERA_PROPERTY_UP_VECTOR = "up";
39 static const char* CAMERA_PROPERTY_FOCUS_DISTANCE = "focalDistance";
40 static const char* CAMERA_PROPERTY_CLIPPING_PLANES = "clipPlanes";
41 static const char* CAMERA_PROPERTY_BUFFER_TARGET = "buffer_target";
42 static const char* CAMERA_PROPERTY_ENVIRONMENT_MAP = "environmentMap";
43 
44 static constexpr double DEFAULT_CAMERA_INTERPUPILLARY_DISTANCE = 0.0635;
45 static constexpr double DEFAULT_CAMERA_FIELD_OF_VIEW = 60.0;
46 static constexpr double DEFAULT_CAMERA_ASPECT_RATIO = 1.0;
47 static constexpr double DEFAULT_CAMERA_HEIGHT = 1.0;
48 static constexpr double DEFAULT_CAMERA_APERTURE_RADIUS = 0.0;
49 static constexpr double DEFAULT_CAMERA_FOCAL_DISTANCE = 1.0;
50 static constexpr double DEFAULT_CAMERA_STEREO = false;
51 static constexpr double DEFAULT_CAMERA_NEAR_CLIP = 0.0;
52 static constexpr bool DEFAULT_CAMERA_ENABLE_CLIPPING_PLANES = true;
53 
54 static const Property CAMERA_PROPERTY_FIELD_OF_VIEW = {"fovy", DEFAULT_CAMERA_FIELD_OF_VIEW, {"Field of view"}};
55 static const Property CAMERA_PROPERTY_APERTURE_RADIUS = {"apertureRadius",
56  DEFAULT_CAMERA_APERTURE_RADIUS,
57  {"Aperture radius"}};
58 static const Property CAMERA_PROPERTY_FOCAL_DISTANCE = {"focalDistance",
59  DEFAULT_CAMERA_FOCAL_DISTANCE,
60  {"Focal Distance"}};
61 static const Property CAMERA_PROPERTY_ASPECT_RATIO = {"aspect", DEFAULT_CAMERA_ASPECT_RATIO, {"Aspect ratio"}};
62 static const Property CAMERA_PROPERTY_HEIGHT = {"height", DEFAULT_CAMERA_HEIGHT, {"Height"}};
63 static const Property CAMERA_PROPERTY_STEREO = {"stereo", DEFAULT_CAMERA_STEREO, {"Stereoscopy"}};
64 static const Property CAMERA_PROPERTY_INTERPUPILLARY_DISTANCE = {"interpupillaryDistance",
65  DEFAULT_CAMERA_INTERPUPILLARY_DISTANCE,
66  {"Interpupillary distance"}};
67 static const Property CAMERA_PROPERTY_NEAR_CLIP = {"nearClip", DEFAULT_CAMERA_NEAR_CLIP, 0., 1e6, {"Near clip"}};
68 static const Property CAMERA_PROPERTY_ENABLE_CLIPPING_PLANES = {"enableClippingPlanes",
69  DEFAULT_CAMERA_ENABLE_CLIPPING_PLANES,
70  {"Enable clipping planes"}};
71 
72 /*
73 Renderer properties
74 */
75 static const char* RENDERER_PROPERTY_TYPE_BASIC = "basic";
76 static const char* RENDERER_PROPERTY_TYPE_ADVANCED = "advanced";
77 
78 static const char* RENDERER_PROPERTY_USER_DATA = "userDataBuffer";
79 static const char* RENDERER_PROPERTY_SECONDARY_MODEL = "secondaryModel";
80 static const char* RENDERER_PROPERTY_BACKGROUND_MATERIAL = "bgMaterial";
81 static const char* RENDERER_PROPERTY_LIGHTS = "lights";
82 static const char* RENDERER_PROPERTY_RANDOM_NUMBER = "randomNumber";
83 
84 static constexpr bool DEFAULT_RENDERER_FAST_PREVIEW = false;
85 static constexpr bool DEFAULT_RENDERER_SHOW_BACKGROUND = true;
86 static constexpr int DEFAULT_RENDERER_RAY_DEPTH = 3;
87 static constexpr int DEFAULT_RENDERER_MAX_RAY_DEPTH = 30;
88 static constexpr double DEFAULT_RENDERER_SHADOW_INTENSITY = 0.0;
89 static constexpr double DEFAULT_RENDERER_SOFT_SHADOW_STRENGTH = 0.0;
90 static constexpr int DEFAULT_RENDERER_SHADOW_SAMPLES = 1;
91 static constexpr double DEFAULT_RENDERER_EPSILON_MULTIPLIER = 1.0;
92 static constexpr double DEFAULT_RENDERER_FOG_START = 1.0;
93 static constexpr double DEFAULT_RENDERER_FOG_THICKNESS = 1e6;
94 static constexpr double DEFAULT_RENDERER_GLOBAL_ILLUMINATION_STRENGTH = 0.0;
95 static constexpr double DEFAULT_RENDERER_GLOBAL_ILLUMINATION_RAY_LENGTH = 1e6;
96 static constexpr int DEFAULT_RENDERER_GLOBAL_ILLUMINATION_SAMPLES = 0;
97 static constexpr bool DEFAULT_RENDERER_MATRIX_FILTER = false;
98 static constexpr double DEFAULT_RENDERER_ALPHA_CORRECTION = 1.0;
99 static constexpr double DEFAULT_RENDERER_MAX_DISTANCE_TO_SECONDARY_MODEL = 30.0;
100 static constexpr double DEFAULT_RENDERER_TIMESTAMP = 0.0;
101 
102 static const Property RENDERER_PROPERTY_TIMESTAMP = {"timestamp", 0.0, 0.0, 1e6, {"Timestamp"}};
103 static const Property RENDERER_PROPERTY_SHOW_BACKGROUND = {"showBackground", true, {"Show background"}};
104 static const Property RENDERER_PROPERTY_MAX_RAY_DEPTH = {
105  "maxRayDepth", DEFAULT_RENDERER_RAY_DEPTH, 1, DEFAULT_RENDERER_MAX_RAY_DEPTH, {"Maximum ray depth"}};
106 static const Property RENDERER_PROPERTY_SHADOW_INTENSITY = {
107  "shadowIntensity", DEFAULT_RENDERER_SHADOW_INTENSITY, 0.0, 1.0, {"Shadow intensity"}};
108 static const Property RENDERER_PROPERTY_SOFT_SHADOW_STRENGTH = {
109  "softShadowStrength", DEFAULT_RENDERER_SOFT_SHADOW_STRENGTH, 0.0, 1.0, {"Shadow softness"}};
110 static const Property RENDERER_PROPERTY_SHADOW_SAMPLES = {
111  "shadowSamples", DEFAULT_RENDERER_SHADOW_SAMPLES, 1, 64, {"Shadow samples"}};
112 static const Property RENDERER_PROPERTY_EPSILON_MULTIPLIER = {
113  "epsilonMultiplier", 1.0, 1.0, 1000.0, {"Epsilon multiplier"}};
114 static const Property RENDERER_PROPERTY_FOG_START = {"fogStart", DEFAULT_RENDERER_FOG_START, 0., 1e6, {"Fog start"}};
115 static const Property RENDERER_PROPERTY_FOG_THICKNESS = {
116  "fogThickness", DEFAULT_RENDERER_FOG_THICKNESS, 0.0, 1e6, {"Fog thickness"}};
117 static const Property RENDERER_PROPERTY_GLOBAL_ILLUMINATION_STRENGTH = {
118  "giStrength", DEFAULT_RENDERER_GLOBAL_ILLUMINATION_STRENGTH, 0.0, 1.0, {"Global illumination strength"}};
119 static const Property RENDERER_PROPERTY_GLOBAL_ILLUMINATION_RAY_LENGTH = {
120  "giRayLength", DEFAULT_RENDERER_GLOBAL_ILLUMINATION_RAY_LENGTH, 0.0, 1e6, {"Global illumination ray length"}};
121 static const Property RENDERER_PROPERTY_GLOBAL_ILLUMINATION_SAMPLES = {
122  "giSamples", DEFAULT_RENDERER_GLOBAL_ILLUMINATION_SAMPLES, 0, 64, {"Global illumination samples"}};
123 static const Property RENDERER_PROPERTY_MATRIX_FILTER = {"matrixFilter",
124  DEFAULT_RENDERER_MATRIX_FILTER,
125  {"Feels like being in the Matrix"}};
126 static const Property RENDERER_PROPERTY_ALPHA_CORRECTION = {
127  "alphaCorrection", DEFAULT_RENDERER_ALPHA_CORRECTION, 0.001, 1., {"Alpha correction"}};
128 static const Property RENDERER_PROPERTY_MAX_DISTANCE_TO_SECONDARY_MODEL = {
129  "maxDistanceToSecondaryModel",
130  DEFAULT_RENDERER_MAX_DISTANCE_TO_SECONDARY_MODEL,
131  0.1,
132  100.0,
133  {"Maximum distance to secondary model"}};
134 static const Property RENDERER_PROPERTY_FAST_PREVIEW = {"fastPreview", DEFAULT_RENDERER_FAST_PREVIEW, {"Fast preview"}};
135 
136 /*
137 Material properties
138 */
139 static const char* MATERIAL_PROPERTY_OPACITY = "d";
140 static const char* MATERIAL_PROPERTY_MAP_OPACITY = "map_d";
141 static const char* MATERIAL_PROPERTY_DIFFUSE_COLOR = "kd";
142 static const char* MATERIAL_PROPERTY_MAP_DIFFUSE_COLOR = "map_kd";
143 static const char* MATERIAL_PROPERTY_SPECULAR_COLOR = "ks";
144 static const char* MATERIAL_PROPERTY_MAP_SPECULAR_COLOR = "map_ks";
145 static const char* MATERIAL_PROPERTY_SPECULAR_INDEX = "ns";
146 static const char* MATERIAL_PROPERTY_MAP_SPECULAR_INDEX = "map_ns";
147 static const char* MATERIAL_PROPERTY_MAP_BUMP = "map_bump";
148 static const char* MATERIAL_PROPERTY_REFRACTION = "refraction";
149 static const char* MATERIAL_PROPERTY_MAP_REFRACTION = "map_refraction";
150 static const char* MATERIAL_PROPERTY_REFLECTION = "kr";
151 static const char* MATERIAL_PROPERTY_MAP_REFLECTION = "map_kr";
152 static const char* MATERIAL_PROPERTY_EMISSION = "a";
153 static const char* MATERIAL_PROPERTY_MAP_EMISSION = "map_a";
154 static const char* MATERIAL_PROPERTY_SHADING_MODE = "shading_mode";
155 static const char* MATERIAL_PROPERTY_USER_PARAMETER = "user_parameter";
156 static const char* MATERIAL_PROPERTY_GLOSSINESS = "glossiness";
157 static const char* MATERIAL_PROPERTY_CAST_USER_DATA = "cast_user_data";
158 static const char* MATERIAL_PROPERTY_CLIPPING_MODE = "clipping_mode";
159 static const char* MATERIAL_PROPERTY_CHAMELEON_MODE = "chameleon_mode";
160 static const char* MATERIAL_PROPERTY_NODE_ID = "node_id";
161 
162 /*
163 Common properties
164 */
165 static const char* DEFAULT = "default";
166 
167 static const char* DEFAULT_COMMON_TRANSFER_FUNCTION = "transferFunction";
168 static constexpr double DEFAULT_COMMON_EXPOSURE = 1.0;
169 static constexpr bool DEFAULT_COMMON_USE_HARDWARE_RANDOMIZER = false;
170 
171 static const Property COMMON_PROPERTY_EXPOSURE = {"mainExposure", DEFAULT_COMMON_EXPOSURE, 1., 20., {"Exposure"}};
172 static const Property COMMON_PROPERTY_USE_HARDWARE_RANDOMIZER = {"useHardwareRandomizer",
173  DEFAULT_COMMON_USE_HARDWARE_RANDOMIZER,
174  {"Use hardware randomizer"}};
175 
176 } // namespace core