Turning off backface culling for a model [Gazebo9]
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.
/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?
Asked by Stefan Kohlbrecher on 2018-11-03 03:48:46 UTC
Answers
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?
Asked by nkoenig on 2018-11-05 16:43:02 UTC
Comments
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 :)
Asked by Stefan Kohlbrecher on 2018-11-06 04:38:25 UTC
Comments