Skip to content

[Merged by Bors] - Per-light toggleable shadow mapping#3126

Closed
superdump wants to merge 3 commits intobevyengine:pipelined-renderingfrom
superdump:toggleable-shadow-mapping
Closed

[Merged by Bors] - Per-light toggleable shadow mapping#3126
superdump wants to merge 3 commits intobevyengine:pipelined-renderingfrom
superdump:toggleable-shadow-mapping

Conversation

@superdump
Copy link
Contributor

Objective

Allow shadow mapping to be enabled/disabled per-light.

Solution

  • NOTE: This PR is on top of [Merged by Bors] - Add support for opaque, alpha mask, and alpha blend modes #3072
  • Add shadows_enabled boolean property to PointLight and DirectionalLight components.
  • Do not update the frusta for the light if shadows are disabled.
  • Do not check for visible entities for the light if shadows are disabled.
  • Do not fetch shadows for lights with shadows disabled.
  • I reworked a few types for clarity: ViewLight -> ShadowView, the bulk of ViewLights members -> ViewShadowBindings, the entities Vec in ViewLights -> ViewLightEntities, the uniform offset in ViewLights for GpuLights -> ViewLightsUniformOffset

@superdump superdump force-pushed the toggleable-shadow-mapping branch from a6b8b4a to d869760 Compare November 13, 2021 19:30
@alice-i-cecile alice-i-cecile added A-Rendering Drawing game state to the screen C-Feature A new feature, making something new possible labels Nov 13, 2021
@alice-i-cecile alice-i-cecile added this to the Bevy 0.6 milestone Nov 13, 2021
@superdump superdump force-pushed the toggleable-shadow-mapping branch from d869760 to fc0a2c2 Compare November 17, 2021 10:38
@superdump superdump force-pushed the toggleable-shadow-mapping branch from fc0a2c2 to 760f279 Compare November 18, 2021 06:08
@cart
Copy link
Member

cart commented Nov 19, 2021

With the exception of the comment above this looks good to me!

@cart
Copy link
Member

cart commented Nov 19, 2021

bors r+

bors bot pushed a commit that referenced this pull request Nov 19, 2021
# Objective

Allow shadow mapping to be enabled/disabled per-light.

## Solution

- NOTE: This PR is on top of #3072
- Add `shadows_enabled` boolean property to `PointLight` and `DirectionalLight` components.
- Do not update the frusta for the light if shadows are disabled.
- Do not check for visible entities for the light if shadows are disabled.
- Do not fetch shadows for lights with shadows disabled.
- I reworked a few types for clarity: `ViewLight` -> `ShadowView`, the bulk of `ViewLights` members -> `ViewShadowBindings`, the entities Vec in `ViewLights` -> `ViewLightEntities`, the uniform offset in `ViewLights` for `GpuLights` -> `ViewLightsUniformOffset`

Co-authored-by: Carter Anderson <mcanders1@gmail.com>
@bors
Copy link
Contributor

bors bot commented Nov 19, 2021

@bors bors bot changed the title Per-light toggleable shadow mapping [Merged by Bors] - Per-light toggleable shadow mapping Nov 19, 2021
@bors bors bot closed this Nov 19, 2021
@parasyte
Copy link
Contributor

@superdump @cart This PR disables all shadows in the examples. Was that intentional? Examples checked:

  • shadow_biases_pipelined
  • shadow_caster_receiver_pipelined

@superdump
Copy link
Contributor Author

@superdump @cart This PR disables all shadows in the examples. Was that intentional? Examples checked:

  • shadow_biases_pipelined
  • shadow_caster_receiver_pipelined

I’ll reenable them when the branch is merged into main. After discussion above it was decided to flip the default to disabled and the impact on examples was overlooked. :)

bors bot pushed a commit that referenced this pull request Nov 27, 2021
# Objective

- As mentioned in #3126, shadows need to be readded in examples

## Solution

- Add shadows in examples
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-Feature A new feature, making something new possible

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants