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

Brightness + Color effect doesn't work the same as Scratch 2 #142

Closed
paulkaplan opened this issue Jun 1, 2017 · 8 comments
Closed

Brightness + Color effect doesn't work the same as Scratch 2 #142

paulkaplan opened this issue Jun 1, 2017 · 8 comments

Comments

@paulkaplan
Copy link
Contributor

paulkaplan commented Jun 1, 2017

Expected Behavior

Please describe what should happen
Scratch 2, if you set brightness effect to 100 and color effect to 50, this is what you get
image

Actual Behavior

Describe what actually happens

In Scratch 3, you get all white (I added a background so that you can see it).
image


This bug is a simplification of a problem I had when opening this project in scratch 3 https://scratch.mit.edu/projects/1270935/
It should look like this
image

And instead looked like this
image


cc @cwillisf

@BryceLTaylor
Copy link

BryceLTaylor commented Jan 3, 2019

I'm still seeing some strangeness with Brightness but it's a little different from what's listed above. It looks like project 1270935 is working properly. Also, brightnesses between -100 and 0 are behaving as expected.

For brightnesses between 0 and 100 it looks like it is getting brighter, but not all the way white as it does in 2.0.

Here it is in 2.0:
brightnesstest2 0

And here it is in 3.0:
brightnesstest3 0

I used this project: https://scratch.mit.edu/projects/276912470/ to test this.

@thisandagain thisandagain removed their assignment Jan 3, 2019
@thisandagain thisandagain added this to Needs Prioritization in Compatibility via automation Jan 3, 2019
@thisandagain thisandagain modified the milestone: Backlog Jan 3, 2019
@thisandagain
Copy link
Contributor

/cc @kchadha @ktbee @cwillisf

@fsih
Copy link
Contributor

fsih commented Jan 10, 2019

I found something weird. If you use just the brightness effect on a sprite in scratch 2, it looks like this (0 to 100)
Scratch 2:
screen shot 2019-01-09 at 22 32 37

However, if you also use the color effect on any sprite, all of the sprites change to look like this:
Also Scratch 2:
screen shot 2019-01-09 at 22 32 14

And that's what the brightness effect looks like in Scratch 3.0 right now
Scratch 3:
screen shot 2019-01-09 at 22 29 56

@cwillisf when the color effect broke things last time you said it was something to do with the rendering engine?

@fsih
Copy link
Contributor

fsih commented Jan 10, 2019

Found a relevant thread with useful code links: scratchfoundation/scratch-flash#570

Note though that HSV vs HSL isn't the problem here though. Here is 1) the current brightness effect, 2) the brightness effect using HSL, 3) the brightness effect in Scratch 2. Neither 1 nor 2 match 3.
screen shot 2019-01-09 at 22 30 45

@towerofnix
Copy link
Contributor

Maybe relevant: https://scratch.mit.edu/projects/269088736/#comments-105915881

TL;DR a positive brightness effect doesn't seem to have an impact on a costume whose fill colors are already 100% brightness (i.e. the sliders show brightness = 100). I think the brightness effect in 2.0 is more like "mix with white (or black)" rather than "adjust brightness component"? I haven't done testing though.

@cwillisf
Copy link
Contributor

I found something weird

Good find, @fsih! Adding a color effect to the project causes Scratch 2.0 to switch to its 3D rendering mode, so that explains why the difference shows up when it does. It looks like the 2D and 3D renderers in Scratch 2.0 work very differently for the brightness effect. This is true for several of the graphical effects: for example, the whirl effect reverses direction.

Unfortunately I don't have a strong sense of which version of the brightness effect most projects want; my guess is that most projects end up using the 2D renderer but I'm not certain.

The brightness effect in Scratch 3.0 seems to match the 3D renderer in Scratch 2.0 but doesn't match the 2D renderer in Scratch 2.0. If we decide to match the 3D renderer then I think we're already done; if we decide to match the 2D renderer then there's some shader work at least.

@fsih
Copy link
Contributor

fsih commented Jan 11, 2019

Projects mostly use the brightness effect to transition to and from white and black, so I think it would make the most sense to match the 2D renderer of Scratch 2. Sprites becoming white was also the original behavior before we had to add the 3D renderer, and the bug scratchfoundation/scratch-flash#570 was created because the 3D renderer was "wrong": https://scratch.mit.edu/discuss/topic/73118/

@thisandagain
Copy link
Contributor

@cwillisf @fsih Matching the behavior of the 2D renderer makes sense to me. Thanks for the investigation!

Compatibility automation moved this from Needs Prioritization to Done Jan 16, 2019
@TimothyKeaveny TimothyKeaveny removed this from Done in Compatibility Apr 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants