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

Fix normal map palette #3114

Closed
wants to merge 2 commits into from
Closed

Fix normal map palette #3114

wants to merge 2 commits into from

Conversation

cs-altshift
Copy link
Contributor

Closes #3015

I agree that my contributions are licensed under the Individual Contributor License Agreement V3.0 ("CLA") as stated in https://github.com/aseprite/sourcecode/blob/main/cla.md

I have signed the CLA following the steps given in https://github.com/aseprite/sourcecode/blob/main/sign-cla.md#sign-the-cla

@cs-altshift cs-altshift requested a review from dacap as a code owner December 31, 2021 14:48
@dacap dacap requested a review from Gasparoken December 31, 2021 15:08
@Gasparoken
Copy link
Member

Thank you @cs-altshift! I reviewed your contribution.

Taking your commit as base, I'll add a few steps more to the Discrete mode and I'll replace the if-elseif-else condition by a couple of formulas.

Copy link
Member

@Gasparoken Gasparoken left a comment

Choose a reason for hiding this comment

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

I'll talk with David prior to merge this fix. Surely, we'll change the if block and some minor details. Thank you again!🎉

Comment on lines +128 to +145
if (normalizedDistance < 0.25) {
normalizedDistance = 0;
blueAngleDegrees = 90;
angle = PI / 2;
angle = 0;
}
else if (normalizedDistance < 0.5) {
normalizedDistance = 0.25;
blueAngleDegrees = 45;
}
else if (normalizedDistance < 0.75) {
normalizedDistance = 0.5;
blueAngleDegrees = 30;
}
else {
normalizedDistance = 0.75;
blueAngleDegrees = 15;
}
Copy link
Member

@Gasparoken Gasparoken Jan 7, 2022

Choose a reason for hiding this comment

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

Will be replaced with:

if (normalizedDistance < 1.0/6.0)
   angle = 0;
normalizedDistance = (std::floor((normalizedDistance) * 6.0 + 1.0) - 1) / 5.0;
blueAngleDegrees = 90.0 * (6.0 - std::floor(normalizedDistance * 6.0)) / 5.0;

Copy link
Member

Choose a reason for hiding this comment

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

This calculates the discrete mode along 6 steps (along the radius), and simplifies the if-elseif-else statement.

@cs-altshift
Copy link
Contributor Author

Great news everything works as expected for you. AFAIK we do not use the discrete mode so I just matched what existed before. But indeed more steps will be better.

@dacap
Copy link
Member

dacap commented Feb 8, 2022

Sorry @cs-altshift that we weren't able to merge this PR yet, I'm preparing a corporate CLA and probably changing the CLA-signing process soon. It will take some time until we can merge this but we'll keep you informed.

@dacap dacap self-assigned this Feb 8, 2022
@cs-altshift
Copy link
Contributor Author

Sorry @cs-altshift that we weren't able to merge this PR yet, I'm preparing a corporate CLA and probably changing the CLA-signing process soon. It will take some time until we can merge this but we'll keep you informed.

No problem. We have a working build on our side anyway.

@dacap
Copy link
Member

dacap commented Nov 15, 2022

Thanks @cs-altshift for this and the patience, we've receive the signed corporate CLA from Alt Shift. I've just pushed these changes in an anternative branch (rebasing the changes to the current main) and adding the change by @Gasparoken:

https://github.com/aseprite/aseprite/tree/fix-normal-map-palette

I'll add an extra new commit in these days implementing the new normal map wheel using shaders (because color selectors have changed the way they are painted).

@dacap dacap added this to the v1.3.0 milestone Nov 16, 2022
@dacap
Copy link
Member

dacap commented Nov 16, 2022

Finally merge in 20902e3, thanks a lot @cs-altshift 🙏

@dacap dacap closed this Nov 16, 2022
@cs-altshift
Copy link
Contributor Author

Finally merge in 20902e3, thanks a lot @cs-altshift 🙏

You're welcome. Glad we will finally be able to use the mainstream Aseprite soon!

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.

Normal map color wheel not working as intended
3 participants