Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wgpu: Implement blend modes #8262

Merged
merged 54 commits into from
Jan 3, 2023
Merged

wgpu: Implement blend modes #8262

merged 54 commits into from
Jan 3, 2023

Conversation

Dinnerbone
Copy link
Contributor

@Dinnerbone Dinnerbone commented Oct 10, 2022

All blend modes should, as far as I am aware and have been able to test, work correctly.

Performance isn't amazing - there's definitely areas to improve and if you stress it with hundreds of blends you'll notice it chug. I don't think it should be an impact on a "normal" swf though, and a big part of the performance hit is from the lack of cacheAsBitmap.

@Dinnerbone Dinnerbone force-pushed the blend branch 2 times, most recently from adc295b to 10d46b4 Compare October 17, 2022 18:32
@angstsmurf
Copy link

angstsmurf commented Dec 14, 2022

This seems to completely fix #4464, making The Queen of Snakes fully playable.

EDIT: Not completely fixed. Some rooms are still black. But a great improvement.

@Dinnerbone
Copy link
Contributor Author

Updated with (I believe) fully functional blend modes, and with latest code from master.

It looks like everything works, but the performance is bad so I'm keeping this a draft for now.

@angstsmurf
Copy link

Hm, one of the later updates seems to have caused #4464 to regress. The triangles everywhere are back, but completely black rather than the previously blue stretched eye graphic. When I tested this four days ago, they were properly invisible.

Copy link
Member

@Herschel Herschel left a comment

Choose a reason for hiding this comment

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

Thanks so much for your effort on this! It'll be very exciting to get this in.

Here are some quickie fixes for the additive modes that I saw. I can take a look at Erase etc. later. As I know your availability is limited, if you'd like, I can go ahead and push fixes to your branch.

render/wgpu/shaders/blend.wgsl Outdated Show resolved Hide resolved
render/wgpu/shaders/blend.wgsl Outdated Show resolved Hide resolved
render/wgpu/shaders/blend.wgsl Outdated Show resolved Hide resolved
@n0samu
Copy link
Member

n0samu commented Dec 19, 2022

At first I got confused when testing because I was still seeing this message. I guess it should be removed, right?
https://github.com/ruffle-rs/ruffle/blob/7b32abeadfe7d42291407f68b074cb849c67a931/core/src/display_object.rs#L397

@Yuri-K7
Copy link

Yuri-K7 commented Dec 19, 2022

Seems like #7820 also regressed... So there's at least a problem with darken blend mode...

Edit : Nevermind, it just doesn't work with vulkan on Linux for some reason, but with opengl it's perfect.

Edit 2 : With recent changes, it finally works with vulkan !

@Dinnerbone
Copy link
Contributor Author

Dinnerbone commented Dec 19, 2022

At first I got confused when testing because I was still seeing this message. I guess it should be removed, right?

https://github.com/ruffle-rs/ruffle/blob/7b32abeadfe7d42291407f68b074cb849c67a931/core/src/display_object.rs#L397

@n0samu Oh yep absolutely!

Hm, one of the later updates seems to have caused #4464 to regress. The triangles everywhere are back, but completely black rather than the previously blue stretched eye graphic. When I tested this four days ago, they were properly invisible.

@angstsmurf Oh no! Thanks for testing!

Thanks so much for your effort on this! It'll be very exciting to get this in.

Here are some quickie fixes for the additive modes that I saw. I can take a look at Erase etc. later. As I know your availability is limited, if you'd like, I can go ahead and push fixes to your branch.

@Herschel Thank you! Please feel free to push and do whatever you like to progress this, I'd appreciate it. I'll be available on discord from my phone but time in front of a PC is very painful atm.

@Benman2785
Copy link

thank you - would be great to have for web-selfhosted ;)

@n0samu
Copy link
Member

n0samu commented Dec 22, 2022

With this PR, the highlight effect works when hovering the mouse over the gems in Bejeweled 2 (King.com version).

I also tried building Ruffle-selfhosted with wgpu-webgl to test this out on web. I built with dual-wasm enabled for best performance, but the performance running this Bejeweled game was still unacceptable in both Firefox and Chromium.

@Benman2785
Copy link

Benman2785 commented Dec 22, 2022

here some performance testing for web-selfhosted:
POOR: The last Stand 1
FINE: The last Stand 2

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.

7 participants