Need some 2D World-rendering advice
Asked Answered
V

2

0

I'm trying to achieve a smooth transition between two scenes where the player stays rendered but the level fades directly from one to the other around him. No fading to black.

My particular use case is transitioning from exterior to interior. The exterior and interior worlds are independent of each other and inhabit much of the same space. Therefor I can't just have a sprite of a building and alpha-fade that.

Obviously when inhabiting one or the other area entirely, I just turn the other one off. The issue is entirely in the transition where I want to render one on top of the other and fade between.

I don't have much experience with Viewports, but my thought was that I could use a ViewportTexture on top of the other Viewport and fade the alpha on that texture. However, I'm not sure what the scene-tree setup for this would be. I haven't completely wrapped my head around Viewports, Camera2Ds, World2Ds, and how they relate with what they're rendering. I also need to ensure that both Viewports are rendering the player, which complicates things.

Is this the best approach? Any advice on setup for this approach? Or any idea for another approach that would work better for this effect?

(Please don't worry about considerations other than rendering such as collisions. That parts easy)

Vocabulary answered 7/10, 2023 at 0:12 Comment(0)
D
0

Vocabulary You may pull it off even without viewports. Simply parent each whole level under a CanvasGroup node and crossfade their self modulate alphas.

Dispensatory answered 7/10, 2023 at 0:28 Comment(0)
V
0

Dang well that was far easier than I was anticipating.

Vocabulary answered 7/10, 2023 at 1:19 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.