Results 1 to 2 of 2

Thread: Both sides blending

  1. #1
    Junior Member Newbie
    Join Date
    Mar 2011
    Posts
    6

    Both sides blending

    Hi, I'm trying to display anaglyph. I know how it should work, but I have problem with blending. I will explain it by example. I want do display some black text as anaglyph. Cyan text is drawn first, and then red one. Then red text is closer to observer blending works fine - every pixel where red text covers cyan is black. But when scene is rotated and cyan text is closer, it covers red text without blending.
    Here's pseudocode:
    Code :
    glEnable(GL_BLEND);
    glColorMask(CYAN);
    TranslateLeft();
    DisplayText();
    glColorMask(RED);
    TranslateRight();
    DisplayText();
    glDisable(GL_BLEND);

    What could be wrong?

    EDIT:
    I've forgotten about clearing depth buffer, and that caused problem. Sorry, my bad.

  2. #2
    Super Moderator OpenGL Lord
    Join Date
    Dec 2003
    Location
    Grenoble - France
    Posts
    5,574

    Re: Both sides blending

    As a side note, no need for blending when using colormask. This can reduce rendering time.

Similar Threads

  1. Disappearing sides
    By Mjiig in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 02-29-2012, 01:31 PM
  2. Visible Sides
    By ame_nguyenanhtai in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 08-04-2008, 01:42 AM
  3. two different colors for in and out sides
    By marceloc in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 06-26-2007, 02:28 AM
  4. Blending sides of cubemap when mipmapping
    By mogumbo in forum OpenGL: Basic Coding
    Replies: 0
    Last Post: 03-29-2004, 12:28 PM
  5. TWO SIDES
    By Dimae in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 04-17-2001, 03:52 AM

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