bevyengine / bevyengine/bevy

Feature Request: Unity-like render_scale property for adjusting rendering resolution without affecting UI

Open
#20,859 5 comments 9 reactions 0 assignees View on GitHub
A-Rendering C-Feature M-Release-Note S-Needs-Design
Dominant language
Rust
Stars
48.2k
Forks
4.8k
Avg merge
3d 22h
Merged PRs (30d)
161

Description

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

Many games need to dynamically adjust rendering resolution for performance optimization without sacrificing UI clarity. This is particularly critical for:

- **Mobile games**: Need to balance performance and battery life by rendering 3D content at lower resolutions (e.g., 0.75x) while keeping UI crisp
- **VR applications**: Must maintain stable 90+ FPS, often requiring dynamic resolution scaling
- **Cross-platform games**: Need to scale gracefully across different hardware capabilities
- **Performance modes**: Allowing players to choose between "Performance" (lower render scale) and "Quality" (higher render scale) modes

Currently in Bevy, achieving this requires complex workarounds that are error-prone and may impact UI rendering quality.

## What solution would you like?

A built-in `render_scale` property similar to Unity's implementation that:

1. Allows 3D scene rendering at a different resolution from the window resolution
2. Keeps UI elements rendering at native resolution
3. Can be adjusted at runtime

Proposed API:
```rust
// Global render scale setting
app.insert_resource(RenderScale(0.8)); // Render at 80% resolution

// Or per-camera basis
commands.spawn(Camera3dBundle {
camera: Camera {
render_scale: Some(0.8),
..default()
},
..default()
});
```

The feature should:
- Apply to all 3D rendering (meshes, particles, post-processing)
- Not affect UI rendering (UI remains at window resolution)
- Support values both below 1.0 (for performance) and above 1.0 (for supersampling)
- Be changeable at runtime without recreating resources

## What alternative(s) have you considered?

1. **Manual render target approach**: Create a lower resolution texture, render 3D content to it, then upscale to screen
- Cons: Complex setup, manual UI compositing, potential issues with post-processing

2. **Multiple camera setup**: Use separate cameras for 3D and UI with different render targets
- Cons: Requires significant boilerplate, coordination between cameras, manual composition

3. **Window scaling**: Adjust the entire window resolution
- Cons: Affects UI clarity, poor user experience, doesn't work well in fullscreen

4. **Third-party plugins**: Search for community solutions
- Cons: No established plugin found, maintenance concerns, potential version compatibility issues

None of these alternatives provide the simplicity and effectiveness of a built-in render scale feature.

## Additional context

**Industry standard**: Most modern game engines support this feature:
- Unity: `UniversalRenderPipelineAsset.renderScale`
- Unreal: Dynamic Resolution Scaling
- Godot: `viewport.scaling_3d_scale`

**Performance impact example**: In Unity projects, reducing render scale to 0.7 can improve frame rates by 30-50% on mobile devices while maintaining acceptable visual quality.

**Related Bevy discussions**:
- Would integrate well with existing camera and rendering systems
- Could complement potential future features like temporal upsampling (FSR, DLSS)

This feature would significantly improve Bevy's viability for performance-critical applications and bring it to parity with other major game engines in terms of rendering optimization options.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.