bevy/assets/models
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
..
AlienCake add an example using UI & states to create a game menu (#2960) 2022-01-14 19:09:42 +00:00
animated Add morph targets (#8158) 2023-06-22 20:00:01 +00:00
barycentric Add support for custom glTF vertex attributes. (#5370) 2023-04-24 14:20:13 +00:00
CornellBox Implement lightmaps. (#10231) 2024-01-02 20:38:47 +00:00
cube Hot asset reloading 2020-05-16 20:18:30 -07:00
FlightHelmet Asset system rework and GLTF scene loading (#693) 2020-10-18 13:48:15 -07:00
SimpleSkin Mesh Skinning. Attempt #3 (#4238) 2022-03-29 18:31:13 +00:00
sphere Hot asset reloading 2020-05-16 20:18:30 -07:00
terrain Add Distance and Atmospheric Fog support (#6412) 2023-01-29 15:28:56 +00:00
torus Remove monkey.gltf (#9974) 2023-09-30 02:50:31 +00:00
Box0.bin organize examples and add ecs guide 2020-05-01 13:12:47 -07:00