VisualPinball.Engine
VisualPinball.Engine copied to clipboard
BlendMode evaluation needs improvement
The PbrMaterial.cs
class contains these enum values for the BlendMode
:
public enum BlendMode
{
Opaque,
Cutout,
Translucent
}
However those don't seem to be enough and a more specific evaluation should be performed and more specific blend modes and hence materials generated. To visualize the problem here's an example of what's not working. Flash Gordon table after an import with the current version:
The Apron Top isn't visible. The material settings are this:
You can see that alpha clipping is active. It shouldn't be or it should be reduced. Here's the Apron Top with the same material, but without alpha clipping, now it's visible:
In VPX the material looks like this:
and the image like this:
The GetBlendMode()
method in PbrMaterial.cs
seems to evaluate the transparent pixels of the image and at some point sets the blend mode to Cutout
. That algorithm needs to be fine tuned. Especially in combination with other material settings like 0,999 for the Opacity Amount which seems to serve a specific purpose.
Awesome issue, thanks! 👍