Skip to content

ReForge Material Editor

Norz3n edited this page Sep 5, 2026 · 3 revisions

ReForge Material Editor

The ReForge Material Editor is a standalone, high-performance node-based physical material authoring suite and 3D PMX studio designed specifically for Ray-MMD ReForge.

Located at Extension/MaterialEditor/MaterialEditor.exe, the tool enables creators to generate, convert, pack, preview, and export production-ready PBR materials (.fx + texture maps) without requiring external image editing software.


Key Capabilities

  • Full PBR ShaderMap Generation: Generates Tangent-space Normal maps, Ambient Occlusion, Displacement/Height, Roughness/Smoothness, Metalness, Cavity, and Emissive maps directly from diffuse textures or procedural inputs.
  • Dual Operating Modes:
    • Single Material Mode: Interactive sandbox for designing standalone PBR shaders with instant raymarched sphere/cube/plane previews.
    • PMX Model Studio Mode: Loads entire MMD 3D models (.pmx), allowing per-subset material assignment, direct viewport 3D picking, wireframe inspection, and batch generation.
  • Ray-MMD ReForge Integration: Native support for all Ray-MMD shading models (Skin/SSS, Cloth, ClearCoat, Hair Anisotropy, Glass, Subsurface, Cel/Toon Shading) and extended features (Hex-Tiling, Hashed Alpha, RNM Normal Blending, Emissive Blink).
  • Multi-Threaded Performance: Multi-threaded CPU software rasterizer with parallel band rendering (Rayon) and real-time Cook-Torrance GGX shading.
  • Zero Configuration: Shipped as a completely standalone, self-contained executable with no external runtime dependencies.

Interface Overview

+---------------------------------------------------------------------------------------+
|  Menu Bar: [Single Material Mode] [PMX Studio Mode] [Open PMX] [Resolution: 512]       |
+---------------------+---------------------------------------+-------------------------+
|  LEFT PANEL         |  CENTER PANEL                         |  RIGHT PANEL            |
|                     |                                       |                         |
|  - Node Palette     |  Interactive Node Graph Canvas        |  3D PBR Viewport        |
|  - Model Subsets    |  (Zoom, Pan, Wire Pins, Connect)      |  - Real-Time Shading    |
|  - Batch Auto-PBR   |                                       |  - Orbit / Pan / Zoom   |
|  - Material Search  |  OR Fullscreen 3D Model View          |  - Wireframe Overlay    |
|                     |                                       |  - 3D Mesh Picking      |
|                     |                                       |  - 2D Map Inspector     |
+---------------------+---------------------------------------+-------------------------+
|  STATUS BAR: Ready. Node evaluation: 14.2ms | Zoom: 100% | 5 Active Channels          |
+---------------------------------------------------------------------------------------+

Viewport Navigation

  • Orbit Camera: Click & drag Left Mouse Button (LMB).
  • Pan Camera: Click & drag Middle Mouse Button (MMB) or Shift + LMB.
  • Zoom Camera: Mouse Wheel or RMB / Alt + LMB vertical drag.
  • Rotate Light Source: Ctrl + LMB drag.
  • Pick Model Subset: Click directly on any part of the 3D model in the viewport.

Node Reference Guide

1. Input Nodes

πŸ“₯ Image Input (ImageInput)

Loads bitmap textures from the local filesystem to drive downstream generators.

  • Outputs:
    • Image (RGBA): 8-bit RGBA color texture.
  • Properties:
    • File Path: Absolute or relative path to the image file (.png, .jpg, .jpeg, .tga, .bmp, .dds).
    • sRGB: When checked, converts gamma-encoded sRGB colors into linear space for physically accurate PBR calculations. (Keep enabled for albedo/diffuse; uncheck for raw data maps like normal or roughness).

🎨 Solid Color (ColorInput)

Provides a constant, uniform RGBA color value.

  • Outputs:
    • Color (RGBA): Uniform RGBA color.
  • Properties:
    • Color Picker: RGB color and Alpha slider ($[0.0, 1.0]$).
  • Typical Uses: Base albedo tints, uniform roughness/smoothness constants, metallic masks ($1.0$ for metal, $0.0$ for dielectric), and subsurface tint colors.

⚑ Procedural Noise Generator (ProceduralNoise)

High-performance procedural mathematical noise generator for synthesizing organic patterns, surface imperfections, grime masks, and micro-roughness.

In real-world PBR materials, perfectly uniform surfaces do not exist. Even polished metal, clean glass, or freshly painted cars exhibit subtle surface micro-imperfections, finger smudges, dust deposition, and micro-roughness variation. Procedural noise outputs continuous scalar values in the $[0.0, 1.0]$ range that can be routed into different channels:

Channel Routing Guide
Target Channel Why Connect Noise Here? Recommended Noise Algorithm
Smoothness / Roughness Specular Highlight Breakup: Prevents sterile, spherical CG reflection highlights. Modulates surface glossiness with organic micro-smudges, weather wear, and handling marks. Perlin fBm (broad organic variation) or White Noise (subtle micro-satin scatter).
Normal / Height Procedural Surface Relief: Generates tangible 3D micro-geometry (skin pores, leather grain, fabric weave, orange-peel paint, chipped plaster, or rusted pitting) without needing high-res bitmap textures. Voronoi (biological pores, scales, cracked leather) or Perlin (rough stone, corrosion).
ColorBlend Factor (Mask) Weathering, Grime & Rust: Acts as a spatial distribution mask determining where paint is chipped, dirt accumulates, or oxidation penetrates. Perlin fBm (irregular stains, fluid drip lines, and wear contours).
  • Outputs:
    • Noise (RGBA): Monochromatic procedural noise texture ($R = G = B = \text{noise}, A = 255$).
  • Properties:
    • Noise Type:
      • Perlin fBm: Fractal Brownian Motion multi-octave gradient noise. Produces smooth, flowing organic clouds, marble veining, fluid stains, and stone roughness.
      • Voronoi Cellular: Distance-to-cell-edge noise. Generates polygonal cell clusters ideal for biological human skin pores, reptile scales, leather wrinkles, cracked mud, and hammered metal finishes.
      • White Noise: High-frequency uniform stochastic hash. Used for microfacet jitter, film grain, paper texture, and eliminating color banding (dithering).
    • Scale / Frequency ($0.1 - 50.0$): Spatial size of the noise pattern. Lower values ($2 - 8$) create large macro-stains; higher values ($25 - 50$) create fine micro-pores.
    • Octaves ($1 - 8$): Number of fractal octaves summed together (Perlin only). Higher values add increasingly fine harmonic micro-details.
    • Lacunarity ($1.0 - 4.0$): Frequency multiplier between successive octaves (standard: $2.0$).
    • Gain / Persistence ($0.0 - 1.0$): Amplitude decay multiplier per octave (standard: $0.5$).

2. PBR Map Generators (ShaderMap Workflow)

β›° Height Generator (HeightGenerator)

Converts RGB color textures into scalar height/displacement elevation maps using perceptual luminance weighting ($L = 0.2126R + 0.7152G + 0.0722B$).

  • Inputs:
    • Color (RGBA): Input image or color.
  • Outputs:
    • Height (Grayscale): Scalar elevation map ($0.0 = \text{valleys}, 1.0 = \text{peaks}$).
  • Properties:
    • Contrast ($0.1 - 5.0$): Amplifies steepness and slope of elevation changes.
    • Brightness ($-1.0 - 1.0$): Offsets median height baseline.
    • Invert: Flips peaks and valleys (e.g. converting dark wood grain into elevated ridges).

🧭 Normal Generator (NormalGenerator)

Calculates tangent-space normal vectors from an elevation/height map using discrete spatial differentiation.

  • Inputs:
    • Height (Grayscale): Source elevation map.
  • Outputs:
    • Normal (RGBA): Tangent-space normal map ($R = X, G = Y, B = Z$).
  • Properties:
    • Scale / Strength ($0.1 - 10.0$): Adjusts steepness of surface normals.
    • Filter:
      • Scharr 3x3: High-precision, rotational-symmetric gradient filter (recommended for fine micro-surface details).
      • Sobel 3x3: Classic edge gradient filter with slight low-pass smoothing.
    • Orientation:
      • DirectX (-Y): Inverts Green channel so light from above illuminates top surfaces. (Required for Ray-MMD ReForge).
      • OpenGL (+Y): Standard inverted Y orientation.

πŸŒ‘ Ambient Occlusion Generator (AOGenerator)

Simulates ambient occlusion by sampling horizon heights across the elevation field in multiple radial directions.

  • Inputs:
    • Height (Grayscale): Source elevation map.
  • Outputs:
    • Occlusion (Grayscale): Ambient occlusion mask ($0.0 = \text{deep cavity}, 1.0 = \text{exposed surface}$).
  • Properties:
    • Radius ($1 - 64\text{ px}$): Maximum pixel search distance for occlusion occluders.
    • Samples ($4 - 64$): Number of angular ray samples per pixel (higher values produce smoother results).
    • Intensity ($0.1 - 5.0$): Darkens and intensifies crease shadows.
    • Bias ($0.0 - 0.2$): Prevents self-occlusion artifacts on shallow slopes.

🌊 Curvature Generator (CurvatureGenerator)

Extracts surface edge curvature using a multi-scale Laplacian operator.

  • Inputs:
    • Height (Grayscale): Source height map.
  • Outputs:
    • Curvature (Grayscale): Edge curvature map.
  • Properties:
    • Mode:
      • Full: Neutral gray ($0.5$), ridges/peaks $> 0.5$, valleys/crevices $< 0.5$. (Used directly by Ray-MMD Skin customDataA).
      • Convex Only: Isolates sharp exterior edges (ideal for procedural edge wear and scratch masks).
      • Concave Only: Isolates inner seams and crevices (ideal for grime and dirt collection).
    • Radius ($1 - 16\text{ px}$): Scale of edge feature detection.
    • Intensity ($0.1 - 10.0$): Contrast multiplier.

⚑ Roughness Remap Generator (RoughnessGenerator)

Maps diffuse luminance or height variations into physically plausible microfacet roughness ranges.

  • Inputs:
    • Input (Grayscale / Image): Source texture.
  • Outputs:
    • Roughness (Grayscale): Microfacet roughness ($0.0 = \text{mirror smooth}, 1.0 = \text{rough/matte}$).
  • Properties:
    • Contrast ($0.1 - 3.0$): Adjusts transition slope between matte and glossy regions.
    • Min Value ($0.0 - 1.0$): Darkest clamp (e.g. $0.05$ ensures surfaces never become unphysically pure specular mirrors).
    • Max Value ($0.0 - 1.0$): Brightest clamp (e.g. $0.85$ prevents complete light scattering).
    • Invert: Inverts roughness into smoothness ($1.0 - R$).

πŸͺ™ Metalness Generator (MetalnessGenerator)

Generates dielectric vs metallic material classification masks.

  • Inputs:
    • Color (RGBA): Albedo diffuse image.
  • Outputs:
    • Metalness (Grayscale): Metallic mask ($0.0 = \text{dielectric / wood / cloth}, 1.0 = \text{conductor / raw metal}$).
  • Properties:
    • Smart Metal Detection: Uses chromatic analysis in HSV/RGB space to detect common metals (Gold, Silver, Platinum, Copper, Bronze, Iron) based on their physical reflectance characteristics:
      • Gold/Brass: High yellow/orange chromaticity with high specular reflectance ($F_0 > 0.6$).
      • Copper: High red-orange saturation.
      • Silver/Chrome: High achromatic brightness ($L > \text{threshold}$) with low saturation.
    • Threshold ($0.0 - 1.0$): Minimum brightness threshold for metals.
    • Falloff ($0.01 - 0.8$): Softness of transition boundary.
    • Invert Output: Inverts mask for specialized inverted workflows.

πŸ’‘ Emissive Generator (EmissiveGenerator)

Isolates bright or chromatic self-illuminating sections from a diffuse map.

  • Inputs:
    • Color (RGBA): Base diffuse texture.
    • Mask (Optional): Alpha or secondary stencil mask to isolate specific symbols.
  • Outputs:
    • Emissive (RGBA): Emissive color and intensity map.
  • Properties:
    • Min / Max Luminance ($0.0 - 1.0$): Luminance isolation window.
    • Isolate Specific Color (Keying): Filters specifically by hue:
      • Target Hue ($0 - 360^\circ$): Target color center (e.g. $180^\circ$ for cyan cybernetic runes).
      • Hue Tolerance ($5 - 120^\circ$): Allowed angular range in color wheel.
    • Tint Color: Multiplicative RGB tint applied to emissive glow.
    • Intensity Boost ($0.0 - 20.0$): Multiplier for high-dynamic-range (HDR) bloom exposure in Ray-MMD.
    • Invert Mask: Inverts luminance selection.

3. Ray-MMD ReForge Shading Model Generators

🎭 Custom Map Generator (CustomMapGenerator)

Direct authoring node for Ray-MMD ReForge's dedicated customDataA (scalar float) and customDataB (RGB vector) channels.

Shading Model Custom A Purpose Custom B Purpose
Skin (PreIntegrated SSS) Mesh curvature / SSS scatter wrap ($0.0 - 1.0$) Blood scatter fringe tint (float3(1.0, 0.36, 0.10))
Anisotropy (Hair/Brushed) Anisotropic highlight stretch & shift Tangent direction flow vector (or radial flow toggle)
Glass / Transparent Index of Refraction (IOR, e.g. $1.52$ for glass) Volume absorption transmittance color
Cloth (Sheen/Fuzz) Grazing-angle sheen intensity Microfiber grazing fuzz tint
ClearCoat Secondary lacquer coat roughness Secondary coat normal map (via detail normal)
Subsurface Profile Deep scatter radius penetration depth Subcutaneous scatter absorption tint
Cel / Toon Shading Step transition threshold on $N \cdot L$ Shadow ramp color tint

πŸ’‡ Procedural Hair Strand Generator (HairStrandGenerator)

High-performance procedural synthesis of micro-hair fibers, anisotropic strand normals, Marschner/Kajiya-Kay specular tangent shift maps, and strand density masks.

Designed specifically for Ray-MMD's Anisotropic Hair shading model (SHADINGMODELID_HAIR), procedural hair highlight breakup (#define PROCEDURAL_HAIR 1), and dual-normal RNM strand detailing.

  • Inputs: None (fully procedural).
  • Outputs:
    • Normal (Strands): Tangent-space normal map encoding individual fiber cross-sectional curvature, micro-ridges, and organic waviness undulations.
    • Tangent Shift (Silky): Anisotropic strand shift/jitter map (directly equivalent to shift4.png in Ray-MMD's Procedural Silky/12 very shiny.fx). Modulates the anisotropic specular highlight band for silky, lustrous reflections without hair-card mesh density. Connect directly to Custom B or Albedo Sub.
    • Strand Mask: Grayscale fiber density mask ($0.0 - 1.0$) isolating individual hair locks and micro-grooves.
  • Properties:
    • Strand Density ($5.0 - 2000.0$): Frequency/count of hair fibers across the UV texture space. (Values around $25 - 60$ simulate stylized anime hair locks; $200 - 500$ simulate ultra-fine realistic human strands).
    • Roughness ($0.0 - 1.0$): High-frequency micro-striation jitter and fiber irregularity.
    • Waviness ($0.0 - 1.0$): Amplitude of gentle sinusoidal strand flow and organic curling.
    • Wave Frequency ($0.1 - 50.0$): Oscillation frequency of the wave curve along the strand length.
    • Orientation (Vertical / Horizontal): Flow direction along the UV grid (Vertical along V or Horizontal along U).
    • Normal Intensity ($0.0 - 5.0$): Tangent-space relief depth of individual hair fibers.

πŸ‘ Eye Cornea & Iris Parallax Generator (EyeCorneaGenerator)

Physical optical lens generator for character eyes, modeling physiological human corneal anatomy, convex corneal dome normals (CONVEX_NORMAL 1), view-dependent Snell's law iris parallax mapping (EYE_PARALLAX_ENABLE 1), limbal ring darkening, and internal focal caustics.

Anime and MMD character meshes are typically modeled with flat or concave (sunken) eye geometry, which causes inverted, unphysical specular reflections. This node completely fixes eye shading by generating the true physical corneal dome and optical depth field without needing 3D mesh modifications.

  • Inputs:
    • Iris Color (Optional RGBA): Flat source texture of the anime eye / iris / pupil from the PMX model.
  • Outputs:
    • Cornea Dome Normal: Spherical convex normal map of the corneal lens. When assigned to Ray-MMD with CONVEX_NORMAL 1, it inverts the sunken eye normal, producing pristine spherical skylight/sun highlights that wrap naturally across the eyeball.
    • Iris Parallax Map: Radial depth map ($0.0 = \text{outer cornea}, 1.0 = \text{deepest iris pit}$) representing the anterior chamber. Feeds into Ray-MMD's internal screen-space parallax raytracer (EYE_PARALLAX_ENABLE 1, EYE_IRIS_DEPTH 0.05).
    • Limbal & Caustic Map: Composite RGBA map featuring:
      • RGB: Limbal ring boundary darkening (anatomical dark outer ring around the iris) blended with a warm inferior focal caustic crescent (simulating light focusing through the cornea onto the lower iris).
      • Alpha: Caustic mask.
    • Refracted Iris: Interactive real-time Snell's law refraction preview showing how the flat iris appears when viewed through the curved refractive corneal meniscus.
  • Properties:
    • Iris Depth ($0.001 - 0.5$): Distance between corneal dome apex and posterior iris plane (default $0.05$).
    • Cornea IOR ($1.0 - 2.0$): Index of Refraction of corneal tissue (physiological human standard: $1.376$).
    • Limbal Ring Width ($0.01 - 0.5$): Width of the soft dark boundary ring encircling the iris.
    • Limbal Darkness ($0.0 - 1.0$): Darkness / opacity of the limbal ring.
    • Caustic Intensity ($0.0 - 5.0$): Brightness of the inferior internal caustic reflection crescent.
    • Dome Curvature ($0.05 - 1.0$): Curvature radius of the spherical cornea bulge.

4. Filters, Combiners & Utility Nodes

πŸ”€ Normal Blend RNM (NormalBlend)

Blends a macro base normal map with a high-frequency micro detail normal map using mathematically exact Reoriented Normal Mapping (RNM):

$$\vec{n}_{\text{out}} = \text{normalize}\left(\vec{t} \times \vec{u} - \vec{t}_z \vec{u}_z\right)$$

  • Inputs:
    • Base Normal (RGB): Primary geometry normal map.
    • Detail Normal (RGB): High-frequency micro normal map (e.g. skin pores, fabric weave).
  • Outputs:
    • Blended Normal (RGB): Perfectly blended composite normal map.
  • Properties:
    • Detail Scale ($0.0 - 5.0$): Intensity multiplier for the micro detail layer.
    • Detail Repeat ($1.0 - 50.0$): UV tiling repeat factor for the detail normal.

🎨 Color Blend (ColorBlend)

Combines two textures or colors using standard digital compositing operators.

  • Inputs:
    • Base (RGBA): Background layer.
    • Blend (RGBA): Foreground layer.
  • Outputs:
    • Result (RGBA): Composite image.
  • Properties:
    • Blend Mode: Mix / Linear, Multiply, Screen, Overlay, Add, Subtract.
    • Blend Factor ($0.0 - 1.0$): Opacity / mix weight.

πŸ“¦ Channel Packer (ChannelPacker)

Packs up to 4 grayscale maps into the Red, Green, Blue, and Alpha channels of a single composite texture.

  • Inputs: R (Red), G (Green), B (Blue), A (Alpha).
  • Outputs: RGBA (Combined).
  • Properties: Default value ($0 - 255$) used whenever an input pin is unplugged.

βœ‚ Channel Splitter (ChannelSplitter)

Deconstructs a packed RGBA texture into 4 individual scalar channels.

  • Inputs: RGBA (Source).
  • Outputs: R, G, B, A.

5. Master Output Node

🎯 Ray-MMD Master Output (RayMaterialOutput)

The master terminus of the material graph. Evaluates the graph, updates the real-time viewport, and compiles all channels into a complete Ray-MMD ReForge material package (.fx + textures).

  • Input Pins (14 Channels):
    • 0: Albedo: Base color texture map.
    • 1: Albedo Sub: Secondary albedo layer (sheen or tint).
    • 2: Alpha: Scalar opacity / cutout mask.
    • 3: Normal: Tangent-space macro normal map.
    • 4: Roughness / Smoothness: Microfacet roughness or smoothness map.
    • 5: Metalness: Dielectric/conductor mask ($0.0 = \text{dielectric}, 1.0 = \text{metal}$).
    • 6: Specular: Microfacet specular reflectance $F_0$ color map.
    • 7: AO: Ambient occlusion cavity mask.
    • 8: Height: Depth / displacement height map.
    • 9: Emissive: Self-illumination color map.
    • 10: Custom A: Dedicated scalar parameter map for active shading model.
    • 11: Custom B: Dedicated color / vector map for active shading model.
    • 12: Detail Normal: High-frequency micro detail normal.
    • 13: Normal Sub: Secondary normal map (e.g. hair strands, clothing weave) blended via Reoriented Normal Mapping (RNM).
  • Settings:
    • Material Name: Prefix used when exporting .fx and textures.
    • Shading Model: 0: Standard, 1: Skin, 3: Anisotropy, 4: Glass, 5: Cloth, 6: ClearCoat, 7: Subsurface, 8: CelShading, 9: ToonShading.
    • Roughness Mode: When checked, automatically inverts the connected Roughness input into Ray-MMD's native Smoothness convention ($S = 1.0 - R$).
    • Sub-Normal Controls:
      • Scale ($0.0 - 5.0$): Multiplier for the secondary normal strength.
      • Loop / Tiling ($0.1 - 100.0$): UV tiling repeat factor for normal_sub.png.
      • Viewport features full real-time Reoriented Normal Mapping (RNM) composite preview.
    • Hair & Eye Special FX:
      • Procedural Hair Enable: Emits #define PROCEDURAL_HAIR 1 in exported .fx to activate Ray-MMD's multi-frequency harmonic highlight breakup equation (hairNoise = sin(nx) * 0.4 + sin(nx * 1.732) * 0.3 + sin(nx * 3.1415) * 0.3).
      • Procedural Hair Scale ($0.1 - 100.0$) & Intensity ($0.0 - 2.0$): Spatial frequency and highlight perturbation amplitude.
      • Convex Normal Enable: Emits #define CONVEX_NORMAL 1 in exported .fx to invert eye mesh curvature ($\mathbf{N}{xy} = -\mathbf{N}{xy}$), turning flat or concave anime eyes into convex refractive corneal domes.
      • Eye Parallax Enable: Emits #define EYE_PARALLAX_ENABLE 1 in exported .fx to activate screen-space Snell's law refraction raymarching across the anterior chamber.
      • Eye Iris Depth ($0.001 - 0.5$): Sets EYE_IRIS_DEPTH ($0.05$).
      • Eye Cornea IOR ($1.0 - 2.0$): Sets EYE_CORNEA_IOR ($1.376$).
    • Emissive Blink Mode:
      • 0: None: Static glow.
      • 1: Constant Frequency: Sinusoidal pulsing with independent RGB frequency control.
      • 2: Morph Controller: Pulsing driven by MMD facial morphs.
    • Hex-Tiling (Mikkelsen 2022): Enables stochastic hexagonal texture bomb tiling in the generated .fx to eliminate visible tiling patterns on large stage floors or terrains.
    • Hashed Alpha Cutout: Enables stochastic alpha cutout for hair cards and foliage without sorting artifacts.
    • Detail Normal Micro-surface: Activates secondary detail normal blending in the exported .fx shader.

Practical Workflows & Tutorials

Tutorial 1: Instant PBR from a Single Diffuse Texture (Auto-PBR)

  1. In Single Material Mode, click «⚑ Auto PBR from Image...» in the left sidebar.
  2. Select your diffuse texture (e.g. stone_diffuse.png).
  3. The editor automatically builds a complete node network:
    • ImageInput $\to$ HeightGenerator $\to$ NormalGenerator $\to$ Normal output pin.
    • HeightGenerator $\to$ AOGenerator $\to$ Occlusion output pin.
    • HeightGenerator $\to$ RoughnessGenerator $\to$ Smoothness output pin.
    • ImageInput $\to$ MetalnessGenerator $\to$ Metalness output pin.
  4. Preview the material on the 3D sphere with dynamic Cook-Torrance GGX lighting.
  5. Adjust sliders in the graph to fine-tune roughness range and normal strength.
  6. Click Β«πŸ’Ύ Export Ray-MMD PackageΒ» to generate your .fx file and companion maps in a single folder.

Tutorial 2: Living Specular: Eliminating "Plastic" CG Highlights (Roughness Breakup)

When 3D surfaces have uniform specular highlights, they look unnaturally synthetic. To create organic, physical micro-roughness:

  1. Start with your base roughness (from RoughnessGenerator or a ColorInput gray value).
  2. Create a ProceduralNoise node:
    • Set Noise Type to Perlin fBm.
    • Set Scale = 6.0, Octaves = 4, Gain = 0.5.
  3. Add a ColorBlend node:
    • Connect base roughness $\to$ Base.
    • Connect ProceduralNoise $\to$ Blend.
    • Set Blend Mode to Overlay and Factor = 0.30.
  4. Plug the result into the Smoothness input pin of RayMaterialOutput.
  5. Rotate the light in the 3D viewport (Ctrl + LMB): the specular highlight will organically deform across subtle surface smudges and handling wear, instantly removing the artificial plastic look.

Tutorial 3: Procedural Micro-Surface Detailing (Pores & Fabric Weave)

To add realistic micro-surface detail (such as human skin pores, leather wrinkles, or fabric weave) without high-resolution source textures:

  1. Create a ProceduralNoise node and set Noise Type to Voronoi Cellular with Scale = 35.0 (for skin pores) or 20.0 (for leather).
  2. Connect Noise $\to$ NormalGenerator (Scale = 1.2, Filter = Scharr, Orientation = DirectX).
  3. Add a NormalBlend (RNM) node.
  4. Plug your base macro normal into Base Normal, and the procedural Voronoi normal into Detail Normal.
  5. Set Detail Repeat = 8.0 and Detail Scale = 1.0.
  6. Plug the result into the Normal pin of RayMaterialOutput.
  7. Rotate the light in the 3D viewport (Ctrl + LMB) to observe crisp grazing-angle micro-highlights.

Tutorial 4: Multi-Channel Weathering (Rust, Patina & Dirt Masking)

To create aged surfaces where paint is worn away by oxidation or grime:

  1. Create a ProceduralNoise node (Noise Type = Perlin fBm, Scale = 3.5, Octaves = 5). This serves as the master wear distribution mask.
  2. Color Layering (Albedo):
    • Add a ColorBlend node (Blend Mode = Mix).
    • Plug your clean paint texture/color into Base.
    • Plug a dark reddish-brown rust color (ColorInput) into Blend.
    • Connect ProceduralNoise into the blend factor/modulator.
    • Connect the result to Albedo.
  3. Dielectric Transition (Metalness):
    • Raw oxidized rust is a dielectric non-metal, whereas bare steel is a conductor.
    • Feed the noise mask into a RoughnessGenerator with Invert = true (clean steel $= 1.0$ metallic, rust patches $= 0.0$ dielectric) and plug into Metalness.
  4. Surface Relief (Normal):
    • Pitted rust swells outward and flakes. Feed the same ProceduralNoise into a NormalGenerator (Scale = 2.0, Filter = Scharr) and plug into Normal.
  5. Result: A fully synchronized, physically coherent material where rust patches exhibit distinct color, non-metallic dielectric response, increased micro-roughness, and raised surface relief simultaneously from a single procedural noise node.

Tutorial 5: PMX Model Studio & Batch Auto-PBR

To convert an entire MMD model (stage or character) to physical PBR in seconds:

  1. Click Β«πŸ’ƒ PMX StudioΒ» on the top menu bar.
  2. Click Β«πŸ“‚ Open PMXΒ» and select your model file (e.g. Cafe.pmx or Model.pmx).
  3. The model loads into the 3D viewport with all subsets listed in the left panel.
  4. Direct 3D Picking: Click directly on any object in the 3D viewport (e.g. the floor or a chair) to immediately highlight and select its material subset.
  5. Click «⚑ Batch Auto-PBR All» in the subset header:
    • The editor scans all subsets for diffuse textures.
    • Using multi-threaded CPU parallelization (Rayon), it synthesizes complete PBR node graphs and maps for every material simultaneously.
  6. Toggle Β«WireframeΒ» in the viewport toolbar to verify mesh topology and subset boundaries.
  7. Switch to the Β«πŸ–Ό 2D Texture ViewerΒ» and enable Β«UV WireframeΒ» to inspect UV triangle unwrap layouts directly over the generated texture maps.
  8. Click Β«πŸ’Ύ Export All MaterialsΒ» in the left panel:
    • The editor exports all subset materials into a materials_reforge/ folder next to your PMX model, complete with unique .fx files and texture sets ready to assign in MikuMikuDance!

Tutorial 6: Silky Anisotropic Hair with Procedural Strands & Marschner Tangent Shift

To author lustrous anime or realistic character hair with physical anisotropic highlight breakup:

  1. From the top menu «Presets», select «✨ Silky Hair (Anisotropic + Strands)», or build manually:
  2. Hair Base Setup:
    • In RayMaterialOutput, set Shading Model to 3: Anisotropy (SHADINGMODELID_HAIR).
    • Set base Albedo Color to your desired hair shade (e.g. golden blonde or chestnut brown).
    • Under Hair & Eye Special FX, check Β«Procedural Hair EnableΒ» with Scale = 50.0 and Intensity = 0.5. This activates Ray-MMD's mathematical highlight perturbation equation.
  3. Procedural Strand Generation:
    • Create a HairStrandGenerator node:
      • Set Strand Density = 35.0 (for broad anime locks) or 150.0 (for fine fibers).
      • Set Roughness = 0.35, Waviness = 0.15, Wave Frequency = 6.0.
      • Choose Orientation = Vertical (matching hair UV flow).
  4. Channel Wiring:
    • Connect Normal (Strands) $\to$ Normal Sub (Pin 13) of RayMaterialOutput.
    • Set Normal Sub Scale = 1.2 and Normal Sub Loop = 1.0. The editor blends this with your head/card macro normal using Reoriented Normal Mapping (RNM).
    • Connect Tangent Shift (Silky) $\to$ Custom B (Pin 11). This provides the microfacet shift jitter (equivalent to shift4.png) required for Kajiya-Kay / Marschner secondary specular rings.
    • Connect Strand Mask into a RoughnessGenerator $\to$ Roughness (Pin 4) to ensure specular glossiness follows individual hair fiber depths.
  5. Result: Crisp, unbroken anisotropic specular rings that catch light from any angle with silky microscopic fiber relief.

Tutorial 7: Anime Eyes with Convex Cornea Dome & Snell's Law Parallax

To eliminate flat or sunken "dead" anime eye reflections and achieve deep, living gaze reflections:

  1. From the top menu Β«PresetsΒ», select Β«πŸ‘ Anime Eye (Cornea Dome + Iris Parallax)Β», or build manually:
  2. Source Texture:
    • Add an ImageInput node and load your character's flat iris/pupil texture.
  3. Cornea & Parallax Synthesis:
    • Add an EyeCorneaGenerator node and connect ImageInput $\to$ Iris Color (Optional).
    • Configure anatomical properties:
      • Iris Depth = 0.05 (anterior chamber depth).
      • Cornea IOR = 1.376 (physical human corneal refractive index).
      • Limbal Ring Width = 0.08, Limbal Darkness = 0.70.
      • Caustic Intensity = 0.35, Dome Curvature = 1.0.
  4. Master Output Wiring:
    • In RayMaterialOutput, select Shading Model = 0: Standard or 6: ClearCoat.
    • Under Hair & Eye Special FX:
      • Check Β«Convex Normal EnableΒ» (CONVEX_NORMAL 1).
      • Check Β«Eye Parallax EnableΒ» (EYE_PARALLAX_ENABLE 1).
      • Set Iris Depth = 0.05 and Cornea IOR = 1.376.
    • Connect Refracted Iris $\to$ Albedo (Pin 0).
    • Connect Cornea Dome Normal $\to$ Normal (Pin 3).
    • Connect Iris Parallax Map $\to$ Parallax (Pin 8).
    • Connect Limbal & Caustic Map $\to$ Albedo Sub (Pin 1).
    • Set Smoothness = 0.95 (mirror-gloss wet corneal tear film).
  5. Result: The flat eye mesh instantly transforms into a convex optical lens. Rotating the light (Ctrl + LMB) creates spherical highlights that wrap around the cornea, while viewing at oblique angles reveals deep 3D iris immersion with Snell's law refraction.

Ray-MMD Mapping Convention Summary

Channel Name Texture Format Value Range Ray-MMD HLSL Macro
Albedo sRGB RGBA $0.0 - 1.0$ ALBEDO_MAP_ENABLE
Albedo Sub sRGB RGBA $0.0 - 1.0$ ALBEDO_SUB_ENABLE
Normal Linear DirectX (-Y) $\pm 1.0$ NORMAL_MAP_ENABLE
Normal Sub Linear DirectX (-Y) $\pm 1.0$ NORMAL_SUB_MAP_ENABLE (normalSubMapScale)
Detail Normal Linear DirectX (-Y) $\pm 1.0$ DETAIL_NORMAL_MAP_ENABLE
Smoothness Linear Grayscale $0.0\text{ (rough)} - 1.0\text{ (smooth)}$ SMOOTHNESS_MAP_ENABLE
Metalness Linear Grayscale $0.0\text{ (dielectric)} - 1.0\text{ (metal)}$ METALIC_MAP_ENABLE
Occlusion Linear Grayscale $0.0\text{ (shadowed)} - 1.0\text{ (open)}$ OCCLUSION_MAP_ENABLE
Parallax Linear Grayscale $0.0\text{ (bottom)} - 1.0\text{ (top)}$ PARALLAX_MAP_ENABLE
Emissive sRGB / HDR RGB $0.0 - 20.0+$ EMISSIVE_MAP_ENABLE
Custom A Linear Grayscale Shading Model Dependent CUSTOM_ENABLE (customDataA)
Custom B Linear RGB Shading Model Dependent CUSTOM_ENABLE (customDataB)
Procedural Hair Algorithmic HLSL High-frequency harmonic perturbation #define PROCEDURAL_HAIR 1
Convex Eye Normal Algorithmic HLSL Inverted tangent curvature $\mathbf{N}{xy} = -\mathbf{N}{xy}$ #define CONVEX_NORMAL 1
Eye Iris Parallax Screen-Space Raymarch Snell's law refraction raymarching #define EYE_PARALLAX_ENABLE 1

Clone this wiki locally