3D render order when some 3D sprites have transparency

Hi,
My game has some Sprite3d nodes that have transparent parts. In this case those nodes have to be rendered after the the opaque nodes and in order from far to near. Does cocos2d-x do this correctly, and what triggers it to work that way? I’m using .c3t files in combination with .material files to define the Sprite3d nodes. I don’t know what calls to make or fields to add to ensure that cocos3d-x is told that there is transparency.

You should use .c3b files, I think, at least for production: http://cocos2d-x.org/docs/cocos2d-x/en/3d/tools.html

If this is not a typo, perhaps you are using this: http://cocos3d.org/?

I’m pretty sure .c3b and .c3t files contain exactly the same information, just in a different form, so which I use shouldn’t have any affect on how transparency is handled. .c3t are good for development because you can view them with a text editor.

Yes, cocos3d-x was a typo.

Agreed. I was just letting you know.

I may have found the answer to my original question. cocos2d-x may be able to specially order the rendering of Sprite3Ds based on the whether blend is set to true in the renderState section of the material file. Anything with transparency will need that setting. I’ll have a go and see if it just works.

Let me know. I can ask engineering

Will do, once I find time to try it out.

That would be great, thanks. Would be nice to have a definitive answer.

I’ve found one way that works. You can call setOpacity on the Sprite3D with a value less than 1.0. That seems to trigger cocos2d-x into reordering the rendering correctly. Also, because I’m using .material to specify the shaders to use, the setOpacity call has no effect on the look of the object, so there is no detrimental effect from making the call.

Without the setOpacity call, standard rendering order is used, and some other objects dissappear when viewed throught the transparent object. That happens even with blend set to true in the render state.