scimesh 0.3.4
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
108 bool backface_culling = true;
109
113 bool invert_normals = false;
114
116
119
125
131
133
136
141 bool wireframe = false;
142
144 Color wireframe_color = Color(0.0f, 0.0f, 0.0f, 1.0f);
145
147
150
157 int aa_samples = 1;
158
160
163
167 Color specular_color = Color(0.0f, 0.0f, 0.0f, 0.0f);
168
173 float shininess = 0.0f;
174
176
179
184
186
189
194 std::vector<Light> lights;
195
201 float ambient = 0.3f;
202
204
207
211 float contrast = 1.0f;
212
214
217
237 std::vector<ClipPlane> clip_planes;
238
240
243
248 bool fog_enabled = false;
249
257 float fog_start = 0.0f;
258
264 float fog_end = 1.0f;
265
268
292
294
297
302 int threads = 0;
303
305
308
312 bool ssao_enabled = false;
313
315 float ssao_radius = 16.0f;
316
320 float ssao_intensity = 0.8f;
321
323
326
331 float near_plane = 0.1f;
332
337 float far_plane = 10000.0f;
338
340};
341
342} // 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.
FogSpace
Coordinate space (and hence the unit) of the fog distances RenderOptions::fog_start and RenderOptions...
Definition types.h:297
@ WORLD
World units: distance from the camera, measured along the camera's viewing direction.
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 (default: 0).
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).
FogSpace fog_space
The space and unit in which fog_start / fog_end are given.
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 (default: 1).
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.