bevyengine / bevy

A refreshingly simple data-driven game engine built in Rust
https://bevyengine.org
Apache License 2.0
35.99k stars 3.55k forks source link

Warn when no camera exists to render an object #1432

Open alice-i-cecile opened 3 years ago

alice-i-cecile commented 3 years ago

What problem does this solve or what need does it fill?

Beginners commonly attempt to get started with adding 2D/3D/UI graphics, forget to add a camera, and then are confused when nothing appears.

What solution would you like?

Warn when no camera of the appropriate type exists.

What alternative(s) have you considered?

Improve documentation further, especially in the Bevy book.

Additional context

The exact timing / details of when this should trigger need some work by others who understand the rendering pipeline more clearly.

We should also be careful not to create unsilenceable warnings in cases where the lack of camera may actually be intended.

cart commented 3 years ago

From a comment I left in #1440:

I think my ideal solution is to make the UiCamera completely optional (and fall back to a default value). Most people don't need control over the UI camera, so theres no real reason to dictate one (other than the fact that its easier to require one because that behavior is consistent with the other render passes)

cart commented 3 years ago

The same argument could be made for 2D render passes. But 3d has no "reasonable default", so it might make sense to warn if you try to draw a 3d object when there is no camera.

wduminy commented 11 months ago

I am here because this issue is marked as a good first issue.

However, related items indicate that this issue is possibly resolved.

Is there any more work to be done here?

richchurcher commented 3 months ago

Hrm :thinking: The associated PR was closed because it added a check on each frame. The goal is to achieve a warning without using a system. I'll take a poke around, see what the current state is, and whether there might be a semi-obvious solution in 2024.

richchurcher commented 3 months ago

Well now you've added D-Complex 🙀 😆

I see UI is already warning about this via a system: image I'll see if there's anything else to be uncovered that doesn't mess with rendering too badly.

alice-i-cecile commented 3 months ago

If it's taken 3 years and multiple attempts to fix I am forced to revise my estimation of difficulty upwards ;)

richchurcher commented 1 month ago

Yeah, I'm gonna call defeat on this one until I am more of an "expert" (or less of an ignoramus!)