Opacity + Vertex Color

Hi,

For some reason Vertex Color is not working with Opacity on the default Physical and Phong Materials. This used to work fine on older versions of the engine. The Vertex Color is picked up no problem on the Diffuse. I have tried different channels and blend types to no avail.

Here is my test scene:

https://playcanvas.com/editor/scene/934467

Hopefully someone has an idea for how to resolve this.

Many thanks!

Hi @mr-jose,

I can confirm the issue, it seems the vertex color isn’t not working for calculating the opacity factor.

Would you like to open an issue about it in the engine repo?

@mvaligursky, anything changed in the engine recently about this?

Hi @Leonidas, yes I have just opened an issue on it.

Thanks!

2 Likes

I change my local engine a little bit to override vertex alpha by random values in 0…255 range and that made it to render with alpha holes as expected. It seems perhaps either fbx does not contain any alpha in vertices (all 255), or our fbx converter to json (and glb) does not extract it. @slimbuck will investigate that part.

1 Like

@mvaligursky

This may or may not help, but I opened an old project (circa 2017) that I was using vertex color with alpha and that was not displaying correctly, in this instance it was not a new FBX, nor did re-upload the FBX to update the json model.

1 Like

Hi @mr-jose,

Are you sure this FBX has alpha in the vertex colour data? I imported the FBX into maya and don’t see any alpha on the vertex colours (though this could be a maya issue).

Perhaps the older version used one of the r,g,b channels for alpha instead? Could you give me access to the old project that definitely worked?

Thanks!

Hi @slimbuck

You got me thinking about my process here so I went back to Max, checked the vertex color channel and switched this to Alpha instead of RGB, after re-importing this works correctly. So my guess is in older versions of the engine I could use the RGB channels (in my earlier project I used R). Is this the correct behaviour?

Thanks!

Oh I see, you were attempting to use per-vertex r, g or b channel to drive alpha but that wasn’t working. This is definitely a bug and we’ll look into it thanks to your github issue. :+1:

2 Likes

Hi,

The entity model named "ALPHA-TransferData-after-BAKE-TO-VERTEX"
contains a fbx model that I exported from Blender that uses vertex information to decide on the opacity when rendering in CYCLES (raytracing for Blender). So I know the information is in the object, but PlayCanvas doesn’t seem to render the vertex information in it’s opacity settings. Take a look at the project below:

https://playcanvas.com/editor/scene/1082186

The object in question is the one that the ice-cream man is standing on.

Hi @Anton_Gunaratnam_s_S,

Indeed I’ve imported your model in Blender and everything seems to be painted correctly.

The github issue is still open, there seems to be a bug in the engine. Would you care to add your use case to bring some attention to it?

Hi,
I’m not sure what you mean by add my use case.
I’ve opened a new post in the forum here:

That’s good, though avoid posting double posts about the same subject.

The github repo I’ve posted above gets direct attention from the engine developers, and it already contains an issue about the bug you’ve encountered. You can try posting there as well, it may help resolve the bug faster.

1 Like

Oh oh, I’ll do that. Thanks