scimesh 0.3.2
Headless CPU-only 3D software renderer for scientific mesh visualization
Loading...
Searching...
No Matches
render_options.h
Go to the documentation of this file.
1
7
8#pragma once
9
10#include <scimesh/types.h>
11#include <scimesh/camera.h>
12
13namespace scimesh {
14
15// ---------------------------------------------------------------------------
16// ShadingMode
17// ---------------------------------------------------------------------------
18
22enum class ShadingMode {
28 SMOOTH,
29
35 FLAT
36};
37
38// ---------------------------------------------------------------------------
39// RenderOptions
40// ---------------------------------------------------------------------------
41
77
79 int width = 800;
80
82 int height = 600;
83
85
88
96
102 bool backface_culling = true;
103
107 bool invert_normals = false;
108
110
113
119
125
127
130
135 bool wireframe = false;
136
138 Color wireframe_color = Color(0.0f, 0.0f, 0.0f, 1.0f);
139
141
144
151 int aa_samples = 1;
152
154
157
161 Color specular_color = Color(0.0f, 0.0f, 0.0f, 0.0f);
162
167 float shininess = 0.0f;
168
170
173
178
180
183
188 std::vector<Light> lights;
189
195 float ambient = 0.3f;
196
198
201
205 float contrast = 1.0f;
206
208
211
216 std::vector<ClipPlane> clip_planes;
217
219
222
227 bool fog_enabled = false;
228
230 float fog_start = 0.0f;
231
233 float fog_end = 1.0f;
234
237
239
242
247 int threads = 0;
248
250
253
257 bool ssao_enabled = false;
258
260 float ssao_radius = 16.0f;
261
265 float ssao_intensity = 0.8f;
266
268
271
276 float near_plane = 0.1f;
277
282 float far_plane = 10000.0f;
283
285};
286
287} // namespace scimesh
Camera definition and helper functions for view setup.
constexpr Color DEFAULT_COLOR
The default mesh color: a neutral light gray (0.7, 0.7, 0.7).
Definition types.h:144
constexpr Color WHITE
An opaque white color (1, 1, 1, 1).
Definition types.h:156
ShadingMode
How surface normals are interpolated across triangles.
@ SMOOTH
Smooth (Gouraud) shading: normals are interpolated across each triangle, producing a smooth,...
@ FLAT
Flat shading: each triangle uses a single normal, giving a faceted, low-poly look.
ProjectionType
The type of 3D→2D projection used by the camera.
Definition camera.h:23
@ PERSPECTIVE
Perspective projection: objects farther away appear smaller.
constexpr Color TRANSPARENT_BLACK
A fully transparent black color (0, 0, 0, 0).
Definition types.h:150
An RGBA color with floating-point components.
Definition types.h:88
All settings that control rendering output.
std::vector< Light > lights
List of light sources.
bool fog_enabled
Enable depth fog (default: false).
Color background_color
Background color (default: opaque white).
float ambient
Ambient light level (default: 0.3).
float fog_start
Distance at which fog begins (in world units).
float shininess
Shininess exponent (default: 0.0 = no specular).
float contrast
Contrast adjustment (default: 1.0 = no change).
int height
Image height in pixels (default: 600).
Color wireframe_color
Color of the wireframe lines (default: black).
int width
Image width in pixels (default: 800).
float ssao_intensity
SSAO darkening intensity (default: 0.8).
std::vector< ClipPlane > clip_planes
Optional clip planes for cross-section views.
Color default_color
Default color for meshes without explicit vertex/face colors.
float far_plane
Far clipping plane distance (default: 10000.0).
bool backface_culling
Enable backface culling (default: true).
Color specular_color
Specular highlight color (default: transparent = no specular).
bool ssao_enabled
Enable SSAO (default: false).
int threads
Number of render threads (default: 0 = auto-detect).
int aa_samples
Anti-aliasing sample count (default: 1 = no AA).
bool wireframe
Draw triangle edges as lines (default: false).
float ssao_radius
SSAO sample radius in pixels (default: 16).
ShadingMode shading
Shading mode (default: SMOOTH).
float near_plane
Near clipping plane distance (default: 0.1).
float fog_end
Distance at which fog is fully opaque (in world units).
ProjectionType projection
Projection type (default: PERSPECTIVE).
Color fog_color
The color that distant objects fade into.
bool invert_normals
Flip all surface normals (default: false).
Fundamental types used throughout the scimesh rendering engine.