Repository navigation
Color Grading & Tonemapping
Ray-MMD ReForge processes the entire lighting and composite pipeline in High Dynamic Range (HDR) linear color space before applying tonemapping and color grading.
Configured via HDR_TONEMAP_OPERATOR in ray.conf:
| Operator ID | Name | Description | Best For |
|---|---|---|---|
| 8 (Default) | AgX Base (Blender 4.0) | Troy Sobotka's 6th-order polynomial S-curve (16.5 EV). Hue-preserving highlight roll-off. | General production, cinematic, high contrast. |
| 11 | GT7 (Gran Turismo 7) | Polyphony Digital (SIGGRAPH 2025) physically based curve calibrated to 250 nits paper white. | Photorealism, outdoor daylight, automotive shaders. |
| 12 | AgX Golden | Troy Sobotka's AgX with warm golden cinematography roll-off and rich tonality. | Sunset, golden hour, emotional and warm lighting. |
| 10 | PBR Neutral | Khronos Group (2024) standard preserving authored albedos and skin hues without shift. | Color-critical PBR inspection, catalog renders. |
| 9 | AgX Punchy | Blender 4.0 AgX Punchy look with elevated contrast and vibrancy. | Stylized animations, music videos, high-energy scenes. |
| 5 / 7 | ACES (sRGB / Fitted) | Film industry standard ACES RRT/ODT fit with high vibrancy. | Stylized, punchy projects. |
| 2 | Hable (Uncharted 2) | Filmic curve developed by John Hable for Naughty Dog. | Gritty realism, game cinematics. |
| 1 | Reinhard | Simple luminance-based hyperbolic compression. | Low-contrast soft looks. |
| 0 | Linear | Uncompressed raw linear color (requires external LUT). | Custom external color-grading workflows. |
Note
TPDF Triangular RGB Dithering (Gjøl 2016):
Post-tonemap quantizing utilizes Morten S. Mikkelsen's Triangular Probability Density Function (TPDF) noise (Shader/PostProcess/ColorGrading.fxsub). It eliminates 8-bit banding on gradients (skies, fog, smooth skin) without generating color-speckle or grainy chroma noise.
Reinhard (HDR_TONEMAP_OPERATOR 1) |
ACES (HDR_TONEMAP_OPERATOR 4 / 5) |
AgX (HDR_TONEMAP_OPERATOR 8 - Default) |
|---|---|---|
![]() |
![]() |
![]() |
*All previews rendered with Contrast+ elevated to ~50% on ray_controller. Notice how ACES suffers from severe hue-skewing (skin burning into yellow/orange), whereas AgX cleanly preserves authentic skin tones and cinematic dynamic range.
- Highlight Roll-off Without Hue-Skew: In older tonemappers (like ACES or Reinhard), pushing exposure or contrast causes bright skin to burn into harsh yellow/orange and skies into cyan. AgX gracefully desaturates intense highlights towards white while maintaining exact color hues.
-
Extreme Contrast Tolerance: You can push
Contrast+onray_controllerup to 50%+ without crushing shadow details or burning skin highlights.
| Morph Slider | Description |
|---|---|
Exposure+ / Exposure- |
Linear exposure compensation in EV stops. |
Contrast+ / Contrast- |
Filmic S-curve contrast adjustment. |
Saturation+ / Saturation- |
Color saturation scaling. |
Gamma+ / Gamma- |
Mid-tone gamma curve balance. |
Temperature+ / Temperature- |
White balance adjustment (warm sunset vs cool daylight). |
BalanceR/G/B (+/-) |
Individual color channel balance and tinting. |
BloomThreshold |
Minimum luminance required to trigger bloom glow. |
BloomRadius+ / BloomRadius- |
Spatial spread and size of the bloom halo. |
BloomColorAllV+ / BloomColorAllV- |
Total bloom brightness multiplier. |
BloomStarFade |
Fade intensity of anamorphic lens flare streaks. |
Vignette |
Optical lens corner darkening. |
Dispersion / DispersionRadius |
Fullscreen camera lens chromatic aberration. |
SSGI+ / SSGI- |
Screen-Space Global Illumination indirect radiance strength. |
SSAO+ / SSAO- |
Ambient occlusion shading density. |
SSSS+ / SSSS- |
Subsurface scattering blur profile scale. |
FocalLength / FocalDistance / Fstop |
Optical camera Depth of Field (DoF) bokeh controls. |
Ray-MMD ReForge includes a studio-grade linear HDR color grading engine (Shader/ColorGrading.fxsub) integrated directly into the pre-tonemap HDR composite pass. Controlled via the dedicated 60-morph ColorGradingController.pmx, it brings full professional grading suites to MMD without performance overhead.
Provides independent control over Shadows (Lift), Midtones (Gamma), and Highlights (Gain):
-
Per-Zone Controls: Individual Tint (
R/G/B), Contrast, and Saturation (0.0xdesaturation to4.0xboost). -
Black & White Levels:
ShadowLift+/-lifts or crushes the deepest black floors;HighlightGain+/-expands or compresses bright highlight energy.
Instead of arbitrary linear thresholds, tonal zones are smoothly partitioned using Michaelis-Menten / Naka-Rushton perceptual compression:
mColorGradingShadowMax = 0.45, mColorGradingHighlightMin = 0.40) ensure that lit skin, hair sheen, specular glints, and skies receive natural highlight grading without harsh clipping or tonemap desaturation.
-
2D White Balance: Planckian blackbody
Temperature+/-(warm amber vs cool blue) coupled with orthogonal Green/MagentaTint+/-, normalized by luminance to prevent unwanted exposure drift. -
Smart Vibrance (
Vibrance+/-): Non-linear curve boosting muted, pastel tones while protecting already saturated colors and anime skin. -
3D Rodrigues Hue Rotation (
Hue+/-): Branchless axis-angle rotation enabling full 360° global hue angle shifts in ~4 ALU instructions.
One-touch film stock presets with uniform dynamic branching (zero GPU cost when inactive):
-
TealOrange+: Hollywood blockbuster look with cool cyan-teal shadows and warm golden amber highlights. -
BleachBypass+: Silver-retention film processing look with high contrast and desaturated metallic grit. -
CrossProcess+: Stylized C-41 chemical slide cross-processing response. -
Monochrome+: Photometric spectral black & white conversion (Rec.709 luminance weights).
| Panel Tab | Morph Sliders | Description |
|---|---|---|
| Eyebrows (眉) |
Contrast+/-, Saturation+/-, Gamma+/-, Exposure+/-, Vibrance+/-, Hue+/-
|
Master global grading, smart vibrance, and hue rotation. |
| Eyes (目) |
Temperature+/-, Tint+/-, ShadowR/G/B+/-, ShadowContrast+/-, ShadowSaturation+/-, ShadowLift+/-
|
2D White balance and Shadows (Lift) split-toning. |
| Mouth (口) |
HighlightR/G/B+/-, HighlightContrast+/-, HighlightSaturation+/-, HighlightGain+/-, MidtoneR/G/B+/-, MidtoneContrast+/-, MidtoneSaturation+/-
|
Highlights (Gain) and Midtones (Gamma) split-toning. |
| Other (他) |
BalanceR/G/B+/-, TealOrange+, BleachBypass+, CrossProcess+, Monochrome+
|
Color balance offsets and one-touch creative film presets. |
Ray-MMD ReForge is an open-source next-generation PBR render engine for MMD based on Ray-MMD (Rui). Released under the MIT License.


