[solved] rendering issue

Hi everyone.

Let me explain what my project is before I expose my problem.

I have to represent in a 3dimensional world the company servers, bases, and flows between those bases. After a lot of discussion, we (me and my boss) agreed on a simple representation : servers will be cylinder and bases will be spheres, places inside a cylinder (just like a box of tennis balls). In order to be able to view a maximum of things, the cylinders are blue and transparent (alpha = 0.2) and the servers are red and transparent (alpha = 0.5).

Once the models are created, they will not move. Ever. The user moves inside the world with FPS-like control. And that’s all (for the 3D part at least)

BUT

There is a clipping (or a transparency) issue. Depending on the orientation or the position of the camera, some spheres are hidden, and not always the same one.

You can find two screenshot of the same scene with a slightly different camera position here : picasaweb.google.com/morel.jeremy/Visu3D

Do you know how I could solve this problem ? I don’t have a lot of time for this project, and if I don’t solve this problem, I will have to move to Ogre3D (and that would be a shame)

I read that I could change the rendering order. I think that I can decide with no difficulty on what is more important to see on screen (the server, then the base), but in the manual it talked about switching off the Zbuffer, which (I think) would create a lot of issues for me.

By the way: if I hide the cylinders, there is no problem.

I had to reproduced your problem with three small boxes inside a larger box. Would have been faster if you provide a working example (code and models ) the next time.

To solve it just use another transparency mode (not MAlpha) for all objects.

np.setTransparency( TransparencyAttrib.MDual )

enn0x

Thanks a lot, It works great.

I sorry to have bothered you with that, and I’m sorry for not providing a piece of code, but the little talk I had on irc yesterday lead me to think that I would have to change the rendering order, I did not think that it could be something else.

Thanks again.

Not a problem.

Of course the cause for your problem is that Panda3D sorts objects (close/far) before it renders them. Changing the render order by hand is a way to solve your problem, but it’s “ultima ratio” (pun intended). There are half a dozen other ways you can try first. This manual page explains them better than I could do:

http://panda3d.org/manual/index.php/Transparency_and_Blending

enn0x