Loaded Model is Invisible On One Side

This one is hard to explain, so I created an animated gif screen capture of it.

The yellow box works fine and was not generated in Blender. The blue plane that shows up part of the time was created in Blender and converted from the .blend file to .bam using blend2bam. The plane looks like it has no thickness but it does. I did not set a material in Blender so that Panda could control the color, and there is no transparency set. I don’t understand why the model is visible from some angles and not others. It has to be something with how I created the model or the blend2bam conversion, but I’m not sure where to look.

Panda3D 1.10.5
Ubuntu 18.04 64-bit

It looks like backface culling, based on that gif.

In short, in case you’re not familiar with backface culling: graphics engines often don’t show faces that are pointed away from the viewer–“backfaces”; this saves on rendering, I believe.

(Here’s an article that seems to describe the matter in greater depth, should you be interested: https://en.wikipedia.org/wiki/Back-face_culling )

However, Blender may have backface culling disabled–it’s toggled by a check-box, as I recall–in which case an object may appear fully visible in Blender, but not when rendered in a game engine.

Would you share the blend-file, please? I’d like to check to see whether this is indeed the problem. (With the caveat that I’m using Blender 2.78; if you’re using a later version, I may not be able to open it. However, in that case perhaps someone else will check the model!)

Thanks for the reply and the link on back-face culling. I’ve attached the blend-file. I’m running Blender 2.82. The most I’ve ever done with blender before this is skim through a couple tutorials, so I’m learning as I go.

plane.blend (595.5 KB)

Yeah, unfortunately it doesn’t open properly in my version of Blender. Sorry about that! :/

Aside from waiting for someone with Blender 2.8 to check the model, I’d suggest turning on backface culling in Blender and seeing whether the same problem is then visible there, too.

(In my version the relevant check-box for backface culling is in the right-hand panel of the 3D view, under the heading of “Shading”. However, I think that Blender’s interface may have changed in 2.8, so be prepared to either look around or search online if it’s not located in the same place in your version.)

That’s right, the back side of the polygon is dropped.
In fact, the blender covers the back side. You can achieve this effect. Use:

nodePath.setTwoSided(True)

https://docs.panda3d.org/1.10/python/programming/render-attributes/backface-culling-and-frontface-culling

1 Like

Note, however, that backface culling exists for a reason: be sparing in disabling it, I suggest!

1 Like

That worked, thanks. I will be sure to use is sparingly, but in this case I think it’s warranted. Thank you both for your help.

1 Like

If the blue plane has got a thickness, and is essentially a box. Wouldn’t “flipping” the bottom polygon so its normals face the right way, be a more streamlined solution ?
(unless it’s not a box,and is just a plane…if so,ignore me)

2 Likes

One thing I forgot to try was turning on back face culling in Blender. If I turn that on, the plane becomes transparent when I rotate around to the back side.

@PetGerbil The plane does have a thickness. Flipping the normal(s) for that face did indeed fix the problem. Thanks!

1 Like