www.jpct.net

jPCT-AE - a 3d engine for Android => Support => Topic started by: jiarongkoh on December 31, 2014, 10:33:38 am

Title: Rendering planes
Post by: jiarongkoh on December 31, 2014, 10:33:38 am
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?
Title: Re: Rendering planes
Post by: EgonOlsen on December 31, 2014, 10:54:24 am
Try setCulling(false); on the plane.
Title: Re: Rendering planes
Post by: jiarongkoh on January 04, 2015, 09:57:21 am
Great it works! Thanks! ;D
Title: Re: Rendering planes
Post by: jiarongkoh on January 21, 2015, 12:18:53 pm
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?
Title: Re: Rendering planes
Post by: EgonOlsen on January 21, 2015, 02:46:31 pm
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.