Rendering planes

Started by jiarongkoh, December 31, 2014, 10:33:38 AM

Previous topic - Next topic

jiarongkoh

Hi all, I was drawing a plane and realised that the texturing of the plane is only on the front of the plane, not the back. That is to say if I rotate the plane to the back, its transparent. Anyway to texture the plane throughout both front and back?

EgonOlsen

Try setCulling(false); on the plane.

jiarongkoh


jiarongkoh

Hi Egon, can I ask if there is a way to change the texture or set colors on cullings? I just realised that the setCulling(false) shades the back face of the plane that I'm drawing but it sets a default color to black. Anyway to change its color?

EgonOlsen

No, at least not without a custom shader. That's because the surface and vertex normals only point into one direction. The opposite side won't be lit. The best way to solve this is to simply use two objects, one for the front and one for the backside and leave culling enabled.