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: Alpha fixes #15573

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft

WIP: Alpha fixes #15573

wants to merge 1 commit into from

Conversation

bghgary
Copy link
Contributor

@bghgary bghgary commented Sep 13, 2024

Just a test for now. We should not merge this until there is adequate testing for the edge cases.

This will supersede the changes in #15504.

@bjsplat
Copy link
Collaborator

bjsplat commented Sep 13, 2024

Please make sure to label your PR with "bug", "new feature" or "breaking change" label(s).
To prevent this PR from going to the changelog marked it with the "skip changelog" label.

@bjsplat
Copy link
Collaborator

bjsplat commented Sep 13, 2024

@bjsplat
Copy link
Collaborator

bjsplat commented Sep 14, 2024

Visualization tests for WebGL 1 have failed. If some tests failed because the snapshots do not match, the report can be found at

https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/refs/pull/15573/merge/testResults/webgl1/index.html

If tests were successful afterwards, this report might not be available anymore.

@bjsplat
Copy link
Collaborator

bjsplat commented Sep 14, 2024

@bjsplat
Copy link
Collaborator

bjsplat commented Sep 14, 2024

Copy link

This pull request has been marked as stale because it has been inactive for more than 14 days. Please update to "unstale".

Copy link
Contributor

@Popov72 Popov72 left a comment

Choose a reason for hiding this comment

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

One change is missing: in shadowGenerator.ts, a call to needAlphaBlending should be replaced with a call to needAlphaBlendingForMesh.

return this._transparencyModeIsBlend;
}

if (this.subSurface?.disableAlphaBlending) {
Copy link
Contributor

Choose a reason for hiding this comment

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

It should be checked first to be backward compatible.

return false;
}

return this.alpha < 1.0 || this._opacityTexture != null || this._shouldUseAlphaFromAlbedoTexture();
return super.needAlphaBlending();
Copy link
Contributor

Choose a reason for hiding this comment

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

The this._opacityTexture != null || this._shouldUseAlphaFromAlbedoTexture() part is missing.

*/
protected _hasAlphaChannel(): boolean {
return (this._albedoTexture != null && this._albedoTexture.hasAlpha) || this._opacityTexture != null;
return super.needAlphaTesting();
Copy link
Contributor

Choose a reason for hiding this comment

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

The this._hasAlphaChannel() part is missing.


/** @override */
public override needAlphaBlending(): boolean {
return super.needAlphaBlending() || this._opacityFresnelParameters?.isEnabled;
Copy link
Contributor

Choose a reason for hiding this comment

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

As for the PBR material, the checks on this._opacityTexture and this._shouldUseAlphaFromDiffuseTexture() are missing, and needAlphaTesting would also need to be overriden to check this._hasAlphaChannel().

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.

3 participants