Skip to content

WIP: Alpha fixes - #15573

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

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

Conversation

@bghgary

@bghgary bghgary commented Sep 13, 2024

Copy link
Copy Markdown
Contributor

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

bjsplat commented Sep 13, 2024

Copy link
Copy Markdown
Collaborator

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

bjsplat commented Sep 13, 2024

Copy link
Copy Markdown
Collaborator

@bjsplat

bjsplat commented Sep 14, 2024

Copy link
Copy Markdown
Collaborator

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

bjsplat commented Sep 14, 2024

Copy link
Copy Markdown
Collaborator

@bjsplat

bjsplat commented Sep 14, 2024

Copy link
Copy Markdown
Collaborator

@github-actions

Copy link
Copy Markdown
Contributor

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

@Popov72 Popov72 left a comment

Copy link
Copy Markdown
Contributor

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

Comment thread packages/dev/core/src/Shaders/ShadersInclude/pbrBlockAlbedoOpacity.fx Outdated
@sebavan

sebavan commented Nov 26, 2024

Copy link
Copy Markdown
Member

@bghgary any update ?

@bghgary

bghgary commented Nov 26, 2024

Copy link
Copy Markdown
Contributor Author

Not yet. On my list.

@github-actions

Copy link
Copy Markdown
Contributor

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

@bghgary

bghgary commented Feb 4, 2025

Copy link
Copy Markdown
Contributor Author

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