bevy/assets
Patrick Walton dd14f3a477
Implement lightmaps. (#10231)
![Screenshot](https://i.imgur.com/A4KzWFq.png)

# Objective

Lightmaps, textures that store baked global illumination, have been a
mainstay of real-time graphics for decades. Bevy currently has no
support for them, so this pull request implements them.

## Solution

The new `Lightmap` component can be attached to any entity that contains
a `Handle<Mesh>` and a `StandardMaterial`. When present, it will be
applied in the PBR shader. Because multiple lightmaps are frequently
packed into atlases, each lightmap may have its own UV boundaries within
its texture. An `exposure` field is also provided, to control the
brightness of the lightmap.

Note that this PR doesn't provide any way to bake the lightmaps. That
can be done with [The Lightmapper] or another solution, such as Unity's
Bakery.

---

## Changelog

### Added
* A new component, `Lightmap`, is available, for baked global
illumination. If your mesh has a second UV channel (UV1), and you attach
this component to the entity with that mesh, Bevy will apply the texture
referenced in the lightmap.

[The Lightmapper]: https://github.com/Naxela/The_Lightmapper

---------

Co-authored-by: Carter Anderson <mcanders1@gmail.com>
2024-01-02 20:38:47 +00:00
..
android-res/mipmap-mdpi android example polish (#845) 2020-11-11 16:31:16 -08:00
branding Remove unused namespace declarations (#10965) 2023-12-13 22:29:16 +00:00
data Added Method to Allow Pipelined Asset Loading (#10565) 2023-11-16 17:47:31 +00:00
docs Improve Mesh documentation (#9061) 2023-07-31 18:55:42 +00:00
environment_maps EnvironmentMapLight, BRDF Improvements (#7051) 2023-02-09 16:46:32 +00:00
fonts Add the license for the FiraMono font (#3589) 2022-05-06 19:29:43 +00:00
lightmaps Implement lightmaps. (#10231) 2024-01-02 20:38:47 +00:00
models Implement lightmaps. (#10231) 2024-01-02 20:38:47 +00:00
pixel Add example for pixel-perfect grid snapping in 2D (#8112) 2023-12-26 17:15:50 +00:00
scenes Fix load scene example to use proper serialization format for rotation field (#10638) 2023-11-21 01:14:50 +00:00
shaders Fix binding group in custom_material_2d.wgsl (#10841) 2023-12-02 22:21:53 +00:00
sounds Add simple collision sound to breakout (#4331) 2022-04-14 20:20:38 +00:00
textures Add parallax mapping to bevy PBR (#5928) 2023-04-15 10:25:14 +00:00