Render/Light layers data in shader example
- Dominant language
- Rust
- Stars
- 48.2k
- Forks
- 4.8k
- Avg merge
- 3d 22h
- Merged PRs (30d)
- 161
Description
## What problem does this solve or what need does it fill?
Add example of Render/Light layers data used in shader.
## What solution would you like?
Similarly to volumetric light:
`
#import bevy_pbr::mesh_view_types::DIRECTIONAL_LIGHT_FLAGS_VOLUMETRIC_BIT
....
if (((*light).flags & DIRECTIONAL_LIGHT_FLAGS_VOLUMETRIC_BIT) == 0)
{
......
}
.....
`
If specific post-fx (or shader in general) is requesting light data, only lights with particular u32 is used.
Close, but not exact example form existing games/media is
something that remotely resembles magic lamp from 2015 game _The Witcher 3_ by CDPR.

Disclaimer:
1 I HAVE NO IDEA HOW IT IS IMPLEMENTED IN MENTIONED GAME
2 I HAVE NO RELATION TO CDPR
3 THIS MENTION OF GAME ISN'T SPONSORED OR PAID
Main idea is to have simple and reusable system.
It should work with all types of lights, not only directional.
## Proposed workflow
1. Set struct _light.shader_layer_ bits u32 in rust code
2. Use it in wgsl code _(*light).shader_layer_
Contributor guide
Assessment
This issue has not been assessed yet.