Replies: 1 comment 3 replies
-
|
This is an excellent writeup and I like to overall vision. It will definitely unlock more use cases for bevy like architecture visualization! I have a couple of questions, suggestions.
As for the photometric feature, I wouldn't gate it with a feature flag, instead rely on pipeline keys, shader defs to gate it . that is whether the user added that Spectral rendering pipeline: wow I am intrigued by the prospect of supporting full spectral rendering in bevy. This could be huge for simulating light dispersion for volumetrics and thin-film interference for materials. However it might clash with the overall vision for Bevy and this would need a wider scale discussion because would affect the whole PBR pipeline, introduce many challenges. It might be helpful to further specify what the real use case is for spectral rendering specifically in the cotext of archiviz and photometric light textures. Most cases I think can work around having to do a full spectral rendering pipeline. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
RFC: Native Photometric Lighting for Bevy
Summary
A proposal to add per-fragment photometric light profiles to Bevy — evaluating real measured luminaire distributions (IES/LDT/TM-33) directly in the PBR shader, rather than approximating with cubemap cookies or multiple spotlights.
Live demo (WebGPU required): https://iesna.eu/photometric_wip.html
Controls: 1-5 switch modes, H toggles heatmap, [/] switch LDT profiles, WASD/arrows camera
The Problem
No real-time engine properly supports photometric light profiles:
Architectural visualization, digital twins, and lighting design tools need accurate photometric rendering. Bevy's ECS architecture and WebGPU backend are well-suited for this.
Proposed Approach
Per-fragment angular intensity lookup
Instead of projecting from the light's perspective (cubemap cookie) or approximating with multiple spots, sample a 2D intensity texture at every fragment:
point_light(), convert light-to-fragment direction to (C, gamma) in luminaire local space → sample the texture → modulate intensityFormat support
ECS design
Compositional — not a new light type:
Comparison Table
ColorTemperaturecomponentImplementation Status
WIP Prototype
ColorTemperaturecomponent (Kelvin → linear RGB, Planckian locus approximation)PhotometricProfileasset type (R16Float equirectangular texture)IesLoader/LdtLoader— basic parsing, symmetry expansion, needs validationGpuClusteredLight::flagsupper 16 bits)pbr_photometric_lightsThe heatmap visualization in the demo shows the correct CPU-side sampling. The GPU shader path needs further work to match.
Prerequisites (PRs open)
Composes with
PointLightto LTC #23400 — LTC PointLight (merged into our experimental branch — photometric modulation × LTC area light evaluation)Phased Roadmap
PointLightto LTC #23400Questions for Discussion
Should photometric profiles reuse the existing light texture (cookie/decal) system, or be separate? We chose separate — cookies are projective (
local_from_world * pos), photometric is angular (inverse_rotation * normalize(dir)). Different parameterization.Where should format parsing live? Currently in
bevy_light. Could be a separatebevy_photometriccrate.How to handle the C-plane orientation ambiguity? IES and LDT define C0 differently, and manufacturers don't always follow the convention. Our current approach: no automatic rotation, user rotates via
Transform.Binding budget on Metal/WebGPU — photometric adds 3 bindings to group 1 (slots 8-10). Our Enable partial bindless on Metal and reduce bind group overhead (#18149) #23436 PR frees headroom for this.
References
Beta Was this translation helpful? Give feedback.
All reactions