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

DisplayObject blend mode tracking issue #58

Closed
32 tasks done
Herschel opened this issue Sep 11, 2019 · 13 comments
Closed
32 tasks done

DisplayObject blend mode tracking issue #58

Herschel opened this issue Sep 11, 2019 · 13 comments
Labels
A-rendering Area: Rendering & Graphics unimplemented Issues for functionality that hasn't been implemented yet

Comments

@Herschel
Copy link
Member

Herschel commented Sep 11, 2019

Desktop:

  • Normal
  • Layer
  • Add
  • Alpha
  • Darken
  • Difference
  • Erase
  • Hardlight
  • Invert
  • Lighten
  • Multiply
  • Overlay
  • Screen
  • Subtract
  • Shader (Pixel Bender)

Web canvas:

  • Normal
  • Layer
  • Add
  • Alpha
  • Darken
  • Difference
  • Erase
  • Hardlight
  • Invert
  • Lighten
  • Multiply
  • Overlay
  • Screen
  • Subtract
  • Shader (Pixel Bender)

ActionScript:

  • DisplayObject.blendMode
  • DisplayObject.blendShader
@Herschel Herschel added the A-rendering Area: Rendering & Graphics label Sep 11, 2019
@wizzwizz4
Copy link

Some of those (Screen, I think, and some others) don't have a single definition. It'll take some snooping, and maybe reverse-engineering, to figure out which algorithm they're using.

@karliss
Copy link

karliss commented Sep 11, 2019

AS3 documentation https://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/display/DisplayObject.html#blendMode has a bit more information than swf format specification.

@Herschel Herschel added the unimplemented Issues for functionality that hasn't been implemented yet label Sep 12, 2019
@Herschel
Copy link
Member Author

Herschel commented Sep 12, 2019

All of the non-normal blend modes cause the display object to have "cache as bitmap" behavior, where the display object is rendered into an offscreen render target first, and then this buffer is drawn onto the stage. Same with all the filters. In fact, Layer blend mode is just Normal with the offscreen buffer behavior.

So the first step is to implement render target functionality in RenderBackend. It's already there for masking on web, but needs to be added to desktop.

@ThisFlyingPotato
Copy link

ThisFlyingPotato commented May 1, 2021

Lacks blend effect

Screenshots First is how it is with Ruffle, second is how it is supposed to be.

ruffle2
correct2
ruffle
correct1

OS : Win7-64bits
Both on the Chrome Extension and standalone
On ruffle-nightly-2021_05_01

Ps : link of the game (you can test the blend by pressing space or going at the room all the way up, and pressing E next to the sword)
https://fr.y8.com/games/pandoras_seed

@relrelb
Copy link
Contributor

relrelb commented Aug 25, 2021

A description for each blend mode: https://www.adobe.com/content/dam/acom/en/devnet/pdf/pdfs/pdf_reference_archives/blend_modes.pdf

Seems that Adobe used the same formulas from the PDF spec.

@gskt17
Copy link

gskt17 commented Apr 2, 2022

All of the non-normal blend modes cause the display object to have "cache as bitmap" behavior, where the display object is rendered into an offscreen render target first, and then this buffer is drawn onto the stage. Same with all the filters. In fact, Layer blend mode is just Normal with the offscreen buffer behavior.

So the first step is to implement render target functionality in RenderBackend. It's already there for masking on web, but needs to be added to desktop.

So...has this functionality been added for desktop yet? What is our plan for implementing this feature?

@torokati44
Copy link
Member

torokati44 commented Apr 2, 2022

Well, I wouldn't call it much of a plan, just my ramblings from a while ago: #4288

@Lord-McSweeney
Copy link
Collaborator

Blend modes have been implemented by #8262, and will appear in web after #9134 is merged.

@Kippykip
Copy link

Kippykip commented Jan 22, 2023

Looks like there is definitely an improvement!
Although "Clown Killer 2" still seems to have some other blending related display issues
image_2023-01-23_055658283

@Lord-McSweeney
Copy link
Collaborator

The only one left unimplemented here is blendShader (BlendMode.SHADER).

@Kippykip
Copy link

Kippykip commented Jun 28, 2023

Excellent progress! :D
There are some minor glitches with the blur but it is looking very close to the original game!
The health bar finally visibly goes down too!

I think Clown Killer 2 is a great testing SWF for special GFX effects, since it uses a lot of blends, uses text outline glow extensively, and has those health shade bar effects (eggy easter also used it)
image
image
image

@Lord-McSweeney
Copy link
Collaborator

Finally closed by #12238.

@Kippykip
Copy link

image
Amazing!!! Pretty much perfect now under ruffle.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-rendering Area: Rendering & Graphics unimplemented Issues for functionality that hasn't been implemented yet
Projects
None yet
Development

No branches or pull requests

9 participants