-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Open
Labels
A-RenderingDrawing game state to the screenDrawing game state to the screenC-BugAn unexpected or incorrect behaviorAn unexpected or incorrect behaviorD-StraightforwardSimple bug fixes and API improvements, docs, test and examplesSimple bug fixes and API improvements, docs, test and examplesS-Ready-For-ImplementationThis issue is ready for an implementation PR. Go for it!This issue is ready for an implementation PR. Go for it!
Description
Problem:
Components that have both #[derive(ExtractComponent)] and #[require] attributes create their required components when extracting into the render world, which is probably not what the user intended and can lead to surprising results.
@robtfm identified the following cases:
- Camera2d - has ExtractComponent and requires Camera (+ other components)
- Camera3d - has ExtractComponent and requires Camera (+ other components)
- ClusteredDecal - has ExtractComponent and requires Transform, Visibility, VisibilityClass
- ScreenSpaceAmbientOcclusion - has ExtractComponent and requires DepthPrepass, NormalPrepass
- FogVolume - has ExtractComponent and requires Transform, Visibility
- AmbientLight has #[require(Camera)] which doesn't make semantic sense (AmbientLight is not IsA Camera)
- MaterialNode is being extracted but probably shouldn't be
Solution
- Add compile-time error when a component has both ExtractComponent and #[require] attributes
- Newtype the affected components for extraction to avoid the require behavior
- Remove #[require(Camera)] from AmbientLight
- Remove extraction from MaterialNode if not needed
vladbat00
Metadata
Metadata
Assignees
Labels
A-RenderingDrawing game state to the screenDrawing game state to the screenC-BugAn unexpected or incorrect behaviorAn unexpected or incorrect behaviorD-StraightforwardSimple bug fixes and API improvements, docs, test and examplesSimple bug fixes and API improvements, docs, test and examplesS-Ready-For-ImplementationThis issue is ready for an implementation PR. Go for it!This issue is ready for an implementation PR. Go for it!