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

[WIP] Add negative blend shape weight support -1 and 1 values seem to work. #43445

Conversation

RevoluPowered
Copy link
Contributor

Improves the range available for blend shape weights as per #36707 we needed this for our own games it basically means you can use less blend shape tracks to do the same thing as the opposing blend direction which before needed you to duplicate blend shapes.

👍 🍰

@@ -4463,8 +4463,9 @@ void RasterizerStorageGLES3::mesh_render_blend_shapes(Surface *s, const float *p
for (int ti = 0; ti < mtc; ti++) {
float weight = p_weights[ti];

if (weight < 0.00001) //not bother with this one
if (weight <= 0.00001 && weight >= -0.00001) {
Copy link
Member

@Calinou Calinou Nov 10, 2020

Choose a reason for hiding this comment

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

This order is more natural to read:

Suggested change
if (weight <= 0.00001 && weight >= -0.00001) {
if (weight >= -0.00001 && weight <= 0.00001) {

Also, shouldn't we use is_zero_approx() here?

Copy link
Contributor

@AndreaCatania AndreaCatania Nov 10, 2020

Choose a reason for hiding this comment

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

Such timing XD #43445 (comment)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

hmm, let me check because I think this relates more to the steps in the editor rather than that check.

Copy link
Contributor Author

@RevoluPowered RevoluPowered Nov 10, 2020

Choose a reason for hiding this comment

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

Nope, it's the editor steps, not the is equal to zero. Still might work but the context is slightly different, I'll test both.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

is_zero_approx visual artefacts

Copy link
Contributor Author

@RevoluPowered RevoluPowered Nov 10, 2020

Choose a reason for hiding this comment

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

Hmm, now I'm getting some minor flickering on unrelated vertexes seems this check is kinda flaky even with either is_zero_approx or with the change above.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK so rebooting fixed my artefacts and reimporting worked. I think this change will need to be tested a bit more.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have a driver problem with blend shapes on 3.2 and mesa-git I am testing on OSX now....

@RevoluPowered
Copy link
Contributor Author

forgot to say change is not required for 4.0 as I don't think since no blend shape support works yet.

@RevoluPowered RevoluPowered changed the title Add negative blend shape weight support -1 and 1 values seem to work. [WIP] Add negative blend shape weight support -1 and 1 values seem to work. Nov 10, 2020
@fire
Copy link
Member

fire commented Nov 11, 2020

Can you prepare a 4.0 patch just in case? It can be modified later, but you still remember the code.

@akien-mga
Copy link
Member

Superseded by #45837.

@akien-mga akien-mga modified the milestones: 3.2, 3.3 Apr 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants