168 void clear(
float clear_depth = 1.0f);
201 bool backface_culling,
203 const Vec3 &light_direction,
205 const Color &wireframe_color,
221 float radius,
const Color &color,
222 const Vec3 &normal,
const Vec3 &light_direction,
244 void shade_and_write(
int x,
int y,
float depth,
246 const Vec3 &light_direction,
Image &output);
The Image — an RGBA pixel buffer with compositing and I/O operations.
glm::vec2 Vec2
2-component floating-point vector (xy).
glm::vec3 Vec3
3-component floating-point vector (xyz).
constexpr Color TRANSPARENT_BLACK
A fully transparent black color (0, 0, 0, 0).
An RGBA color with floating-point components.
Low-level triangle rasterizer with depth buffering and lighting.
float ssao_radius
SSAO sample radius in pixels (default: 16).
void clear(float clear_depth=1.0f)
Clear the depth and normal buffers.
void rasterize_point(float screen_x, float screen_y, float depth, float radius, const Color &color, const Vec3 &normal, const Vec3 &light_direction, Image &output)
Rasterize a single point (filled circle) into the output image.
float fog_end
Distance where fog is fully opaque.
Color fog_color
The fog color (what distant objects blend into).
bool fog_enabled
Enable depth fog (default: false).
float fog_start
Distance where fog begins.
void apply_ssao(Image &output, float z_near, float z_far)
Apply screen-space ambient occlusion to the output image.
int height
Output image height in pixels.
Image * active_texture
Optional texture image for textured meshes.
float ssao_intensity
SSAO darkening intensity (0.0–1.0, default: 0.8).
float ambient
Ambient light level (0.0–1.0, default: 0.3).
int width
Output image width in pixels.
void set_blend_mode(bool enabled)
Enable or disable alpha blending.
Color specular_color
Specular highlight color.
std::vector< Light > lights
Light sources for Blinn-Phong shading.
float shininess
Shininess exponent (Phong model).
void rasterize_triangle(const Vec3 &screen_v0, const Color &color0, const Vec3 &normal0, const Vec2 &uv0, const Vec3 &screen_v1, const Color &color1, const Vec3 &normal1, const Vec2 &uv1, const Vec3 &screen_v2, const Color &color2, const Vec3 &normal2, const Vec2 &uv2, bool backface_culling, bool smooth_shading, const Vec3 &light_direction, bool wireframe, const Color &wireframe_color, Image &output)
Rasterize a single triangle into the output image.
bool ssao_enabled
Enable SSAO (default: false).
std::vector< float > z_buffer
Z-buffer (depth buffer), one float per pixel.
bool blend_mode
Enable alpha blending for transparent triangles (default: false).
float contrast
Contrast adjustment (1.0 = no change).
std::vector< Vec3 > normal_buffer
Normal buffer, one Vec3 per pixel.
Fundamental types used throughout the scimesh rendering engine.