Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unify RenderLayers and TargetCamera (Part 1: RenderGroups) [ADOPT ME] #12502

Open
wants to merge 54 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
faba920
add RenderGroups (WIP)
UkoeHB Mar 15, 2024
756191b
typo
UkoeHB Mar 15, 2024
0d302b1
integration WIP
UkoeHB Mar 16, 2024
ac31198
propagation algorithm WIP
UkoeHB Mar 17, 2024
1b7c495
propagation algorithm WIP
UkoeHB Mar 17, 2024
bd468dc
propagation algorithm WIP
UkoeHB Mar 18, 2024
481a801
propagation algorithm early draft
UkoeHB Mar 18, 2024
7702347
render groups compiles
UkoeHB Mar 18, 2024
646c53b
propagate render groups compiles
UkoeHB Mar 18, 2024
f07b7a5
fmt
UkoeHB Mar 18, 2024
36d7aeb
integration (WIP) compiles
UkoeHB Mar 18, 2024
a4563ac
fixes for render groups usage
UkoeHB Mar 18, 2024
d622489
rearrange
UkoeHB Mar 18, 2024
4b4bed3
cleanup
UkoeHB Mar 18, 2024
829be8a
fmt
UkoeHB Mar 18, 2024
064d276
eliminate spurious allocations
UkoeHB Mar 18, 2024
a70bd8c
finish removing old RenderLayers
UkoeHB Mar 18, 2024
13994a3
cleanup
UkoeHB Mar 18, 2024
bc289e1
docs
UkoeHB Mar 18, 2024
7e8f073
fmt
UkoeHB Mar 18, 2024
ab44847
cleanup
UkoeHB Mar 19, 2024
1a7a4a2
clean up rendering pt.1
UkoeHB Mar 19, 2024
cc7ac69
add comment
UkoeHB Mar 19, 2024
dc8c7ba
refactor PBR lighting so light filtering occurs on the CPU
UkoeHB Mar 19, 2024
187b8c0
fmt
UkoeHB Mar 19, 2024
3a5ce6f
review comments
UkoeHB Mar 19, 2024
1b6e31b
lints
UkoeHB Mar 19, 2024
dab2d88
lints
UkoeHB Mar 19, 2024
a07d7dc
cleanup
UkoeHB Mar 20, 2024
98d6883
fix query access error
UkoeHB Mar 20, 2024
57a7702
add upper bounds on RenderLayer
UkoeHB Mar 20, 2024
6f90f28
add docs
UkoeHB Mar 20, 2024
4614a5d
rebase and fix debug_overlay
UkoeHB Mar 20, 2024
7ac9b04
CI fixes
UkoeHB Mar 20, 2024
d8a63c1
CI complaints
UkoeHB Mar 20, 2024
c82492b
more CI
UkoeHB Mar 20, 2024
35b8dca
CI again
UkoeHB Mar 20, 2024
75b3be2
don't use default RenderGroups when propagating
UkoeHB Mar 20, 2024
5c40a7f
API cleanup
UkoeHB Mar 20, 2024
64ce22e
fix directional lights not being applied properly
UkoeHB Mar 21, 2024
a646c14
Render groups example (#2)
viridia Mar 21, 2024
52870ee
update directional light intersections with entities so if a camera s…
UkoeHB Mar 21, 2024
6d9a32d
update examples template
UkoeHB Mar 21, 2024
b82a084
clippy
UkoeHB Mar 21, 2024
858b88f
add floor to example:
UkoeHB Mar 21, 2024
962d722
fix shadows appearing erroneously for point and spot lights when ligh…
UkoeHB Mar 22, 2024
266b048
cleanup example
UkoeHB Mar 22, 2024
62c04aa
fmt
UkoeHB Mar 22, 2024
6b4a2d3
add second camera to render groups example
UkoeHB Mar 23, 2024
19bacda
simplify: RenderGroups -> RenderLayers, CameraView -> CameraLayer, li…
UkoeHB Mar 26, 2024
48dc2ee
fix examples
UkoeHB Mar 26, 2024
fb9d417
try to fix render_to_texture example
UkoeHB Mar 26, 2024
9c826d8
fmt
UkoeHB Mar 26, 2024
6f3909c
remove unsafe blocker from bevy_pbr
UkoeHB Apr 1, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add floor to example:
  • Loading branch information
UkoeHB committed Apr 1, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit 858b88f6b1a93ea67402f4a886e1e88d5f4734f2
18 changes: 16 additions & 2 deletions examples/3d/render_groups.rs
Original file line number Diff line number Diff line change
@@ -19,7 +19,13 @@ fn main() {
#[derive(Component)]
struct MovedScene;

fn setup(mut commands: Commands, asset_server: Res<AssetServer>) {
fn setup(
mut commands: Commands,
asset_server: Res<AssetServer>,
mut meshes: ResMut<Assets<Mesh>>,
mut materials: ResMut<Assets<StandardMaterial>>,
) {
// Camera
commands.spawn((
Camera3dBundle {
transform: Transform::from_xyz(0., 1.4, 2.0)
@@ -34,6 +40,14 @@ fn setup(mut commands: Commands, asset_server: Res<AssetServer>) {
CameraView::from_layers(&[0, 1, 2, 3, 4, 5, 6]),
));

// Plane
commands.spawn(PbrBundle {
mesh: meshes.add(Plane3d::default().mesh().size(5000.0, 5000.0)),
material: materials.add(Color::srgb(0.3, 0.5, 0.3)),
..default()
});

// Text
commands.spawn((
TextBundle::from_section(
"Press '1..3' to toggle mesh render layers\n\
@@ -69,7 +83,7 @@ fn setup(mut commands: Commands, asset_server: Res<AssetServer>) {
let colors = [
palettes::basic::RED,
palettes::basic::GREEN,
palettes::basic::AQUA,
palettes::basic::NAVY,
];
for (i, color) in (0..3).zip(colors.iter()) {
commands.spawn((