Results 1 to 2 of 2

Thread: Silhouette style texturing

  1. #1
    Junior Member Newbie
    Join Date
    Sep 2009
    Posts
    14

    Silhouette style texturing

    Here's what I would like to do:

    I have some texture which has an alpha layer. Let's, for argument's sake, say that it is an image of a tree with backround having an alpha value of 0.

    Firstly, how would I go about drawing a silhouette of the tree? (i.e. discard actual texture RGB values in favour of some plain colour, but still use the texture alpha values).

    Now, (and this is what I would actually like to do, but I'm hoping that if I know how to do the first, I can work this second bit out): how would I go about drawing an inverted silhouette. So, in the case of the tree, the result would be a tree-shaped whole with a solid "background" of some specified colour.

    It needs to work for an FBO, so I'm not sure if using the stencil buffer is an option (unless you don't mind showing me exactly how to use a stencil buffer with FBOs :P).

    Thanks in advance.

  2. #2
    Senior Member Regular Contributor
    Join Date
    Oct 2009
    Posts
    132

    Re: Silhouette style texturing

    Can you use fragment shaders?

    All you need to do in that case is when you are performing the look-up for the texture, find out it's alpha value and colour the fragment accordingly.

Similar Threads

  1. silhouette of a cylinder
    By hoschie211 in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 11-18-2009, 11:44 PM
  2. Silhouette Edges
    By Riskz in forum OpenGL: Basic Coding
    Replies: 10
    Last Post: 04-13-2009, 04:57 PM
  3. C++ Style or C Style? Error on compiling...
    By DarkBrute in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 03-23-2005, 02:14 AM
  4. silhouette algorithms
    By mikemor in forum OpenGL: Advanced Coding
    Replies: 10
    Last Post: 10-26-2002, 01:18 PM
  5. Silhouette Edges
    By in forum OpenGL: Basic Coding
    Replies: 0
    Last Post: 11-27-2001, 08:36 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