Gazebo | Ignition | Community
Ask Your Question

Turning off backface culling for a model [Gazebo9]

asked 2018-11-03 03:48:46 -0500

Stefan Kohlbrecher gravatar image

updated 2018-11-04 16:51:46 -0500

I'm using a low poly .obj model that approximates geometry using double-sided faces with transparent textures (or, it should, once the issue with transparency described in Gazebo Bitbucket issue 404 is fixed). To render these parts correctly, backface culling needs to be disabled for the model. How can this be achieved?

See image below. Only the front-facing railings of the walkways are visible, although the model has railings on both sides of the walkways.

image description

/edit: So I found out that using a custom material, backface culling can be switched off. This is done for instance in for the oak tree model in oak_tree.material. I can add a custom material to my model, but then the texture and material info from the COLLADA file are not used anymore. Any hints on how I can combine the material data from the COLLADA file, but switch off backface culling also?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2018-11-05 15:43:02 -0500

nkoenig gravatar image

I don't think you can combine a material script with material information contained inside a collada file.

Just brainstorming here. Can you achieve the desired behavior with multiple mesh objects?

edit flag offensive delete link more


That's actually what I did by now, inverting face normals and loading that second .dae file additionally. This messes up shadow rendering however (if shadow casting is enabled for both models). There are lots of aliasing artifacts on many planes, I assume because of z-fighting between two overlaid polygons (?). Can create a ticket for that issue too if you like :)

Stefan Kohlbrecher gravatar imageStefan Kohlbrecher ( 2018-11-06 03:38:25 -0500 )edit

Question Tools

1 follower


Asked: 2018-11-03 03:48:46 -0500

Seen: 668 times

Last updated: Nov 05 '18