Results 1 to 5 of 5

Thread: How a textured quad lighter?

  1. #1
    Junior Member Newbie
    Join Date
    Aug 2003
    Location
    Graz, Austria
    Posts
    10

    How a textured quad lighter?

    Hi guys!

    I've got the following problem: For our game, we use a '2d' ortho setup. Everything works fine. I'd like to be able to 'highlight' single objects on the screen when the mouse is right over them. Now I've experimented around and found, that

    glColor3f( 0.75 , 0.75 , 0.75 )

    will make things slightly darker. So I can use that by default for everything else and just use 1.0/1.0/1.0 for the highlighted object. However, that makes the scene quite dark overall and it gets a greyish look. Has someone some suggestion how this could be done more elegantly? I'd be very thankful if you could come up with some feasible solution...

    Thanks a lot and see ya, jp.

  2. #2
    Junior Member Newbie
    Join Date
    Aug 2003
    Location
    Graz, Austria
    Posts
    10

    Re: How a textured quad lighter?

    Strange, is there really no way to add 'light' to a texture during the blitting process in this whole OpenGL thing? Nobody got any clues? I know I posted this many month ago, but also then, no responses...

  3. #3
    Senior Member Regular Contributor
    Join Date
    Jan 2004
    Location
    Los Angeles, CA, USA
    Posts
    219

    Re: How a textured quad lighter?

    How about glColor3f(1.25,1.25,1.25); ?

  4. #4
    Senior Member Regular Contributor
    Join Date
    May 2003
    Location
    Germany
    Posts
    229

    Re: How a textured quad lighter?

    - Draw your textured quad
    - Enable blending
    - Set src-factor and dst-factor to GL_ONE (=additive blending)
    - Draw the quad again with a z-value nearer to your near-plane than your textured quad

    That's how I would do it. Cheap and easy to implement.

  5. #5
    Junior Member Newbie
    Join Date
    Aug 2003
    Location
    Graz, Austria
    Posts
    10

    Re: How a textured quad lighter?

    Thanks for the suggestions. The thing with the 1.25 seems not to do anything, but the other hint just works wonderfully. I didn't even have to care about the z-thing but it worked just by re-blitting with 'additional' mode. Wondeful! Great!

    Thanks a lot and see ya, jp.

Similar Threads

  1. textured quad will not draw
    By advorak in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 10-19-2015, 10:40 AM
  2. OpenGL 3.0 textured quad
    By Karol Gasinski in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 08-13-2009, 02:00 PM
  3. Fade in-out a textured quad ?
    By in forum OpenGL: Basic Coding
    Replies: 6
    Last Post: 07-31-2005, 07:01 AM
  4. Warping Textured Quad
    By Sebaot in forum OpenGL: Basic Coding
    Replies: 0
    Last Post: 03-17-2001, 10:38 AM
  5. Subdividing a textured quad
    By overloadnn in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 11-15-2000, 02:25 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