Skip to content

Introduce Renderer.SwapWorldBuffer and Renderer.CloneWorldBuffer.#21237

Merged
PunkPun merged 2 commits intoOpenRA:bleedfrom
pchote:worldbuffer-flip
Dec 15, 2023
Merged

Introduce Renderer.SwapWorldBuffer and Renderer.CloneWorldBuffer.#21237
PunkPun merged 2 commits intoOpenRA:bleedfrom
pchote:worldbuffer-flip

Conversation

@pchote
Copy link
Member

@pchote pchote commented Dec 2, 2023

The current post processing plumbing isn't suitable for in-world distortion effects (e.g. disruptor/sonic tank beams), which need to be able to access the already-rendered state at arbitrary points during rendering so that they can be occluded by foreground objects.

The main feature of this pr is the new Renderer.CloneWorldBuffer method, which serves that use case. At the same time, we are able to avoid unnecessary texture copies in the common case of full-screen effects by implementing Renderer.SwapWorldBuffer which behaves similarly but destroys the current rendered state - not an issue when we're re-rendering all of the pixels anyway.

The first commit is necessary to work avoid the limitations of Sprite and Sheet not being able to change the texture that their texture coordinates refer to.

@pchote
Copy link
Member Author

pchote commented Dec 3, 2023

Updated.

@PunkPun
Copy link
Member

PunkPun commented Dec 4, 2023

This causes glitches on load

Issues.mp4

@PunkPun
Copy link
Member

PunkPun commented Dec 4, 2023

Outsides of the map also glitch

Jiggle.mp4

@pchote
Copy link
Member Author

pchote commented Dec 4, 2023

Those both appear to be caused by the edge-of-map scissoring not working. Interesting...

@PunkPun
Copy link
Member

PunkPun commented Dec 4, 2023

I get this wild effect on chrono vortex ending

Wowzies.mp4

@pchote
Copy link
Member Author

pchote commented Dec 4, 2023

Fixed scissoring glitches and rebased.

Copy link
Member

@PunkPun PunkPun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't catch it on video, but on maps with a post process effect like desert rats the whole screen jitters. You need to be in an inbetween zoom level. The jitter it just by 1 pixel. In some zoom levels it jitters more than in others

@pchote
Copy link
Member Author

pchote commented Dec 6, 2023

Updated: this is now stripped down to just the API change to allow the world buffer to be read during normal world rendering.

Copy link
Member

@PunkPun PunkPun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interestingly on RA shellmap it feels like every time chrono strikes, performance goes down by about 10%. It could be a fluke but it felt like a pattern to me

@PunkPun PunkPun merged commit 6c56ea4 into OpenRA:bleed Dec 15, 2023
@PunkPun
Copy link
Member

PunkPun commented Dec 15, 2023

Changelog

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants