Results 1 to 4 of 4

Thread: Masking question

  1. #1
    Junior Member Newbie
    Join Date
    Aug 2002
    Posts
    19

    Masking question

    Hi there!

    My problem is the following: I have an object loading and drawing class already working, and i don't want to implement depth sorting for my polygons, but i want to draw tree branches with black and withe alpha masks. I understend why depth ordering necessary for blending but in this case i have no transparent pixels just masked or non masked, so is it somehow possible to mask the depthbuffer with my black and withe image mask? or is there any other way to draw masked faces without depth ordering?

    Thanks, a lot!

  2. #2
    Senior Member Regular Contributor
    Join Date
    Jul 2001
    Posts
    442

    Re: Masking question

    Stencil buffer with depth test as well.

  3. #3
    Senior Member Frequent Contributor
    Join Date
    Sep 2000
    Location
    SWEDEN
    Posts
    601

    Re: Masking question

    Sounds like a perfect job for the alpha test. Set the alpha of the texture to white for opaque parts and black for transparent parts. Then enble alpha test and call glAlphaTest with appropriate parameters (look it up). Bingo.

  4. #4
    Junior Member Newbie
    Join Date
    Aug 2002
    Posts
    19

    Re: Masking question

    Thaks guys! Writing a TGA loader, changing texturing mode to glmodulate and useing alphatest does the work. Thanks for your help!

    p.s.: sorry for my poor english

Similar Threads

  1. masking in 3D?
    By jaypozo in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 04-09-2010, 03:26 PM
  2. Masking + Fog.....
    By PhotonMan in forum OpenGL: Advanced Coding
    Replies: 1
    Last Post: 02-04-2004, 08:31 AM
  3. Masking?
    By imported_zedus in forum OpenGL: Basic Coding
    Replies: 4
    Last Post: 01-07-2002, 11:10 AM
  4. Masking
    By Crunch in forum OpenGL: Basic Coding
    Replies: 7
    Last Post: 12-09-2000, 05:20 PM
  5. Fog & Masking
    By DPalomo in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 06-25-2000, 12:50 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