i create a 3d plane in blender and load a texture to it with alpha.
then convert it to c3b file and load it into cocos2d-x with sprite 3d . but alpha pixel filled with black color.
Hi. I found a temporary work around to this.
-First, somehow, you can try to export your data from back to front distance (try merging in order).
-Add a “if(gl_FragColor.a <0.5){ discard; }” in cocos/renderer/ccShader_3D_ColorTex.frag to avoid blending on these pixels
-Try deactivating depth buffer
GLContextAttrs glContextAttrs = {8, 8, 8, 8, 0, 0};
Hi. I’m new to cocos and I don’t know if there is a better way, but there is a way to Sort your triangles from your 3D program. Maybe dettaching and attaching the polygons again in order.
Your material should have a transparency map, it problably only has a diffuse map (the regular one) and it needs to have a transparency map also.
Open the .c3t, go to the materials section and u will see that u dont have this one. I went through this just a few days ago.
We solved this checking the checkbox of transparency of the material when exporting the fbx. You can pass the same png you use for the diffuse map as transparency map.
After it, check the .c3t and u will see that there is the new map
There is the diffuse map (the regular one, the image, the texture, u know what i mean :P), the normal map for the lighting and the transparency map for the alpha.
Notice that we are using the same .png for the diffuse and the transparency map