bevy_fast_light: Simple 2D lighting for Bevy focused on performance over features #23239
leomeinel
started this conversation in
Show and tell
Replies: 1 comment
UpdateUpdated the description with current |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
I have been working on a crate that provides simple and customizable 2D lighting for Bevy in the shape of an attached
Mesh2d.If you are interested in how I did this, please take a look. I'm not sure if I will add any other types of lights since that might bloat up the codebase, but I'm very happy if I get feedback or suggestions :)
I also want to thank all bevy contributors for their awesome work and for making this possible. 🥇
About
Simple 2D lighting for Bevy focused on performance over features.
Features
Lights
AmbientLight2dcolorandintensityMeshLight2dcolor,intensityOccluders
MeshOccluder2dSpritesare rendered above occluders if they are on the same or a higher z-level. Also see Showcase.Mesh2d
The following
Componentsallow the customization of their shape via attaching aMesh2d:MeshLight2dMeshOccluder2dThe
Mesh2dis required for theComponentsto render.Limitations
Usage
Take a look at
/examplesto find out how to use this crate.Showcase
I am using most features in my learning project Slimy Mist and have also successfully implemented a day/night cycle.
This also visualizes how
Spritesare rendered above occluders if they are on the same or a higher z-level.Examples
ambient_light.rsScene with a light sky colored
AmbientLight2dwith a lowerintensity, a greenRectangleas background and an amberMeshLight2d.mesh_light.rsScene with a green
Rectangleas background and an amberMeshLight2d.mesh_occluder.rsScene with a light sky colored
AmbientLight2dwith a lowerintensity, a greenRectangleas background, an amberMeshLight2dand aMeshOccluder2d.texture_scale.rsScene with a green
Rectangleas background and an amberMeshLight2dusing a lowertexture_scale.Alternatives
Resources
Code
Articles
All reactions