Skip to content

Cameras Book Page - #2545

Draft
Based-A wants to merge 16 commits into
bevyengine:mainfrom
Based-A:camera-driven
Draft

Cameras Book Page#2545
Based-A wants to merge 16 commits into
bevyengine:mainfrom
Based-A:camera-driven

Conversation

@Based-A

@Based-A Based-A commented Jul 28, 2026

Copy link
Copy Markdown
Member

Last "core" part of the rendering chapter, Cameras! I would appreciate some reviews on this, as information is scattered and buried for the intricacies of cameras in Bevy. I think I have a good understanding and laid out everything relevant, but let me know if I've missed anything.

I also went back and added in links to this page from the Render Pipelines page to better link them together. Might still have to expand and clarify some of the connections, but I think they currently work.

Comment thread content/learn/book/the-renderer/camera-driven.md Outdated
Comment thread content/learn/book/the-renderer/camera-driven.md Outdated
Comment thread content/learn/book/the-renderer/camera-driven.md Outdated
Comment thread content/learn/book/the-renderer/camera-driven.md Outdated
Comment thread content/learn/book/the-renderer/camera-driven.md Outdated
Comment thread content/learn/book/the-renderer/camera-driven.md Outdated
Comment thread content/learn/book/the-renderer/camera-driven.md Outdated
Comment thread content/learn/book/the-renderer/camera-driven.md
Comment thread content/learn/book/the-renderer/camera-driven.md Outdated
Comment thread content/learn/book/the-renderer/camera-driven.md Outdated
Comment thread content/learn/book/the-renderer/camera-driven.md Outdated
Comment thread content/learn/book/the-renderer/camera-driven.md Outdated
Comment thread content/learn/book/the-renderer/camera-driven.md Outdated
Comment thread content/learn/book/the-renderer/camera-driven.md Outdated
Comment thread content/learn/book/the-renderer/camera-driven.md Outdated
Comment thread content/learn/book/the-renderer/camera-driven.md Outdated
Comment thread content/learn/book/the-renderer/camera-driven.md Outdated
Comment thread content/learn/book/the-renderer/camera-driven.md Outdated
Comment thread content/learn/book/the-renderer/camera-driven.md Outdated
Comment thread content/learn/book/the-renderer/camera-driven.md Outdated
Comment thread content/learn/book/the-renderer/camera-driven.md Outdated
Comment thread content/learn/book/the-renderer/camera-driven.md Outdated

@alice-i-cecile alice-i-cecile left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lots to fix, but it's a good place to start. Really need to nail the central dogma (core data flow), and then use that throughout to thread the pedagogical structure. How about big idea -> simple one camera case -> tools for working with multiple cameras -> a few worked examples of multiple camera setups?

More suggested additions:

  1. Clear color (really easy to footgun yourself with multiple cameras)
  2. Viewport-to-world / world-to-viewport + viewport node widget breadcrumb

Comment thread content/learn/book/the-renderer/camera-driven.md Outdated
@Based-A
Based-A requested a review from Zeophlite July 29, 2026 21:30
Comment thread content/learn/book/the-renderer/camera-driven.md Outdated
Comment thread content/learn/book/the-renderer/camera-driven.md Outdated
Comment thread content/learn/book/the-renderer/camera-driven.md Outdated
Comment thread content/learn/book/the-renderer/camera-driven.md Outdated
Comment thread content/learn/book/the-renderer/camera-driven.md Outdated
Comment thread content/learn/book/the-renderer/camera-driven.md Outdated
@cookie1170

Copy link
Copy Markdown
Contributor

i would also still like to see the section on OrthographicProjection::scaling_mode - it's very important to know

@alice-i-cecile alice-i-cecile added A-Book S-Needs-Review X-Contentious There are nontrivial implications that should be thought through C-Content labels Aug 3, 2026
@Based-A
Based-A requested a review from cookie1170 August 11, 2026 21:07
Comment thread content/learn/book/the-renderer/camera-driven.md
Comment thread content/learn/book/the-renderer/camera-driven.md Outdated

@cookie1170 cookie1170 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'm happy with the contents now, just a few nits from a final pass


However, a `Camera` component doesn't contain enough information on it's own.
Like we mentioned above, a [`CameraRenderGraph`] component also needs to be present in order for the camera to actually produce a rendered image.
If you forget to include a `CameraRenderGraph` component, your game will emit an `error` at runtime.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
If you forget to include a `CameraRenderGraph` component, your game will emit an `error` at runtime.
If you forget to include a `CameraRenderGraph` component, your game will emit an error at runtime.

}
```

A render layer is just a `bitmask` value, which means we aren't limited to only a single render layer.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
A render layer is just a `bitmask` value, which means we aren't limited to only a single render layer.
A render layer is a bitmask value, which means we aren't limited to only a single render layer.

) {
// Add all entities with a `RenderLayers` component to layer 3.
layer_query.iter_mut().for_each(|mut layers| {
layers.with(3);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function doesn't modify the RenderLayers itself, instead, it consumes the value and returns a new instance


If you start using multiple cameras, you can use the [`UiTargetCamera`] component to indicate a specific camera to render the UI to.
`UiTargetCamera` is a wrapper around an `Entity` id value for a `Camera` entity.
Add it to the entity containing the UI elements and your UI will be rendered to the `Camera`s [`RenderTarget`] while also respecting the `Camera`s `Viewport` and scale.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Add it to the entity containing the UI elements and your UI will be rendered to the `Camera`s [`RenderTarget`] while also respecting the `Camera`s `Viewport` and scale.
Add it to the entity containing the UI elements and your UI will be rendered to the `Camera`'s [`RenderTarget`] while also respecting the `Camera`'s `Viewport` and scale.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Book C-Content S-Needs-Review X-Contentious There are nontrivial implications that should be thought through

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants