Change brightness effect to match Scratch 2.0 in 2D mode #399
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I wasn't sure who would want to review a GLSL change so I just assigned a bunch of people. Feel free to unassign yourself if you're not interested :)
If you're unfamiliar with GLSL or just need a refresher, take a look at pages 3 & 4 of this PDF:
https://www.khronos.org/files/webgl/webgl-reference-card-1_0.pdf
Resolves
Resolves #142
Proposed Changes
Previously this repository's brightness effect matched the behavior of Scratch 2.0's 3D renderer by adjusting the value component of the HSV representation of a color. Now, it matches the behavior of Scratch 2.0's 2D renderer, which simply offsets (and clamps/saturates) the RGB values.
Note that to fully match Scratch 2.0's 2D renderer the brightness effect must happen after the color effect, not before.
Reason for Changes
It appears that most uses of the brightness effect in Scratch 2.0 are not paired with other graphical effects which cause the 3D renderer to activate, so matching the 2D renderer will likely cause fewer projects to display incorrectly in Scratch 3.0.
Test Coverage
Testing is easiest by comparing the Scratch 2.0 renderer against the scratch-render playground. See also #142 for example projects to test.