bevyengine / bevyengine/bevy

Send events from the render world to the main world

Open
#18,491 0 comments 0 reactions 0 assignees View on GitHub
A-Rendering C-Feature D-Modest
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?

In some situations, we need to communicate data back to the main world from the render world. This is a non trivial thing to do because of the async nature of the main and render world split. The solution is to use channels, but it's not easy to manage for less advanced users.

The gpu readback feature shows that passing data between these worlds is possible but it's a purpose built abstraction.

## What solution would you like?

One possible solution would be to have some kind of `RenderEventWriter`/`RenderEventReader` plugin that creates a channel between both worlds and sends any render event to the main world by polling the channel in the main world.

## What alternative(s) have you considered?

Tell users to write their own channel.

## Additional context

We often get comments that the render world is hard to work with because it's hard to communicate data back to the main world. In some cases it comes from a misunderstanding of how the render world is intended to be used, but there are various valid reasons to want to pass some data back to the main world.

Contributor guide

Open the contributing guide

Research direction

Start by studying the existing gpu readback feature, which demonstrates communication between the render world and main world. Compare that purpose-built abstraction with the proposed RenderEventWriter/RenderEventReader channel approach; done would mean settling and implementing a supported way to send render events back to the main world.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
game-dev
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.