Results 1 to 5 of 5

Thread: The Dark Side Of The QUAD

  1. #1
    Member Contributor
    Join Date
    Jan 2001
    Posts
    60

    The Dark Side Of The QUAD

    Hi,

    I'm wandering how do you do when you want to draw a quad that has a texture on one side and looks black from the other side...

    Any ideas, other than draw another black quad?

  2. #2
    Senior Member Regular Contributor
    Join Date
    Apr 2003
    Location
    Toulouse, France
    Posts
    133

    Re: The Dark Side Of The QUAD

    it can be done using lighting.
    set a white front material, a black back material on the quad, and set the texenv to GL_MODULATE.

    it doesn't work for other color (black modulated by a texture is black but yellow modulated by a texture is not yellow).

  3. #3
    Senior Member OpenGL Pro
    Join Date
    Feb 2002
    Location
    Bonn, Germany
    Posts
    1,633

    Re: The Dark Side Of The QUAD

    Use culling.
    glCullFace(GL_BACK);
    glEnable(GL_CULL_FACE);

    Only the front of the quad will show.

    Two-sided lighting should work too, but is a much bigger burden on the hardware.

  4. #4
    Member Newbie
    Join Date
    Jul 2003
    Posts
    42

    Re: The Dark Side Of The QUAD

    However, if you wish for the back of the quad to appear BLACK you cannot use Culling as the cull will simply not render the face, not draw it as Black. Two sided lighting however, will.

    [This message has been edited by Clayton (edited 08-28-2003).]

  5. #5
    Senior Member OpenGL Guru
    Join Date
    Feb 2000
    Location
    Sweden
    Posts
    2,978

    Re: The Dark Side Of The QUAD

    It is possible to do that with back face culling, but you have to draw your object twice; once for front and once for back faces.

Similar Threads

  1. hang when running two programs side by side
    By remdul in forum OpenGL: Windows
    Replies: 2
    Last Post: 12-29-2011, 09:03 AM
  2. shaders - opposite side is dark
    By vladd in forum OpenGL: GLSL
    Replies: 0
    Last Post: 02-28-2005, 06:45 AM
  3. Right side and Left side Lighting not happening
    By iris_raj in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 12-11-2003, 06:39 PM
  4. Dark textures in a dark scene
    By nexusone in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 11-30-2002, 07:33 AM
  5. wire appears to move from side to side on object
    By JoeFinn in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 01-18-2001, 09:18 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean