Correlation 4.10.0
An Analysis Tool for Liquids and for Amorphous Solids
Loading...
Searching...
No Matches
SoftwareRasterizer.hpp
Go to the documentation of this file.
1
9
10#pragma once
11
12#include "render3d/Camera3D.hpp"
13#include "render3d/Scene3D.hpp"
15
16namespace correlation::render3d {
17
23 RgbaColor background_color{.r = 24, .g = 24, .b = 29, .a = 255};
24 math::Vector3<float> light_dir{0.35F, 0.55F, 0.75F};
25 float ambient{0.30F};
26 float diffuse{0.65F};
27 float specular{0.35F};
28 float shininess{24.0F};
29 bool render_atoms{true};
30 bool render_bonds{true};
31 bool render_wireframe{true};
32 bool depth_cueing{true};
33};
34
40public:
46
53 void render(const Scene3D &scene, const Camera3D &camera, SoftwareFramebuffer &framebuffer) const;
54
55 [[nodiscard]] const RasterizerOptions &options() const noexcept { return options_; }
57
58private:
60};
61
62} // namespace correlation::render3d
Orbit and arcball camera model for interactive 3D molecular visualization.
Scene graph and geometric instances (atoms, bonds, lattice lines) for 3D visualization.
Cache-aligned RGBA8 color buffer and 32-bit floating-point depth buffer.
A lightweight, constexpr, stack-based 3D vector.
Definition LinearAlgebra.hpp:32
Manages camera positioning, orbit rotations, panning, zooming, and view-projection matrices.
Definition Camera3D.hpp:29
Aggregates atomic coordinates, bonds, and unit cell wireframes for rendering.
Definition Scene3D.hpp:61
Manages RGBA8 color pixels and Z-buffer for software rasterization.
Definition SoftwareFramebuffer.hpp:24
RasterizerOptions options_
Definition SoftwareRasterizer.hpp:59
void setOptions(const RasterizerOptions &options) noexcept
Definition SoftwareRasterizer.hpp:56
const RasterizerOptions & options() const noexcept
Definition SoftwareRasterizer.hpp:55
SoftwareRasterizer(RasterizerOptions options=RasterizerOptions{}) noexcept
Constructs software rasterizer with default lighting options.
Definition SoftwareRasterizer.cpp:278
void render(const Scene3D &scene, const Camera3D &camera, SoftwareFramebuffer &framebuffer) const
Renders the 3D scene from the camera viewpoint into the framebuffer.
Definition SoftwareRasterizer.cpp:280
Definition Camera3D.hpp:14
Configuration parameters for software rasterizer lighting and shading.
Definition SoftwareRasterizer.hpp:22
float diffuse
Diffuse lighting factor.
Definition SoftwareRasterizer.hpp:26
math::Vector3< float > light_dir
Directional light vector.
Definition SoftwareRasterizer.hpp:24
bool depth_cueing
Flag for atmospheric depth fog.
Definition SoftwareRasterizer.hpp:32
RgbaColor background_color
Dark slate default.
Definition SoftwareRasterizer.hpp:23
float shininess
Specular exponent.
Definition SoftwareRasterizer.hpp:28
bool render_bonds
Flag to draw bonds.
Definition SoftwareRasterizer.hpp:30
float specular
Specular highlight factor.
Definition SoftwareRasterizer.hpp:27
bool render_atoms
Flag to draw atom spheres.
Definition SoftwareRasterizer.hpp:29
bool render_wireframe
Flag to draw simulation box.
Definition SoftwareRasterizer.hpp:31
float ambient
Ambient lighting factor.
Definition SoftwareRasterizer.hpp:25
8-bit RGBA color representation for vertex colors and framebuffers.
Definition ElementColors.hpp:23