RMGui 0.15.0
C11 retained-mode UI library: layout kernel, style schema, widget painters, fonts, software framebuffer
Loading...
Searching...
No Matches
rmgui_mesh_style_t Struct Reference

Cel light points toward the light in world space. More...

#include <mesh_paint.h>

Data Fields

float light [3]
float threshold [2]
float bands [3][3]
float rim_threshold
float rim_tint [3]
rmgui_color_t outline
int outline_width
int supersample
int start_orb

Detailed Description

Cel light points toward the light in world space.

Normalized interpolated normals select shadow for N.L < threshold[0], base below threshold[1], highlight otherwise. Each band's linear RGB is factor*band tint, clamped. Optional rim adds rim_tint when 1-|N.V| >= rim_threshold (0 disables rim). Outline width is 0..4 device pixels; supersample is 1, 2 or 4 per axis. start_orb is 0 for ordinary cel shading, 1 for radial rest or 2 for hovered. Radial shading replaces material RGBA with opaque bands and two hard white spots at linear intensity 0.78 (rest) or 1 (hover); no clouds are drawn. Thresholds are ordered within [-1,1], band/rim RGB is finite nonnegative, rim_threshold is in [0,1], and light is finite nonzero. Silhouette outlines expand N pixels outwards; internal depth/material/normal lines are N pixels total. The renderer uses binary32 operations, no fast-math; GPU comparisons allow 1 channel LSB away from edges/band boundaries. Linear->sRGB uses round(255*(12.92*x if x<=0.0031308 else 1.055*x^(1/2.4)-0.055)), halves up. Atlas RGB modulates linear material RGB after sRGB decoding; alpha is linear. Opaque primitives write depth, then blend primitives draw back-to-front by mean transformed indexed-vertex depth (triangle corners counted with multiplicity), stable node/primitive order on equal depths. Alpha-textured blend materials are decals: their borders do not seed internal outline edges, preserving thin atlas glyphs at small device sizes. Named BadgeDigitOnes/Tens textured blend quads use unlit white ink with a two-atlas-texel cross dilation of alpha; this deterministic contrast treatment preserves subpixel segments without changing shared atlas pixels or UVs. Blend primitives do not write depth. All internal lighting, blending and premultiplied box averaging use linear RGB; output is unpremultiplied and sRGB encoded once, then straight-alpha composited over encoded fb contents.

Field Documentation

◆ light

float rmgui_mesh_style_t::light[3]

◆ threshold

float rmgui_mesh_style_t::threshold[2]

◆ bands

float rmgui_mesh_style_t::bands[3][3]

◆ rim_threshold

float rmgui_mesh_style_t::rim_threshold

◆ rim_tint

float rmgui_mesh_style_t::rim_tint[3]

◆ outline

rmgui_color_t rmgui_mesh_style_t::outline

◆ outline_width

int rmgui_mesh_style_t::outline_width

◆ supersample

int rmgui_mesh_style_t::supersample

◆ start_orb

int rmgui_mesh_style_t::start_orb

The documentation for this struct was generated from the following file: