Skip to content

Releases

Ray-MMD ReForge 1.24.0

Choose a tag to compare

@norz3n norz3n released this 03 Nov 09:57
v1.24.0-reforge
caa3847

Ray-MMD ReForge 1.24.0

This release hardens the volumetric fog and godray pipeline, adds cloud-shadowed godrays and configurable fog quality/debug controls, fixes the AO projection-scale and bloom emissive-layer bugs found during the render audit, and introduces a full static verification toolchain (contracts, lint, compile matrix, and runtime test scaffolding).


🌫️ Volumetric Fog & Atmospheric Godrays (Shader/Fog/*, ray.conf, ray_advanced.conf)

  • Correct depth units across the fog pipeline:
    • Converted G-Buffer view-space Z to Euclidean ray distance in both the raymarch and the composite (VolumetricFogRaymarchPS, FogCompositePS).
    • Fixed under-integration at the screen edges and the raymarch/far-field boundary mismatch.
  • Continuous near/far-field model:
    • The 250-unit boundary now blends the raymarched near-field scattering into the analytical far-field model over mFogFarBlendDistance.
    • Removed the visible colour/intensity kink on long ground planes and large geometry.
  • Safer godray shading:
    • Clamped the Cornette-Shanks phase to mFogPhaseMax, preventing HDR blowout at high MiePhase+ values.
    • Replaced the fixed 6/14-unit shadow bias with a distance-scaled bias plus a 6-unit transition ramp.
    • Added cross-cascade blending and a smooth fade to lit beyond the shadow cascade range.
    • Decoupled extinction from Godrays±/RayDensity±, so raising ray brightness no longer thickens the fog.
  • Bilateral filter and quality presets (FOG_QUALITY):
    • 0: 12 steps + 5-tap blur; 1: 20 + 9-tap (default); 2: 32 + 9-tap; 3: 48 + 9-tap.
    • Added an absolute depth-tolerance cap (mFogBilateralMaxTolerance) and rational depth weights to reduce sky/geometry halo bleeding.
  • Cloud-shadowed godrays (SunOcclusionMap):
    • Added a 1×1 shared cloud-transmittance target, written by Time of day and Time of night cloud passes and sampled by the fog sun term.
    • Calibrated HitCloudsTest (CloudShadowExtinction = 0.35) so dense clouds actually occlude rays instead of the previous ~0.6% attenuation.
    • Toggle with FOG_CLOUD_SHADOW_ENABLE.
  • Atmosphere and local volumes:
    • Ambient fog hue now follows SkyLightMap via mFogSkyTint.
    • Added four configurable local fog spheres (mFogLocalVolume*) for stage mist patches.
    • Added far-field horizon occlusion using SkyVisibilityMap.
    • Added FOG_DEBUG views: transmittance, inscattering, sun visibility, density.
    • Fixed mist modulation saturation and made both wind octaves drift coherently.

🧹 Render Fixes (Shader/Occlusion/*, Shader/PostProcess/PostProcessBloom.fxsub, Shader/GI/*)

  • GTAO/HBAO projection scale:
    • Screen-space AO radius now uses the Y projection scale (matProject._m22) instead of the X scale (_m11).
    • AO is no longer aspect-dependent. Expect a wider/stronger result at 16:9; retune SSAORadius± if needed.
  • Bloom emissive-layer blending:
    • Replaced the invalid lerp(emissive0, emissive1, MRT8.a) weight (which packs lightModel + alpha) with the decoded alpha fraction.
    • Added zero-luminance guards in bloom modes 3/4, eliminating 0/0 NaN on black pixels at maximum threshold.
  • GI and sky visibility cleanups:
    • Added GI_FILTER_RADIUS and GI_PREFILTER_RADIUS compile-time controls (defaults unchanged).
    • Bounded the SSPT isometric ray extension near zero screen-space direction.
    • Removed the unreachable SSGI glass branch.
    • Removed the meaningless R32F alpha check in ComputeSkyVisibilityCheap.

🛠️ Engineering & Verification

  • Data contracts (docs/contracts/):
    • G-buffer layout, depth/unit conventions, and light/camera direction conventions.
    • Shader/Core/contracts.fxsub helpers for ray distance, alpha decoding and sun direction.
  • Static gates (Tools/ci/):
    • Invoke-All.ps1: lint + controller lint + compile matrix in one command.
    • Shader lint: 110 files, includes, entry points, RTs, samplers, passes and high-confidence contract regressions.
    • Controller lint: validates CONTROLOBJECT bindings against tests/controls/*.json.
    • Compile matrix: 41 entry points across 5 fog/GI/SSR profiles with an MME-annotation fxc shim.
  • Runtime scaffolding:
    • MMD window capture, perceptual golden comparison, and PresentMon frame-time tooling.
    • GitHub-hosted static CI plus a self-hosted mmd workflow for golden/perf runs.
  • Documentation:
    • docs/engineering.md, docs/known-limitations.md, and a verification section in README.md.

⚙️ Configuration migration

  • New user-facing presets in ray.conf: FOG_QUALITY, FOG_DEBUG, FOG_CLOUD_SHADOW_ENABLE, GI_FILTER_RADIUS, GI_PREFILTER_RADIUS.
  • New constants in ray_advanced.conf are guarded by RAY_ADVANCED_FOG_REV.
  • Old configs remain compilable: missing FOG_QUALITY falls back to 20 steps (32 for FOG_ENABLE 3), and missing 1.24 fog constants receive safe defaults.
  • FOG_ENABLE 3 no longer implies 32 steps by itself; use FOG_QUALITY 2 or 3.
  • No PMX controller binding or material preset definitions were broken.

Full Changelog: v1.23.1-reforge...v1.24.0-reforge

Ray-MMD ReForge 1.23.1

Choose a tag to compare

@norz3n norz3n released this 26 Oct 13:29
c7a24e9

Ray-MMD ReForge 1.23.1

This patch release resolves high-frequency noise and temporal dithering grain in volumetric fog godrays via a smooth depth transition ramp and expanded bilateral blur footprint, fixes green firefly artifacts and YCbCr chroma explosions in Screen-Space Global Illumination (SSGI) and Path Tracing (SSPT), and optimizes volumetric shadow sampling stability.


🌫️ Volumetric Fog & Godrays Stability (Shader/Fog/VolumetricFog.fxsub, ray_advanced.conf)

  • Smooth Depth Transition Shadow Ramp (SampleVolumetricShadow):
    • Replaced the harsh binary step shadow cutoff ((shadowVal + bias) >= receiverDepth ? 1.0f : 0.0f) with a continuous linear depth transition ramp (saturate(depthDelta / 0.0035f + 0.5f)).
    • Eliminates harsh dither grain, step noise, and pixel jitter along volumetric shadow boundaries and sun/moon crepuscular ray fringes.
  • 13-Texel Bilinear Gaussian Bilateral Filter (VolumetricFogBilateralBlur):
    • Expanded the bilateral blur kernel footprint from 9 texels to 13 texels ([-6..6] with fractional offsets [-6, -4.5, -3, -1.5, 0, 1.5, 3, 4.5, 6]) using bilinear Gaussian sampling.
    • Significantly improves spatial smoothing of volumetric light shafts without increasing texture tap counts or register pressure.
  • Bilateral Depth Rejection & Sky Normalization:
    • Dynamically calculates depth tolerance as max(1.5f, centerDepth * max(0.05f, mFogBilateralDepthThreshold)), preventing false edge rejections across foreground geometry.
    • Clamped and normalized sky depth (centerDepth <= 1e-4f) to mFogRaymarchMaxDistance, eliminating blur discontinuities between scene geometry and the horizon / sky dome.
  • Increased Raymarching Step Budget:
    • Raised default volumetric raymarching step count from 16 to 20 steps (VOLUMETRIC_FOG_STEPS 20).
    • Raised ultra quality step count (FOG_ENABLE == 3) from 24 to 32 steps.
    • Adjusted default mFogBilateralDepthThreshold from 0.12 to 0.18 in ray_advanced.conf for more natural depth adaptation.

✨ Global Illumination & Chroma Stability (Shader/GI/*, Shader/Core/gbuffer.fxsub)

  • Direct Scene Radiance Sampling in SSGI & SSPT (SSGI_Trace.fxsub, SSPT_Trace.fxsub):
    • Updated SampleSkyRadiance in Screen-Space Global Illumination (SSGI) and Path Tracing (SSPT) gather loops to sample background sky radiance directly from ScnSamp in linear space (srgb2linear(tex2Dlod(ScnSamp, ...))).
    • Bypassed direct sampling of the checkerboard-packed EnvLightMap in the screen-space tracing gather loop.
  • Elimination of Green Fireflies & Phase Desync:
    • Fully eliminated 2-tap checkerboard phase desync, border clamp parity mismatches, and chroma bleeding that produced green firefly artifacts and chromatic noise across surfaces evaluating screen-space path tracing / diffuse GI against sky backgrounds.
  • Out-of-Gamut Chroma Guard in YCbCr Decoding (Shader/Core/gbuffer.fxsub):
    • Added non-negative bounding (max(0.0f, ...)) to RGB color channel evaluation in DecodeYcbcr.
    • Prevents negative chroma components from squaring (pow2) into spurious out-of-gamut positive radiance spikes ("chroma explosions").

Full Changelog: v1.23.0-reforge...v1.23.1-reforge

Ray-MMD ReForge 1.23.0

Choose a tag to compare

@norz3n norz3n released this 19 Oct 09:45
v1.23.0-reforge
0efc66a

Ray-MMD ReForge 1.23.0

This release introduces a decoupled celestial lighting & volumetric fog architecture via SkyLightMap, brings dynamic Mie forward scattering with soft lunar diffraction halos, and delivers a full nocturnal volumetric cloud suite adapted for Time of night.


🌌 SkyLightMap & Celestial Lighting Decoupling (Shader/Lighting/*, Shader/Fog/*)

  • Dedicated Shared SkyLightMap Render Target (Shader/Core/textures.fxsub, Shader/Lighting/skylighting.fxsub):
    • Introduced a 1×1 FP16 shared render target (SkyLightMap) populated dynamically by skybox lighting passes.
    • Fully decouples direct sun/moon illumination from ambient environment mapping, allowing direct surface BRDF evaluation and volumetric fog godrays to sample exact celestial radiance rather than a flat ambient base.
  • Physical Multi-Spectral Solar Extinction & Pure Lunar Radiance:
    • Maintained multi-spectral atmospheric Rayleigh/Mie extinction across daytime and sunset transitions in Time of day.
    • Implemented an isolated nocturnal lunar spectrum in Time of night, completely eliminating false sunset reddening when the moon descends to low elevation angles near the horizon.
  • Skybox Lighting Unification:
    • Integrated SkyLightMap population across all packaged skyboxes: Time of day, Time of night, Sky Night, Sky Hemisphere, and skylighting_none.fx.

🌕 Dynamic Forward Mie Scattering & Lunar Halo Mode (Shader/Lighting/ShadingMaterials.fxsub)

  • Autonomous Solar/Lunar Spectrum Detection:
    • Dynamically calculates the blue-to-red ratio from SkyLightMap to discern daylight solar radiance from cold nocturnal moonlight without needing manual user switches or controller toggles.
  • Dual-Mode Henyey-Greenstein Forward Phase Anisotropy:
    • Solar Mode: Retains sharp forward-scattering solar aureole ($g = 0.96$) around the sun vector.
    • Lunar Halo Mode: Switches to broader forward angular diffraction ($g = 0.90$) with expanded angular gating thresholds, producing a soft, silvery lunar atmospheric halo.
  • Shadow Occlusion Gating:
    • Modulated corona intensity against cascaded shadow map occlusion, preventing diffraction glare from leaking through occluded geometry and terrain.

☁️ Night-Adapted Volumetric Clouds Suite (Skybox/Time of night/*)

  • Port & Adaptation of Nubis / Frostbite Volumetric Clouds (cloud.fxsub):
    • Brought volumetric raymarched cloudscapes to Time of night with physically grounded nocturnal light transport.
    • Implemented moonlight direct illumination with Purkinje blue-shift and lunar forward scattering.
    • Balanced nocturnal ambient lighting integrating starlight floor radiance, nocturnal sky dome color, and cavity ambient occlusion.
  • Pre-Multiplied Celestial Occlusion (DrawClouds):
    • Clouds evaluate depth and transmit background celestial radiance with pre-multiplied alpha blending, correctly occluding background stars, the Milky Way, and the Moon disk based on cloud density and optical thickness.
  • Model Morphs & Tooling Integration:
    • Added 3 cloud noise octave textures (clouds1.png, clouds2.png, clouds3.png).
    • Injected dedicated Cloud control morphs into Time of night.pmx (CloudDensity, CloudHeight, CloudCoverage, etc.).
    • Updated Tools/pmx_tool.py morph categorization rules to automatically structure cloud controls into their respective PMX panels.

Full Changelog: v1.22.1-reforge...v1.23.0-reforge

Ray-MMD ReForge 1.22.1

Choose a tag to compare

@norz3n norz3n released this 17 Oct 08:02
v1.22.1-reforge
8c71ec0

Ray-MMD ReForge 1.22.1

This patch release resolves critical Direct3D 9 shader compilation issues that prevented loading ray.x on multiple hardware configurations, fixes high-roughness grazing angle edge artifacts in Kulla-Conty IBL energy compensation, adds PMX texture/sphere morph semantics, and delivers extensive setup documentation and controller guides.


🚨 Critical Fixes & Hardware Compatibility

  • Resolve D3D9 Technique Validation Failure on ray.x (closes #14):

    • Replaced the unrolled raymarching loop ([unroll]) with a dynamic loop ([loop]) in Shader/Fog/VolumetricFog.fxsub (VolumetricFogRaymarchPS).
    • The previous unrolled loop across 16 steps generated 5,559 instruction slots and 164 texture samples, exceeding the Direct3D 9 ps_3_0 hardware driver cap of 4,096 instruction slots (MaxPixelShader30InstructionSlots) and causing ID3DXEffect::ValidateTechnique to fail with:
      Error: some techniques cannot run on this hardware: DeferredLightning
      
    • Reduces the compiled instruction slot count down to 828 slots (-85%) and texture samples down to 14, while slashing compile time from ~45 seconds to ~1.5 seconds with bit-identical visual output.
  • Ground-Truth Ambient Occlusion (GTAO) Register Spill Fix:

    • Resolved error X4505: maximum temp register index exceeded during Ground-Truth Ambient Occlusion compile when configured at extreme sampling budgets (SSDO_QUALITY 6, 8 steps per slice).
    • Switched the inner horizon integration step loop from [unroll] to [loop] in Shader/Occlusion/PostProcessOcclusionGTAO.fxsub, eliminating temporary register spills beyond the 32-register r0..r31 ps_3_0 limit and reducing the pass to a lightweight 379 instruction slots (10 texture, 369 arithmetic).

✨ Lighting, Reflections & Color Fidelity

  • Kulla-Conty Grazing Angle Specular Normalization (Shader/Lighting/ibl.fxsub):

    • Eliminated persistent white rim/halo artifacts along character silhouette edges at grazing angles ($N \cdot V \to 0$).
    • Raised the $E_o$ denominator floor from 0.05 to 0.15 and introduced an $N \cdot V$-based smooth fade (saturate(nv / 0.1)), ensuring specular multi-bounce energy compensation cleanly converges to 1.0 at glancing angles where analytic approximations degrade.
  • Adaptive IBL Chroma Filter & Specular Firefly Suppression (Shader/Lighting/ibl.fxsub) (closes ray-cast#118, ray-cast#127):

    • Adapted the IBL chroma filtering pass to HDR luminance distribution, preventing isolated specular fireflies and temporal flickering on high-contrast environment maps.
  • Unlit Buffer Clear & Skybox DefaultEffect Routing (closes ray-cast#44, ray-cast#160):

    • Fixed residual green tint on unlit or cleared buffer targets and expanded skybox DefaultEffect pattern matching for custom skybox models.

🎭 Material & Core Engine Upgrades

  • PMX Texture & Sphere Morph Semantics (closes ray-cast#81):

    • Added native shader support for MMD ADDINGTEXTURE and MULTIPLYINGTEXTURE PMX material morph semantics in Materials/material_2.0.fx and Materials/Toon/material_toon.fx.
  • VRAM Stability & D3D9 Device Reset Protection (closes ray-cast#125, ray-cast#142):

    • Guarded ShadingMapTempSpecular buffer allocation behind SSSS_QUALITY to prevent Direct3D 9 out-of-memory resets (D3DERR_OUTOFVIDEOMEMORY) on GPUs with constrained VRAM.

📖 Documentation & Guides

  • Quick Start Guide (docs/QUICKSTART.md): Complete walkthrough for setting up scenes from scratch, recommended controller loading order, and essential 4-step workflow.
  • Modular Controller Setup Guide (docs/CONTROLLER_SETUP.md): Detailed reference for configuring decentralized controllers (LightingController.pmx, CameraController.pmx, ColorGradingController.pmx, FogController.pmx, etc.).

Full Changelog: v1.22.0-reforge...v1.22.1-reforge

Ray-MMD ReForge 1.22.0

Choose a tag to compare

@norz3n norz3n released this 11 Oct 14:20
v1.22.0-reforge
2381b06

Ray-MMD ReForge 1.22.0

This milestone release introduces a complete architectural overhaul of the volumetric fog & atmospheric scattering subsystem with a unified FogController.pmx, integrates state-of-the-art Google Filament PBR & optical algorithms (Belcour & Barla thin-film iridescence, Kulla-Conty IBL energy conservation, Oat & Sander / Jimenez spherical caps Specular AO), delivers Beer-Lambert optical absorption & 4-wavelength spectral dispersion for glass and water, upgrades shadows with Screen-Space Contact Cone Tracing (SSCT) and Castaño 4-tap PCF 3x3, and expands post-processing with Gran Turismo 7 (GT7) & AgX Golden tonemappers and Gjøl (2016) TPDF triangular dithering.


🌫️ Physical Volumetric Fog & Atmospheric Godrays Subsystem (FogController.pmx)

  • Complete Subsystem Consolidation: Fully phased out and removed legacy fragmented fog assets (AtmosphericFog, GroundFog, VolumetricCube, VolumetricSphere, Time of fog). Replaced with a unified, high-performance physical fog engine integrated directly into the deferred pipeline.
  • Dual-Layer Analytical Height Fog (FogCommon.fxsub): Closed-form dual-layer exponential fog model inspired by UE5 and Google Filament, evaluating base atmosphere and ground mist with individual height falloffs, start distance gating, and maximum opacity clamping with zero raymarching overhead.
  • Physically Raymarched Volumetric Godrays (VolumetricFog.fxsub): Screen-space and world-space raymarched light scattering coupled directly to the directional sun zenith angle and Cascaded Shadow Maps (CSM). Employs Henyey-Greenstein forward phase scattering with Mie asymmetry tuning (MiePhase).
  • Mist Turbulence & Wind Dynamics: 3D procedural noise modulation creating rolling ground mist swirls and animated wind velocity drift.
  • Cross-Bilateral Edge Denoising (FogComposite.fxsub): Depth-aware composite and bilateral filter eliminating raymarching stepping slices while preserving sharp character contours.
  • Standalone Purpose-Built Controller (FogController.pmx): Dedicated 42-morph controller (Tools/generate_fog_controller.py) for comprehensive live tuning:
    • Density & Opacity: FogDensity+/-, GroundDensity+/-, MaxOpacity+/-.
    • Color & Sun: FogR/G/B+/-, SunR/G/B+/-, SunIntensity+/-, MiePhase+/-.
    • Height & Distance: FogHeight+/-, HeightFalloff+/-, GroundHeight+/-, GroundFalloff+/-, StartDistance+/-, CutoffDistance+/-.
    • Godrays & Dynamics: Godrays+/-, RayDensity+/-, MistNoise+/-, WindSpeed+/-.

✨ Google Filament PBR & Optical Shading Suite (Shader/Lighting/*)

  • Belcour & Barla (2017) Thin-Film Spectral Iridescence (Shader/Lighting/BRDF.fxsub): Analytical spectral evaluation using convolved Gaussians against CIE XYZ / Rec.709 curves (EvaluateIridescenceSensitivity, ThinFilmIridescence), rendering authentic physical rainbow wave interference for car coatings, soap bubbles, and pearl finishes.
  • Physical Clear Coat Energy Conservation (Shader/Lighting/skylighting.fxsub): Physical $(1.0 - F_c)$ Fresnel energy attenuation scaling underlying substrate diffuse and base specular reflectance based on top coat reflection.
  • Kulla-Conty Specular IBL Energy Conservation (Shader/Lighting/ibl.fxsub): Multi-bounce specular energy compensation recovering lost interreflection energy on high-roughness surfaces in both direct split-sum and analytical environments.
  • Spherical Caps Intersection Specular AO (Shader/Lighting/ibl.fxsub): Analytical cone-cone intersection (Oat & Sander / Jimenez 2016) replacing heuristic specular occlusion with exact solid-angle horizon clipping.
  • Colored Penumbra (Filament SSS Emulation) (Shader/Lighting/ShadingMaterials.fxsub): Adds saturated warm reddish/amber energy along terminator shadow boundaries on skin and cloth, eliminating harsh grey shadow borders.
  • Specular Multi-Bounce AO for Metals (Shader/Lighting/ShadingMaterials.fxsub): Jimenez specular multi-bounce formulation preventing dark cavity crushing and preserving authentic tinted specular bounce on colored metals (gold, copper, brass).

🌊 Transmission & Media: Beer-Lambert & 4-Wavelength Dispersion

  • Beer-Lambert Optical Absorption (Shader/Lighting/ShadingMaterials.fxsub): Physical exponential depth attenuation ($T = e^{-\sigma_{\text{abs}} \cdot d}$) for SHADINGMODELID_GLASS, giving thick glass and deep water realistic body, mass, and optical density instead of flat alpha blending.
  • 4-Wavelength Spectral Dispersion ($K_0..K_3$): Upgraded glass dispersion from simple 2-tap RGB split to 4-wavelength spectrum (Fraunhofer C, d, e, F lines at 486.1, 546.1, 589.3, 656.3 nm) with temporal jitter.

🌑 Shadows: Screen-Space Contact Cone Tracing (SSCT) & Castaño 3x3 PCF

  • Screen-Space Contact Cone Tracing (SSCT) (Shader/Shadows/ContactShadow.fxsub): Upgraded linear contact shadow marching to expanding cone tracing with distance attenuation and soft contact penumbra, grounding characters and geometry cleanly.
  • Castaño (2013) 4-Tap PCF 3x3 Filter (Shader/Shadows/PCSS.fxsub, CascadedShadowMap.fxsub): Integrated Ignacio Castaño's ultra-fast bilinear 4-tap PCF 3x3 reconstruction for SUN_SHADOW_QUALITY 1, boosting performance on lower-tier hardware.

🎨 Color Science: GT7 & AgX Golden Tonemappers (Shader/PostProcess/*)

  • Gran Turismo 7 (GT7) Tonemapper (HDR_TONEMAP_OPERATOR 11): Polyphony Digital's SIGGRAPH 2025 physically based tone curve calibrated to 250 nits paper white.
  • AgX Golden Look (HDR_TONEMAP_OPERATOR 12): Troy Sobotka's AgX filmic response with warm golden highlight roll-off and rich tonality.
  • TPDF Triangular RGB Dithering (Shader/PostProcess/ColorGrading.fxsub): Implemented Morten S. Mikkelsen / Gjøl (2016) triangular probability density function (TPDF) blue-noise dithering, eliminating 8-bit banding without colored chroma grain.

⚙️ Core Math & Configuration

  • Vectorized pow4 Overloads: Added scalar and vector pow4 helpers in Shader/Core/math.fxsub.
  • ray.conf Configuration: Exposed FOG_ENABLE (1..3) and documented new tonemap operators 11: GT7 and 12: AgX Golden.

Full Changelog: v1.21.2-reforge...v1.22.0-reforge

Ray-MMD ReForge 1.21.2

Choose a tag to compare

@norz3n norz3n released this 08 Oct 15:35
v1.21.2-reforge
f774082

Ray-MMD ReForge 1.21.2

This release delivers critical D3D9 hardware & driver compatibility fixes across NVIDIA and AMD GPUs (resolving RDNA antialiasing and GeForce PCSS shader compilation limits), integrates AgX Punchy & Khronos PBR Neutral tonemapping, introduces an extensive 5×5 Calibrated Tonal Skin Matrix and Textured Hair Strand Suite for both PBR and Toon pipelines, and addresses multiple lighting, post-processing, and atmospheric stability issues.


🎮 Hardware & D3D9 Driver Compatibility (NVIDIA & AMD)

  • AMD RDNA Antialiasing Fix (ShadingMapLDR A8R8G8B8): Introduced a dedicated A8R8G8B8 LDR render target (ShadingMapLDR) for SMAA, TAA, DLAA, and FXAA point-sampled reads. Fixes a critical driver bug on AMD RDNA cards (e.g. RX 6000/7000 series) where reading FP16 RTs via point sampling caused all AA modes except FXAA to silently fail. Downgraded ShadingMapTemp2 to A8R8G8B8 and simplified post-process sharpen routing.
  • NVIDIA GeForce / Pascal ps_3_0 PCSS Instruction Budget: Reduced PCSS blocker search samples from 16 to 8 and filter taps from 24 to 16, and unified Cascade 4 peripheral fallback branches. Slashed ShadowMapGenPS instruction count from 6,719 down to 3,698 (texture fetches from 648 to 344), eliminating CreatePixelShader driver-level compilation crashes on NVIDIA GeForce GTX 10-series and newer.
  • Hardware Shadow RT Compatibility: Converted PSSM1..4 render targets from G32R32F to single-channel R32F (native D3D9 NVIDIA drivers lack D3DUSAGE_RENDERTARGET support for G32R32F), changed cascade samplers (PSSM1Samp..PSSM4Samp) to POINT filtering, and reverted screen-space shadow maps (ShadowMap, ShadowMapTemp) from R16F to L8.
  • D3D9 TAA Hazard & RT Leak Elimination: Resolved D3D9 read-after-write hazard in TAA using intermediate staging buffers and an update pass. Restored the backbuffer render target in post-process passes when CAS sharpen is inactive, and fixed the offscreen effect routing path for VelocityMap.

🎨 Advanced Tonemapping & Color Science (Shader/PostProcess/*)

  • AgX Punchy Tonemapping (HDR_TONEMAP_OPERATOR 9): Added the AgX Punchy operator with ASC CDL transform for high dynamic range scenes.
  • AgX Math & Range Corrections: Fixed transposed AgX outset matrix and coefficient [2, 1] typo, corrected AgX log2 EV range from [-10, +6.5] to canonical [-12.47393, +4.026069], and properly linearized AgX output with srgb2linear() to prevent double-gamma distortion.
  • Khronos PBR Neutral Tonemapping (HDR_TONEMAP_OPERATOR 10): Implemented the Khronos Group PBR Neutral tone mapper for faithful color fidelity and high-exposure preservation.
  • CAS & Dithering Cleanups: Tonemap dithering now automatically bypasses when CAS sharpen is active to avoid sharpening noise patterns. Added divide-by-zero protection in Reinhard luma-based tonemapping, non-negative clamping in ACES and dithering, and corrected linear/sRGB conversion order in ACES Fitted.

💄 Expanded Material Library Suite: Skin & Hair (Materials/*)

  • 5×5 Calibrated Tonal Skin Matrix (PBR & Toon): Built a comprehensive 5×5 skin tone matrix featuring 5 undertones (Neutral, Warm Ivory, Cool Lavender, Rosy Peach, Pale Olive) across 5 luminance tiers (bright to dark), structured into Matte (smoothness 0.45) and Glossy (smoothness 0.60) finishes.
    • SSS transmittance (customB) is clean-room calibrated in sRGB without double-gamma distortion, matching ReForge's internal srgb2linear color pipeline.
    • Coupled with micro-surface pore normal maps (1.5 scale, 80.0 tiling) for authentic micro-scattering.
    • Full cel-shaded counterpart matrix provided in Materials/Toon/Skin/Tonal/ (CUSTOM_ENABLE 8) with tuned shadow thresholds and comprehensive documentation.
  • Textured Hair Strand Suite (PBR & Toon): Added a CC0 clean-room anisotropic strand normal map (_MaterialMap/hair.png), 22 textured hair presets in Materials/Hair/Textured/ and Materials/Toon/Hair/Textured/ (Silky, Clustered, Fine Strands, Anime Anisotropic), and reorganized legacy procedural hair presets into a clean Procedural/ hierarchy. All presets include _realistic.fx hashed alpha cutout variants.

💡 Lighting, Transparency & Post-Process Robustness

  • Emissive Transmission Behind Glass & Transparency: Fixed emissive surfaces becoming invisible behind glass (SHADINGMODELID_GLASS) and transparent materials. Added emissiveIntensity to MaterialParam / DecodeGbuffer, blended emissive pass-through via actual material alpha in ShadingTransparentPS, and removed premature depth clipping.
  • Area Light Subsurface & Range Fixes: Applied RectangleAttenuation to subsurface scattering in rectangle_lighting.fxsub, and clamped TubeLight range to valid parameters.
  • Bloom & Toon Diffusion Subpixel Artifacts: Replaced hardcoded 512 resolution baselines with configurable HDR_BLOOM_QUALITY and TOON_DIFFUSION_QUALITY settings in ray.conf (defaulting to 2048), eliminating blocky cross/grid undersampling flares on bright subpixel particles across 1080p–4K.
  • Restored Time of Fog Controls: Restored functional FogIntensity and FogDensity morph controls across Skybox/Time of day and Time of night, scaling Mie scattering cross-section and computing physical optical depth extinction in alpha for FogMap attenuation.

Full Changelog: v1.21.1-reforge...v1.21.2-reforge

Ray-MMD ReForge 1.21.1

Choose a tag to compare

@norz3n norz3n released this 02 Oct 11:44
v1.21.1-reforge
628394f

Ray-MMD ReForge 1.21.1

This update introduces a dedicated unshadowed eye shading architecture (SHADINGMODELID_EYE 10), replacing legacy emissive hacks with physical eye shading, and delivers a comprehensive physical solar lighting & atmospheric optics suite including Eddington limb darkening, Kulla-Conty multi-scattering energy compensation, and Planckian locus auto-CCT.


👁️ Dedicated Unshadowed Eye Shading Model (SHADINGMODELID_EYE 10, CUSTOM_ENABLE 10)

  • Eliminated Emissive Hack: Removed the legacy workaround (EMISSIVE_ENABLE 1), which caused character eyes to glow unnaturally like flashlights in dark or night scenes. Eye presets (material_eye.fx, material_eye_anime.fx) now use EMISSIVE_ENABLE 0 by default.
  • Physical Cast-Shadow & Occlusion Bypass: Automatically bypasses directional shadow maps (preventing harsh shadows cast by hair bangs and eyelids), SSAO/SSDO, geometric terminator falloff, and deep orbital eye socket occlusion.
  • Scene-Consistent Radiance Response: Unlike unlit/emissive shaders, eyes respond proportionally to ambient and direct lighting levels (darkening naturally at night, brightening under key lights) without false self-glow.
  • Corneal Clearcoat & Parallax Preservation: Preserves physical clearcoat specular highlights and reflections on the corneal dome (customA = cornea smoothness) while maintaining seamless integration with physical Snell's law cornea refraction and iris parallax depth mapping (EYE_PARALLAX_ENABLE).
  • Comprehensive Library Updates: Updated all PBR and Toon eye presets (Materials/Eye/*, Materials/Toon/Eye/*) and synchronized complete documentation in Materials/README.md and Materials/README_chs.md.

☀️ Physical Solar Lighting & Atmospheric Optics Suite (Shader/Lighting/*)

  • Eddington Solar Limb Darkening (SUN_LIMB_DARKENING 1): Implemented the physical Eddington center-to-limb quadratic radiation profile across the solar disk ($0.533^\circ$) in SphereMaxNoH (Shader/Lighting/BRDF.fxsub). Eliminates hard, razor-sharp circular disk edges on specular highlights.
  • Kulla-Conty Energy Compensation (SUN_MULTI_SCATTER_COMPENSATION 1): Added Fdez-Aguéra analytical multi-scattering energy compensation for GGX microfacets and anisotropic surfaces, recovering inter-reflection energy lost on rough materials and preventing dark rims at grazing angles.
  • Backlit Hair Transmission (SUN_HAIR_TRANSMISSION 1): Implemented forward Marschner TT-mode longitudinal scattering for anisotropic hair materials (SHADINGMODELID_ANISOTROPY), simulating warm fiber luminescence and glowing silhouettes when backlit against strong direct sunlight.
  • Dynamic Perez/CIE Sun-to-Sky Irradiance Coupling (SUN_SKY_COUPLING 1): Dynamically modulates direct solar irradiance against diffuse hemispherical skylight based on solar elevation, ensuring physically accurate balance throughout midday, golden hour, and dusk transitions.
  • Planckian Locus Daylight Auto-CCT (SUN_AUTO_CCT 1): Integrated Kang/Kim/Hernandez-Andres polynomial blackbody approximation (2200K–6500K) dynamically driving physical sunlight spectral shifts based on solar zenith angle.
  • Forward Mie Scattering Corona (SUN_CORONA_ENABLE 1): Added a view-dependent forward Mie aerosol diffraction aureole centered around the sun vector for cinematic atmospheric transitions.

⚙️ Configuration (ray.conf, ray_advanced.conf)

  • Added dedicated toggles in ray.conf for all solar lighting enhancements (SUN_LIMB_DARKENING, SUN_HAIR_TRANSMISSION, SUN_SKY_COUPLING, SUN_AUTO_CCT, SUN_CORONA_ENABLE).
  • Exposed physical tuning constants in ray_advanced.conf (SUN_CCT_MIN, SUN_CCT_MAX, SUN_CORONA_POWER, SUN_CORONA_INTENSITY).
  • Bumped G-buffer shading model mask to accommodate SHADINGMODELID_EYE 10.

Full Changelog: v1.21.0-reforge...v1.21.1-reforge

Ray-MMD ReForge 1.21.0

Choose a tag to compare

@norz3n norz3n released this 30 Sep 13:52
v1.21.0-reforge
7c53980

Ray-MMD ReForge 1.21.0

This milestone release brings a ground-up redesign of the shadow pipeline with Percentage-Closer Soft Shadows (PCSS) and Screen-Space Contact Shadows, completely decommissions the monolithic ray_controller.pmx in favor of a modern Modular PMX Controller Suite, restructures the entire Shader/ directory into a clean 10-domain modular architecture, and elevates configuration usability with a structured, documented ray.conf.


🌑 Next-Gen Percentage-Closer Soft Shadows (PCSS) & Contact Shadows (Shader/Shadows/*)

  • Physically Based Contact-Hardening (PCSS): Replaced VSM and legacy cascaded shadow filters with a true contact-hardening PCSS algorithm (Shader/Shadows/PCSS.fxsub). Dynamically determines penumbra softness based on occluder-to-receiver distance and the physical angular diameter of the sun (SUN_LIGHT_RADIUS = 0.015f / $0.53^\circ$).
  • Screen-Space Contact Shadows (SSCS): Screen-space raymarching (Shader/Shadows/ContactShadow.fxsub) grounds characters and scene geometry, eliminating the floating "Peter-Panning" effect and resolving razor-sharp sub-millimeter contact occlusion under feet, fingers, and fabric folds.
  • Adaptive Close-Up Antialiasing & Anti-Staircasing: Scaled shadow depth bias and Poisson sampling dynamically at close range (lerp(1e-4, 5e-4, cascadeRatio)), completely eliminating macro staircasing and shadow acne during close-up camera angles.
  • Seamless 4-Cascade Cross-Blending: Smooth analytical cascade boundary interpolation (CascadeCrossBlend) across all 4 orthogonal cascades, eliminating hard cutoff seams.
  • Cross-Bilateral Shadow Filtering: Edge-preserving cross-bilateral filter (Shader/Shadows/ShadowBilateralBlur.fxsub) denoises Poisson jitter while preserving crisp contact silhouettes along depth and surface normal discontinuities.
  • Two-Sided Shadow Casting: Enabled CullMode = NONE on shadow casters with G-buffer normal alignment, preventing light leakage on thin geometry (hair ribbons, clothes, leaves).

🎛️ Modular PMX Controller Suite (Decommissioning Monolith)

  • Monolith Decommissioned: The bloated, legacy ray_controller.pmx has been officially phased out and removed from the active toolchain.
  • Specialized Purpose-Built Controllers:
    • LightingController.pmx (14 morphs): Direct sunlight, ambient multi-light scaling, and decoupled ambient occlusion/subsurface/GI intensities (SunLight+/-, MultiLight+/-, SSAO+/-, SSAORadius+/-, SSDO+/-, SSSS+/-, SSGI+/-).
    • CameraController.pmx (14 morphs): Cinematic lens DOF (aperture Fstop+/-, FocalLength+/-, FocalDistance+/-, FocalRegion+/-, iris BladeCount-), optical artifacts (Vignette, Dispersion, DispersionRadius), and focus calibration (TestMode, MeasureMode).
    • BloomController.pmx (8 morphs): Independent threshold, radius, and HSV grading (BloomColorAllH/S/V), plus diffraction star burst (BloomStarFade).
    • DebugController.pmx: Real-time viewport diagnostics for G-buffer, PSSM, Cascades, ShadowMap, and SSGS raymarching.
  • Universal Shading Fallbacks: All analytical light shaders (directional_lighting, point_lighting, spot_lighting, etc.) and post-processing passes support direct dual-binding with graceful fallback.

📁 Clean Modular Shader Architecture (Shader/*)

  • Domain-Specific Organization: Completely reorganized the 54 loose shader files in Shader/ into 10 structured, domain-isolated packages:
    • Shader/Core/: Base math, common routines, G-buffer layouts, samplers, textures, Monte Carlo, and velocity maps.
    • Shader/Lighting/: Shading materials, BRDFs, LTC area lights, IBL, and sky lighting.
    • Shader/Shadows/: PCSS, Contact Shadows, CascadedShadowMap, BilateralBlur, and ShadowMapGen.
    • Shader/Occlusion/: GTAO, HBAO, SSDO, and SkyVisibility.
    • Shader/GI/: Dedicated subpackages for GI/SSGI/ and GI/SSPT/.
    • Shader/SSR/: Consolidated trace, resolve, filter, blur, and visibility subshaders.
    • Shader/Subsurface/: SSSS post-process scattering and UV-space diffusion.
    • Shader/PostProcess/: HDR, Bloom, Bokeh, Lens Flares, Motion Blur, Tonemapping, and Color Grading.
    • Shader/AntiAliasing/: SMAA, TAA, FXAA, DLAA, and EdgeLine.
    • Shader/textures/: LUT textures and precomputed DDS maps.
  • Zero Broken Includes: Replaced and validated 1447 includes across all 1027+ files in the repository with 0 broken references and no intermediate stub files.

⚙️ Refreshed Configuration (ray.conf, ray_advanced.conf)

  • Table of Contents & 11 Domain Banners: ray.conf now features a structured index and clearly delineated sections for immediate navigation.
  • Balanced Defaults: SUN_SHADOW_QUALITY set to Medium (2048x2048) by default for silky-smooth real-time viewport performance while preserving physical PCSS penumbra quality.
  • Cleaned Advanced Config: Removed obsolete, unused VSM variables (mSunVSMMinVariance, mSunVSMLightBleedingReduction, mSunVSMFilterRadius, mSunLightSize).

Full Changelog: v1.20.23-reforge...v1.21.0-reforge

Ray-MMD ReForge 1.20.23

Choose a tag to compare

@norz3n norz3n released this 21 Sep 09:53
f339bba

Ray-MMD ReForge 1.20.23

This release introduces a vectorized SIMD linear raymarching architecture for Screen-Space Reflections, replaces legacy PCSS shadow loops with Variance Shadow Maps (VSM), optimizes Screen-Space Path Tracing (SSPT), and adds physically based atmospheric sunlight transmission.


⚡ Vectorized SIMD SSR & Direct Hit Sampling (Shader/SSR/SSR_HiZ.fxsub, Shader/SSR/SSR_Trace.fxsub)

  • Vectorized 4-tap SIMD linear raymarching: Screen-space reflections now march in parallel 4-sample batches without dynamic mip-level branching. Eliminates GPU warp divergence entirely, reducing shader complexity to 376–592 static instructions in ps_3_0 with zero driver stalls.
  • Direct hit-tap binding: Ray-surface intersections are bound directly to the exact tap satisfying the depth interval, preventing silhouette overshoots and eliminating saw-tooth / comb artifacts on thin geometry (fingers, arms, hair).
  • Parametric screen-border clipping & adaptive slope tolerance: Ray segments are clipped analytically against screen boundaries to avoid off-screen misses; depth comparison tolerances dynamically scale with ray slope ($2 \times |\Delta z|$) along surface gradients.
  • Bilinear hit radiance: Replaced point-sampling with bilinear texture filtering for smooth, continuous, anti-aliased reflections.

🌑 Variance Shadow Maps (VSM) (Shader/VSM.fxsub, Shader/ShadowMap.fxsub)

  • Hardware moment filtering: Sun shadow cascades now store depth moments ($M_1, M_2$) in G32R32F textures, evaluated via Donnelly & Lauritzen's one-tailed Chebyshev inequality.
  • ALU offload: Replaced heavy blocker search and loops with hardware-accelerated bilinear moment filtering, delivering smooth soft penumbras at minimal GPU cost.
  • Renamed MME tabs & effects: Shadow tabs and effect presets have been updated from PSSM1..4 to VSM1..4.

🌐 Screen-Space Path Tracing (SSPT / RTGI) (Shader/SSPT/*)

  • Branchless tangent basis: Replaced trigonometric orthonormal basis generation with Duff et al.'s branchless quaternion-free tangent frame.
  • Early-Z depth gating: Distant and empty sky samples are culled before ray stepping.
  • Artifact fixes: Resolved distance clipping falloff and eliminated dark unlit corner leaks.

☀️ Physical Atmospheric Sunlight & Translucency (Shader/BRDF.fxsub)

  • Multi-spectral atmospheric transmittance: Rayleigh scattering, Mie aerosol attenuation, and Ozone Chappuis band absorption now tint direct sunlight realistically based on solar elevation angle.
  • Area-disk solar specular: Evaluates specular highlights across the solar disk angle ($0.533^\circ$) instead of a singular point light.
  • Subsurface translucency: Improved forward back-scattering transmission for thin foliage and translucent materials.

🛠 Tooling & Diagnostics

  • HiZDebugController.pmx: Added dedicated debug controller with real-time viewport visualization for raymarch steps and intersection coverage.
  • SSRBlurMap: Added per-material blur mask target and presets (Shadow/SSR blur 0.0.fx .. 1.0.fx) for selective roughness modulation.

⚙️ Configuration (ray.conf, ray_advanced.conf)

  • SSR_QUALITY presets updated for SIMD batches: 1 = Low (128 steps), 2 = Medium (256 steps), 3 = High (384 steps), 4 = Ultra (512 steps).
  • Added SUN_SHADOW_VSM_QUALITY and tuning parameters for VSM moment variance and depth bias.

Full Changelog: v1.20.22-reforge...v1.20.23-reforge

Ray-MMD ReForge 1.20.22

Choose a tag to compare

@norz3n norz3n released this 16 Sep 10:29
v1.20.22-reforge
2c9cf2d

Ray-MMD ReForge 1.20.22

This release rebuilds Screen-Space Reflections on a Hierarchical-Z (Hi-Z) depth pyramid. Reflected rays now walk a coarse-to-fine min/max depth atlas instead of fixed-step DDA marching, skipping whole cell blocks per iteration — longer reach and cleaner contact hits for the same frame budget.


🏔 Hierarchical-Z SSR Tracer (Shader/SSR/SSR_HiZ.fxsub, new)

  • Min/max depth pyramid: 8 mip levels built from the G-buffer linear view depth, each level halving the previous cell grid, with every level packed into a single atlas texture (vertically stacked bands) that the tracer samples — one texture bind instead of nine.
  • Coarse-to-fine 2D DDA traversal: a ray segment that provably passes in front of or behind every surface in a cell skips it and climbs two levels; an ambiguous cell is inspected one level finer; a level-0 cell resolves the hit analytically from its single-texel depth slab.
  • Analytical depth jumps & adaptive thickness: rays descending into a cell jump straight to its nearest surface plane; the thickness tolerance scales with the cell's depth span (max(thickness, 0.4 + cellDepthSpan)) to prevent grazing false skips.

🎯 Trace Quality (Shader/SSR/SSR_Trace.fxsub)

  • Point-sampled hit radiance: linear filtering no longer bleeds neighbouring background pixels across the reflected silhouette.
  • NaN/Inf rejection: degenerate rays returning garbage from FP16 buffers are dropped to zero instead of rendering as gray/white blobs.
  • Smooth confidence weights: grazing-angle fade, distance fade over the last quarter of the ray budget, far-depth fade and a front-facing hit-normal test — failed rays dissolve into the env/IBL specular instead of punching holes.
  • No screen-edge vignette: reflections now run all the way to the frame boundary.

⚙️ Configuration (ray.conf)

  • SSR_QUALITY presets now map to the Hi-Z iteration budget: 1 = Low (64), 2 = Medium (96), 3 = High (128), 4 = Ultra (192).

🪞 A Note on Mirror Floors

SSR can only reflect what is visible on screen, and semi-transparent geometry (glass bodies, fins, additive materials) is inherently limited in the depth buffer. For true planar mirror-floor reflections — including off-screen and semi-transparent content — external planar-reflection effects such as WorkingFloorX are recommended on top of ray-mmd. Use the SSR visibility 0.0.fx preset on floor materials to hand the floor over cleanly while ray SSR keeps handling metals, water and wet surfaces.


Full Changelog: v1.20.21-reforge...v1.20.22-reforge