Skip to content

Conversation

Soullnik
Copy link
Contributor

@Soullnik Soullnik commented Jul 17, 2025

Add camera preview functionality

Summary

This PR enhances the camera preview functionality in the editor layout by adding the ability to activate camera previews when selecting camera nodes in the graph or preview, implementing a dedicated preview canvas with proper sizing, and improving scene management for better user expirience.

Changes Made

Camera Preview Activation

  • Added setCameraPreviewActive() method to enable camera preview functionality when selecting camera nodes in the graph
  • Implemented preview canvas registration with using registerView()
  • Added proper camera switching logic to display the selected camera's perspective in the preview window

Preview Canvas Implementation

  • Created a dedicated preview canvas element with proper container styling and aspect ratio constraints
  • Added close button functionality to deactivate the preview and return to normal view

Benefits

  • Enhanced Workflow: Users can now preview camera perspectives directly in the editor when selecting camera nodes
  • Better Visualization: Dedicated preview window provides clear view of camera perspective without interfering with main scene
  • User Control: Easy deactivation of camera preview with intuitive close button

Mikalai Lazitski added 4 commits July 17, 2025 15:08
- Added functionality to activate camera preview when selecting camera nodes in the graph.
- Implemented a dedicated preview canvas for the camera with a close button to deactivate the preview.
- Improved scene management by unregistering all canvases when resetting the preview.
@julien-moreau julien-moreau added the feature Defines and adds a new feature to the product label Jul 17, 2025
@julien-moreau
Copy link
Contributor

An issue has been open here: https://forum.babylonjs.com/t/multi-canvas-and-post-processes/59616
When post-processes are activated (especially SSAO2 and motion blur at least) the rendering is altered

@yuripourre
Copy link
Contributor

yuripourre commented Sep 2, 2025

Oops, I opened a new PR (#608) but completely missed this one since there is no reference to #530 .

Instead of multicanvas I end up using viewport.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Defines and adds a new feature to the product
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants