Skip to content

Conversation

@brooke-ec
Copy link

I was experiencing issues rendering textures with the MASK alpha mode. Some faces would render through the transparent sections and some simply wouldn't. I tracked this down to being caused by the depth buffer treating the transparent sections as opaque.

Here is an example of the depth buffer for a masked texture using the current version of pyrender:
current
And the same texture after my changes:
fixed

I have added a check in mesh.frag to discard the fragment if the alpha is less than the material's alpha cutoff. I have also added a new define IS_MASK_ALPHA_MODE specifying if the alpha mode is set to MASK.

Thank you for taking the time to read, let me know if you have any suggestions!

• Updated get_trimesh_props to copy alphaMode for PBRMaterial
• Updated mesh.frag to discard fragments with alpha <= alphaThreshold
• Added new define: IS_MASK_ALPHA_MODE
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