-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Description
What problem does this solve or what need does it fill?
This proposes to kill several birds with one stone:
- Simplifying shaders by removing ambient lights and replacing them with simple 1x1 environment maps.
- Implementing hemispherical lights.
Creating environment maps for Bevy is a difficult process, particularly on Mac where you have to compile multiple C++ packages to get the tooling needed to do the conversion. Other game frameworks such as three.js provide a means to generate environment maps from an image at runtime.
Ambient lights can be emulated by a 1x1 environment map, which would mean that we could remove the shader code for ambient lights, thereby reducing the lines of code for our standard shaders.
What solution would you like?
From the discord:
foo.insert(EnvironmentMapLight::solid_color(SLATE_BLUE.into()))
foo.insert(EnvironmentMapLight::hemispherical_gradient(BLUE.into(), BROWN.into()))
The idea is to provide methods for generating simple environment maps from a set of parameters.
We should also offer a means to generate an environment map from an equirectangular image, but that is a more advanced project, and should probably be a separate issue.
For backwards compatibility, the AmbientLight
can be transformed into an environment map light, either via the constructor or perhaps by a hook of some kind.
What alternative(s) have you considered?
What I have done in the past is posted an image on Discord and had someone convert it to an environment map for me.
Additional context
Supersedes: #12027