Skip to content

Add realistic 3D editor view - #11660

Open
BenJule wants to merge 1 commit into
bambulab:masterfrom
BenJule:feature/realistic-view
Open

Add realistic 3D editor view#11660
BenJule wants to merge 1 commit into
bambulab:masterfrom
BenJule:feature/realistic-view

Conversation

@BenJule

@BenJule BenJule commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds an optional realistic rendering mode to the normal 3D editor view.

The new mode uses Phong shading and can optionally apply screen-space ambient occlusion (SSAO) before the existing FXAA pass.

This work is based on the corresponding OrcaSlicer implementation from commit cf8bb38dc6af95d27fc85f37329ee542d2e76ac3, adapted to Bambu Studio's current rendering pipeline.

Screenshot

Realistic view with ambient occlusion enabled (Preferences → 3D), rendered on a graphical system:

Realistic 3D editor view with SSAO

Behavior

  • disabled by default
  • available only in the normal 3D editor view
  • requires OpenGL 3.1 or newer
  • falls back to the existing Gouraud shader when Phong is unavailable
  • SSAO is enabled only when both the Phong and SSAO shaders are available
  • disabled for painting, picking, assembly rendering and thumbnails
  • preserves the existing FXAA post-processing path

Implementation

  • adds GLSL 1.10 and 1.40 Phong shaders
  • adds GLSL 1.10 and 1.40 SSAO shaders
  • adds optional depth textures to the framebuffer implementation
  • integrates SSAO before FXAA
  • adds preferences for Realistic view and Ambient occlusion (SSAO)

Validation

  • git diff --check passes
  • targeted compilation of the modified C++ translation units passes
  • a Linux CI build successfully compiled and linked src/bambu-studio
  • the packaging stage subsequently failed because the generated BuildLinuxImage.sh lacked executable permission; this occurred after the application had linked

The final commit additionally contains null checks that prevent SSAO from being enabled when the Phong or SSAO shader is unavailable.

Pending validation

  • runtime GLSL compilation on a graphical system
  • visual comparison of Gouraud, Phong and Phong with SSAO
  • interaction checks for selection, painting and other editor tools

@BenJule
BenJule marked this pull request as draft July 22, 2026 16:26

@Haidiye00 Haidiye00 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.

Hello, please merge it into one patch. Also, I noticed that the preference settings for Orca's realistic rendering are all grouped together, for a total of 4. Did you refer to Orca's code
image

@BenJule
BenJule force-pushed the feature/realistic-view branch from 25d754c to 3966e7d Compare July 23, 2026 12:40
@BenJule

BenJule commented Jul 23, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for the review.

Yes, this implementation is based on OrcaSlicer commit cf8bb38dc6af95d27fc85f37329ee542d2e76ac3. However, it was adapted to Bambu Studio's current rendering pipeline, OpenGL management and preferences layout rather than copied directly.

The main differences between the referenced Orca implementation and this Bambu Studio implementation are:

  • Orca places these settings in a separate Graphics tab, while Bambu Studio keeps them in the existing 3D Settings tab.
  • The referenced Orca commit exposes three individual realistic-view effects:
    • Phong shading
    • SSAO ambient occlusion
    • Shadows
  • Bambu Studio instead uses a dedicated “Realistic view” master switch and groups four related options under “Realistic Rendering”:
    • Realistic view
    • Ambient occlusion (SSAO)
    • Plate shadow
    • Smooth normals
  • Smooth normals are an additional Bambu Studio option and are not part of the referenced Orca commit.
  • The SSAO implementation was adapted to Bambu Studio's current volume-rendering path and uses a world-space normal G-buffer aligned with the existing camera, object and depth transformations.
  • The plate-shadow implementation uses a planar projection integrated into Bambu Studio's existing build-plate and volume-rendering stages.
  • MSAA is connected to Bambu Studio's current OpenGLManager and can be updated through the existing canvas-refresh flow. In the referenced Orca implementation, changing the MSAA multiplier requires an application restart.
  • Orca provides a freely adjustable FPS cap from 0 to 240 FPS. Bambu Studio currently provides predefined values for Unlimited, 30, 60, 90, 120, 144 and 240 FPS.
  • Bambu Studio applies the frame-rate limit to the interactive 3D and Preview canvases without blocking the user interface, while assembly exports remain unlimited.
  • The FPS overlay is integrated into Bambu Studio's existing ImGui overlay rendering and is omitted from the assembly view.

The complete change has now been squashed into a single signed commit.

The resulting source tree is unchanged from the version successfully compiled, linked, packaged and archived by the previous Linux Jenkins build. I will also run the final Jenkins validation against the new squashed commit hash.

Thanks again for reviewing the implementation.

@BenJule
BenJule requested a review from Haidiye00 July 23, 2026 12:45
@BenJule
BenJule marked this pull request as ready for review July 23, 2026 12:47
@BenJule

BenJule commented Jul 23, 2026

Copy link
Copy Markdown
Contributor Author

The final Linux Jenkins validation has now also completed successfully against the squashed commit. It configured, compiled, linked, packaged and archived Bambu Studio successfully.

@Haidiye00

Copy link
Copy Markdown
Contributor

Hello, please provide the latest GIF recording video. We would like to see the preference settings and the actual rendering effect now

@BenJule

BenJule commented Jul 23, 2026

Copy link
Copy Markdown
Contributor Author

@Haidiye00 Thanks for the feedback.

Attached is the latest GIF recording from the current PR build. It shows:

  • the grouped rendering preference settings
  • the actual rendering effect on the model

Please let me know if you would like any additional test coverage.

BambuStudio_PR11660_preferences_and_rendering_under_10MB

@BenJule
BenJule force-pushed the feature/realistic-view branch from 3966e7d to 50a1ab1 Compare July 23, 2026 14:52
Add an optional Phong-rendered editor view with SSAO, smooth normals and a planar build-plate shadow.

Group the four realistic-rendering preferences together and expose MSAA, FXAA, frame-rate limiting and an FPS overlay.

The implementation is based on OrcaSlicer commit cf8bb38dc6af95d27fc85f37329ee542d2e76ac3 and adapted to the current Bambu Studio rendering pipeline.
@BenJule
BenJule force-pushed the feature/realistic-view branch from 50a1ab1 to 9587652 Compare July 25, 2026 09:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants