Movatterモバイル変換


[0]ホーム

URL:


Skip to main content
r/bevy icon
Go to bevy
r/bevy
A banner for the subreddit

This is a place to stay up to date on Bevy news, share your Bevy games or plugins, and discuss Bevy topics.


Members

Hey, want to see a magic trick? (explanation in post)

Project
media poster

So I posted about this in the Bevy discord, but basically this involved forking Bevy to pass parent windows on to winit, then forking winit to use the wayland popup API instead of the window API when it receives a request to create a wayland window with a parent (and set the input rect to empty so clicks pass through it). I create a second window, parented to the primary window, then a second camera parented to the primary camera that renders to the "overlay" popup, and give the primary camera a SubCameraView so the FoV matches. I put the fox on a render layer that’s only rendered on the overlay, and everything else on a layer that’s only rendered by the primary.

I didn’t show it in the video, but you can move the window around and the layers stay perfectly in sync, no matter the framerate of the Bevy app (since the positions are synced by the Wayland compositor). I believe that this basic technique should still work in other environments, but I’ve only tested it under Wayland and the behaviour when moving windows will probably be different. Code here (the animation_graph example is what’s shown in the video)https://github.com/eira-fransham/bevy/tree/bevy-magic-trick


[8]
ページ先頭

©2009-2025 Movatter.jp