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

Alpha test fix #5126

Merged
merged 1 commit into from
Mar 6, 2023
Merged

Alpha test fix #5126

merged 1 commit into from
Mar 6, 2023

Conversation

slimbuck
Copy link
Member

@slimbuck slimbuck commented Mar 6, 2023

Fixes #5115

The material alpha test value wasn't being set without an alpha map specified.

@slimbuck slimbuck added bug area: graphics Graphics related issue labels Mar 6, 2023
@slimbuck slimbuck requested a review from a team March 6, 2023 09:50
@slimbuck slimbuck self-assigned this Mar 6, 2023
@@ -505,6 +505,8 @@ class Renderer {
// Alpha test
if (material.opacityMap) {
this.opacityMapId.setValue(material.opacityMap);
}
if (material.opacityMap || material.alphaTest > 0) {
Copy link
Contributor

Choose a reason for hiding this comment

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

So if the following material has alphaTest === 0, it won't be set and will keep using the previously set value.

Copy link
Member Author

Choose a reason for hiding this comment

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

If there is no opacity map and alphaTest == 0, then there will be no alpha test shader code?

Copy link
Contributor

Choose a reason for hiding this comment

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

true

@slimbuck slimbuck merged commit 560f730 into playcanvas:main Mar 6, 2023
@slimbuck slimbuck deleted the alpha-test-fix branch March 6, 2023 11:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: graphics Graphics related issue bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Shadows don’t work when using Vertex Alpha and Alpha Test
2 participants