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

Fixed Java brush matrix #2646

Merged
merged 2 commits into from
Jan 20, 2025
Merged

Conversation

Nestorboy
Copy link
Contributor

  • Replaced the temporary brush outline offset fix with a proper solution that makes the brush account for every kind of scene transformation.
  • Fixed issue where z-offset was not being applied anymore when working with java models.

Since we're applying the brush matrix directly, we need to factor in the parent matrices too, since the brush is parented to the scene. By using the parent matrix instead, we make it account for all translations, rotations and scaling.
@Nestorboy
Copy link
Contributor Author

I noticed that the z-offset wasn't being applied anymore for the Java models. I did fix depth sorting for such cases to make sure that the brush would usually draw in front, but I haven't done any stress testing to make sure that it's always the case, since there might be floating point precision issues in more extreme cases that can cause the GPU-side depth offset for the brush to not be enough and cause z-fighting again.

Since this might need more testing I would probably avoid adding this to 4.12.x. What do you think @JannisX11?

@JannisX11
Copy link
Owner

Yup, I agree. I haven't noticed any z fighting issues so far, and even if it happens in extreme cases I'm not worried about it since it's just the brush outline. Maybe in the next update cycle.

Thanks for the fix! I didn't realize makeTranslation wasn't additive.

@JannisX11 JannisX11 merged commit fac8535 into JannisX11:patch Jan 20, 2025
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.

2 participants