Author Topic: Rendering planes  (Read 1970 times)

Offline jiarongkoh

  • byte
  • *
  • Posts: 18
    • View Profile
Rendering planes
« 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?

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Rendering planes
« Reply #1 on: December 31, 2014, 10:54:24 am »
Try setCulling(false); on the plane.

Offline jiarongkoh

  • byte
  • *
  • Posts: 18
    • View Profile
Re: Rendering planes
« Reply #2 on: January 04, 2015, 09:57:21 am »
Great it works! Thanks! ;D

Offline jiarongkoh

  • byte
  • *
  • Posts: 18
    • View Profile
Re: Rendering planes
« Reply #3 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?

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Rendering planes
« Reply #4 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.