bevyengine / bevyengine/bevy

Add render-target passthrough for picking

Open
#16,046 1 comment 2 reactions 0 assignees View on GitHub
A-Picking C-Feature D-Modest S-Ready-For-Implementation
Dominant language
Rust
Stars
48.2k
Forks
4.8k
Avg merge
3d 16h
Merged PRs (30d)
171

Description

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

Suppose we're looking at a scene through a viewport. We want to be able to point at something in that scene with the mouse, and determine what was hit.

However, because of the indirection of the render target, picking doesn't work correctly.

## What solution would you like?

Adopt and polish [this code](https://github.com/bevyengine/bevy_editor_prototypes/pull/110/files#diff-8822a6e2ff95ec7dc42910dee18d44df639492f64b34aa91a23ae99929f24209R77). It works by duplicating the picking events onto the render target and then handling picking again.

## Additional context

This was added to the editor prototype in https://github.com/bevyengine/bevy_editor_prototypes/pull/110 by @tim-blackbird, and is a great candidate for independent upstreaming.

Contributor guide

Open the contributing guide

Research direction

Start by reviewing the linked bevy_editor_prototypes pull request, especially the referenced code, then trace Bevy's picking and render-target handling. Adapt and polish the existing approach for upstream use, and verify that pointing at objects through a viewport correctly reports the picked target.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
computer-graphics, game-dev
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.