Parent: #126
Problem
Bloom's glTF import currently cannot represent standard physically based translucent content faithfully. In particular, alphaMode: BLEND is treated as cutout/mask behavior and transmission is approximated as a mirror-like material. This breaks glass, decals, foliage edges, smoke-like surfaces, and canonical glTF assets before lighting quality is even evaluated.
Outcome
Spec-correct glTF alpha modes plus a production translucent/refractive path:
OPAQUE, MASK, and BLEND preserve their distinct semantics;
KHR_materials_transmission, KHR_materials_volume, and IOR produce thickness-aware refraction and Beer-Lambert absorption;
- transparent ordering/composition has a documented high-quality path and constrained fallback;
- asset import never silently changes a blend material into a cutout or chrome substitute.
Import contract
Update native/shared/src/models_gltf.rs and cooked material metadata to preserve:
- alpha mode, cutoff, base-color alpha, double-sided flag, and texture transforms;
- transmission factor/texture, thickness factor/texture, attenuation distance/color, and IOR;
- whether thickness is authored, approximated, or unavailable;
- unsupported extension diagnostics with asset/material names.
Round-trip these values through scene/world serialization where applicable.
Render architecture
Buckets
- Opaque: existing deferred/visibility path.
- Masked: opaque depth/shadow semantics with coverage preservation through mip levels; alpha-to-coverage where MSAA supports it.
- Transparent: forward shading after opaque lighting with depth test/no opaque-depth write.
- Refractive: forward pass with explicit scene-color/depth input supplied by the render graph.
Composition
Implement one production baseline:
- depth-sort conventional alpha for small/simple sets; and
- weighted blended OIT (or a better documented bounded alternative) for intersecting/high-count surfaces.
Expose the selected mode/capability. Sorting keys must be deterministic and account for material bucket, depth, and stable object ID.
Refraction/transmission
- Reconstruct entry/exit distance from authored thickness, backface/depth information, or a clearly labeled approximation.
- Apply Snell refraction using material IOR and Beer-Lambert absorption using attenuation color/distance.
- Sample the correct pre-translucency scene-color snapshot; prevent read/write feedback.
- Use SSR/planar/ray-query/env fallback hierarchy for reflection without treating missing reflection data as full mirror energy.
- Conserve energy between reflection, transmission, absorption, and diffuse lobes.
GI, shadows, temporal
- Transparent objects receive direct/IBL lighting.
- Masked objects participate in shadows, velocity, depth, and GI surface representation.
- Transparent motion/reactive data is provided to temporal reconstruction where possible; otherwise mark reactive regions to prevent history smearing.
- Define whether/how refractive objects cast shadows; unsupported colored transmission is explicit.
Acceptance criteria
Likely files
native/shared/src/models_gltf.rs, models.rs
native/shared/src/renderer/material_pipeline.rs, material_system.rs, scene_pass.rs, graph.rs
native/shared/shaders/material_abi.wgsl and shared shader modules
src/models/, world material serialization, quality/capability APIs
Verification
Attach stills and motion captures against approved glTF reference renders, plus GPU timings and overdraw statistics for sorted and OIT modes.
Non-goals
- Strand hair rendering.
- Spectral dispersion.
- Order-independent refraction of arbitrarily deep nested dielectrics.
Dependencies
Parent: #126
Problem
Bloom's glTF import currently cannot represent standard physically based translucent content faithfully. In particular,
alphaMode: BLENDis treated as cutout/mask behavior and transmission is approximated as a mirror-like material. This breaks glass, decals, foliage edges, smoke-like surfaces, and canonical glTF assets before lighting quality is even evaluated.Outcome
Spec-correct glTF alpha modes plus a production translucent/refractive path:
OPAQUE,MASK, andBLENDpreserve their distinct semantics;KHR_materials_transmission,KHR_materials_volume, and IOR produce thickness-aware refraction and Beer-Lambert absorption;Import contract
Update
native/shared/src/models_gltf.rsand cooked material metadata to preserve:Round-trip these values through scene/world serialization where applicable.
Render architecture
Buckets
Composition
Implement one production baseline:
Expose the selected mode/capability. Sorting keys must be deterministic and account for material bucket, depth, and stable object ID.
Refraction/transmission
GI, shadows, temporal
Acceptance criteria
BLENDproduces fractional coverage, never binary cutoff.tools/bloom-reference/Cycles.Likely files
native/shared/src/models_gltf.rs,models.rsnative/shared/src/renderer/material_pipeline.rs,material_system.rs,scene_pass.rs,graph.rsnative/shared/shaders/material_abi.wgsland shared shader modulessrc/models/, world material serialization, quality/capability APIsVerification
Attach stills and motion captures against approved glTF reference renders, plus GPU timings and overdraw statistics for sorted and OIT modes.
Non-goals
Dependencies