fbx import and apha channel bug?

geotrupede's icon

see enclosed patch, using an fbx with animation and alpha channel to show a butterfly.
I am sending a video showing the issue, the model in fbx and the path hoping somebody with experience will make sense of it.
The issue is as follows:
alpha does not work properly unless the depth check is 0, and when this is set to 0 the surface normals determine what is in front, which is also not working.
what can be done?
is this an issue with fbx import, an error on my side?
please advise
G>

Max Patch
Copy patch and select New From Clipboard in Max.

blue.fbx.zip
application/zip 8.09 KB
the 3d model with textures and alpha channel to read into the patch

geotrupede's icon

and the video showing the issue here:

video.mov
video/quicktime 829.33 KB
see when the butterfly rotates, wing redraw in the wrong order, why???? and if the depth check is on then order is correct but a grey halo is visible???

Cory Metcalf's icon

Hi @GEOTRUPEDE. The textures and alpha don't seem to be included. Do you mind sending an email to support@cycling74.com with your textures and alpha? Also, if you can include an additional object or model from you scene with the depth testing you were doing, that would be great.

Thanks!

Cory

geotrupede's icon

texture with alpha

Rob Ramirez's icon

hi GEOTRUPEDE
to properly render this object you need to draw it twice, first with back faces culled and second with front faces culled. You can use the cull_face and layer attributes on two gl.model objects to do this. you can use jit.anim.node to sync the transforms between them.

Max Patch
Copy patch and select New From Clipboard in Max.

geotrupede's icon

thank you, just tried and it does almost work.
there seem to be a slight delay in the two animations...
this is not even constant but seems to change when the view is rotated, is there any way to improve?
thanks
G>

Rob Ramirez's icon

you will probably have to manually sync the animations. you can query the properties using the getanim_dict message, and use jit.time.line to drive the two animations. here's how I would approach this:

Max Patch
Copy patch and select New From Clipboard in Max.

geotrupede's icon

Thanks!!!!

Problem solved.
Conclusion:
I have a lot to learn : )
G>