Skip to content

Add simple Solari example: 3d_scene but with raytracing#23805

Open
qthree wants to merge 1 commit intobevyengine:mainfrom
qthree:3d_scene_solari
Open

Add simple Solari example: 3d_scene but with raytracing#23805
qthree wants to merge 1 commit intobevyengine:mainfrom
qthree:3d_scene_solari

Conversation

@qthree
Copy link
Copy Markdown

@qthree qthree commented Apr 14, 2026

Objective

There is no example which explains the most minimal Solari setup.

Solution

PR adds new example which showcases bare-bones 3d scene with raytracing.

Testing

Example works when called as

cargo run --release --example solari_3d_scene --features=bevy_solari

Showcase

With DLSS (add dlss to --features=):
2026-04-15-025434_897x613_scrot

Without DLSS:
2026-04-15-025928_967x542_scrot

@github-actions
Copy link
Copy Markdown
Contributor

Welcome, new contributor!

Please make sure you've read our contributing guide, as well as our policy regarding AI usage, and we look forward to reviewing your pull request shortly ✨

@alice-i-cecile alice-i-cecile added A-Rendering Drawing game state to the screen C-Examples An addition or correction to our examples D-Straightforward Simple bug fixes and API improvements, docs, test and examples S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Apr 14, 2026
@github-project-automation github-project-automation bot moved this to Needs SME Triage in Rendering Apr 14, 2026
@alice-i-cecile alice-i-cecile added the X-Uncontroversial This work is generally agreed upon label Apr 14, 2026
@IceSentry
Copy link
Copy Markdown
Contributor

I would prefer if it was called solari_3d_scene so it gets automatically sorted to be near the solari example

Comment thread examples/3d/solari_3d_scene.rs
Comment thread examples/3d/solari_3d_scene.rs
@qthree qthree force-pushed the 3d_scene_solari branch 3 times, most recently from 3582d71 to b1ab859 Compare April 14, 2026 19:33
Copy link
Copy Markdown
Contributor

@JMS55 JMS55 left a comment

Choose a reason for hiding this comment

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

Overall example looks good, but I think it could do with a modest boost in lighting to be less "gloomy".

Thanks for doing this!


/// Real-time raytracing produces noisy output because it cannot trace enough rays per pixel in a single frame.
/// Instead, it distributes work stochastically across frames.
/// Therefore, a denoiser is required to achieve high-quality image.
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
/// Therefore, a denoiser is required to achieve high-quality image.
/// Therefore, a denoiser is required to achieve a high-quality image.

/// Real-time raytracing produces noisy output because it cannot trace enough rays per pixel in a single frame.
/// Instead, it distributes work stochastically across frames.
/// Therefore, a denoiser is required to achieve high-quality image.
/// DLSS Ray Reconstruction provides hardware-accelerated denoising.
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.

DLSS-RR also makes it overall cheaper via upscaling from a lower resolution (less rays to trace).

Transform::from_xyz(-2.5, 4.5, -3.0).looking_at(Vec3::ZERO, Vec3::Y),
));
// camera
let mut _camera = commands.spawn((
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
let mut _camera = commands.spawn((
commands.spawn((

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

It's used later to insert Dlss::<DlssRayReconstructionFeature>

MeshMaterial3d(materials.add(StandardMaterial {
base_color: css::DARK_GRAY.into(),
perceptual_roughness: 0.0,
metallic: 0.15,
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.

Metallic should never really be anything besides 1.0 or 0.0 (intermediate values are pretty much just for blending between different materials)

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

It's a result of experimentation to make clear reflections of cubes, but not too mirror-y.
Other values gave me graphical artifacts (light noise/flashes with DLSS enabled).

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.

You should change perceptual_roughness if you don't want a perfect mirror, not metallic. Try a low roughness like 0.05 or 0.1.

@alice-i-cecile alice-i-cecile added S-Waiting-on-Author The author needs to make changes or address concerns before this can be merged and removed S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Apr 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Rendering Drawing game state to the screen C-Examples An addition or correction to our examples D-Straightforward Simple bug fixes and API improvements, docs, test and examples S-Waiting-on-Author The author needs to make changes or address concerns before this can be merged X-Uncontroversial This work is generally agreed upon

Projects

Status: Needs SME Triage

Development

Successfully merging this pull request may close these issues.

4 participants