Skip to content

[pbr] Create a DirectionalLightBundle #2367

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

Closed

Conversation

dannymcgee
Copy link

Objective

Solution

  • Created a DirectionalLightBundle in bevy_pbr with Transform and GlobalTransform components
  • Added the DirectionalLight component to the PbrPlugin's registered types
  • Updated the 3d_scene example by replacing the PointLightBundle with the DirectionalLightBundle*

*I tried to keep the appearance of the lighting pretty close to the original scene, so the only real difference should be that the new light doesn't have any fall-off. But I could create a new example instead if that would be preferred.

@github-actions github-actions bot added the S-Needs-Triage This issue needs to be labelled label Jun 20, 2021
@TheRawMeatball TheRawMeatball added C-Feature A new feature, making something new possible C-Examples An addition or correction to our examples A-Rendering Drawing game state to the screen and removed S-Needs-Triage This issue needs to be labelled labels Jun 20, 2021
@dannymcgee dannymcgee requested a review from NathanSWard June 21, 2021 00:41
@mockersf
Copy link
Member

bors try

bors bot added a commit that referenced this pull request Jun 21, 2021
@bors
Copy link
Contributor

bors bot commented Jun 21, 2021

try

Build failed:

@NathanSWard NathanSWard added the S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it label Jun 22, 2021
@cart
Copy link
Member

cart commented Jul 10, 2021

Normally I would merge this because it is relatively uncontroversial and provides useful functionality, but we are planning on overhauling bevy_render prior to 0.6 and I'd prefer to hold off on merging more changes to the current renderer. I think we should leave this open. If the renderer overhaul lands prior to 0.6 (which we're working very hard to do), we can close this out. If not, we can merge this to provide some extra value in 0.6.

@mockersf mockersf added the S-Pre-Relicense This PR was made before Bevy added the Apache license. Cannot be merged or used for other work label Jul 16, 2021
@mockersf
Copy link
Member

there is now a

/// A component bundle for [`DirectionalLight`] entities.
#[derive(Debug, Bundle, Default)]
pub struct DirectionalLightBundle {
pub directional_light: DirectionalLight,
pub frustum: Frustum,
pub visible_entities: VisibleEntities,
pub transform: Transform,
pub global_transform: GlobalTransform,
}
in main

@mockersf mockersf closed this Dec 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Rendering Drawing game state to the screen C-Examples An addition or correction to our examples C-Feature A new feature, making something new possible S-Pre-Relicense This PR was made before Bevy added the Apache license. Cannot be merged or used for other work S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it
Projects
None yet
Development

Successfully merging this pull request may close these issues.

add DirectionalLightBundle similar to PointLightBundle
5 participants