scimesh 0.3.4
Headless CPU-only 3D software renderer for scientific mesh visualization
Loading...
Searching...
No Matches
renderer.h
Go to the documentation of this file.
1
6
7#pragma once
8
9#include <scimesh/mesh.h>
10#include <scimesh/scene.h>
11#include <scimesh/camera.h>
13#include <scimesh/image.h>
14
15namespace scimesh {
16
73class Renderer {
74public:
83 Image render_mesh(const Mesh &mesh, const Camera &camera, const RenderOptions &options);
84
107
121 Image render_triangles_raw(const std::vector<Vec3> &positions,
122 const std::vector<Color> &colors,
123 const Camera &camera,
124 const RenderOptions &options);
125
149 Image render_points_raw(const std::vector<Vec3> &positions,
150 const std::vector<Color> &colors,
151 float radius,
152 const Camera &camera,
153 const RenderOptions &options);
154
184 Image render_lines_raw(const std::vector<Vec3> &from,
185 const std::vector<Vec3> &to,
186 const std::vector<Color> &colors,
187 float width,
188 const Camera &camera,
189 const RenderOptions &options);
190
191private:
199 void render_pipeline(const std::vector<SceneNodeRef> &nodes,
200 const std::vector<LineNodeRef> &line_nodes,
201 const std::vector<TextNodeRef> &text_nodes,
202 const Camera &camera,
203 const RenderOptions &options,
204 Image &output);
205};
206
207} // namespace scimesh
Camera definition and helper functions for view setup.
The main rendering engine.
Definition renderer.h:73
Image render_mesh(const Mesh &mesh, const Camera &camera, const RenderOptions &options)
Render a single mesh to an image.
Definition renderer.cpp:114
Image render_lines_raw(const std::vector< Vec3 > &from, const std::vector< Vec3 > &to, const std::vector< Color > &colors, float width, const Camera &camera, const RenderOptions &options)
Render line segments with a screen-space width to an image.
Definition renderer.cpp:236
Image render_scene(const Scene &scene, const Camera &camera, const RenderOptions &options)
Render a scene (collection of meshes) to an image.
Definition renderer.cpp:126
Image render_points_raw(const std::vector< Vec3 > &positions, const std::vector< Color > &colors, float radius, const Camera &camera, const RenderOptions &options)
Render a point cloud (spheres at each position) to an image.
Definition renderer.cpp:160
Image render_triangles_raw(const std::vector< Vec3 > &positions, const std::vector< Color > &colors, const Camera &camera, const RenderOptions &options)
Render raw triangles (no Mesh wrapper) to an image.
Definition renderer.cpp:137
The Image — an RGBA pixel buffer with compositing and I/O operations.
The Mesh — the central data structure for 3D geometry in scimesh.
RenderOptions — all settings that control how meshes are drawn.
float width
Definition renderer.cpp:36
The Scene — a collection of meshes rendered together.
A virtual camera that defines the viewpoint for rendering.
Definition camera.h:77
A 2D RGBA image buffer.
Definition image.h:92
A 3D triangle mesh using an indexed face set representation.
Definition mesh.h:76
All settings that control rendering output.
A collection of Mesh objects to be rendered together.
Definition scene.h:69
int x
Left edge of the bitmap, in image pixels.
Definition text.cpp:223