Skip to content

WIP: Alpha fixes#15573

Closed
bghgary wants to merge 1 commit intoBabylonJS:masterfrom
bghgary:alpha-fixes
Closed

WIP: Alpha fixes#15573
bghgary wants to merge 1 commit intoBabylonJS:masterfrom
bghgary:alpha-fixes

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.

@bghgary bghgary requested review from Popov72 and sebavan September 13, 2024 23:49
@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

@github-actions
Copy link
Contributor

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 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().

@sebavan
Copy link
Member

sebavan commented Nov 26, 2024

@bghgary any update ?

@bghgary
Copy link
Contributor Author

bghgary commented Nov 26, 2024

Not yet. On my list.

@github-actions
Copy link
Contributor

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

@bghgary
Copy link
Contributor Author

bghgary commented Feb 4, 2025

Superceded by #16144.

@bghgary bghgary closed this Feb 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants