Results 1 to 4 of 4

Thread: Help me improve my opengl user interface!

  1. #1
    Member Newbie
    Join Date
    Oct 2003
    Posts
    30

    Help me improve my opengl user interface!

    Hello!

    I am writing an opengl user interface for windows platforms. I need to create buttons, textboxes, scroolbars, etc. The problem is that I want each control to be 3D and independent from the contents of the window I render into.

    One example should be the warcraft III user interface (with a shield, a flag and a sword redered as a backgroud and with buttons over those objects). I want a way to render the controls on top of what was previously rendered into the window.

    Here is my solution:

    -each control has a texture (or an area in a texture) associated with it. I render the object to the framebuffer and then glCopyTexSubImage it to its texture.

    I render each object and copy it to its texture, then render the entire window and apply the controls as textured quads (with transparency).

    I want to make the user interface work with mostly all the 3D cards so I don't want to use extensions unless they are widely supported.

    My solution is VERY fillrate limited because, for every object I do the following opperations:

    1) set all states as the object wants (not a fillrate limiter),
    2) I do a glScissor and a glClear to clear the framebuffer in order to draw the object
    3) I draw the object
    4) I glCopyTexSubImage the object to its texture
    5) I glBindTexture and apply a quad textured with the object

    As you can see, besides drawing the object I also do the equivalent (more or less) of 3 glClear (glClear, glCopyTexSubImage and drawing the textured quad)

    This implementation works as I want it to work, meaning that the controls have the same aspect no matter what projection matrix I have for the background and what I draw there.

    However, I want to make it faster.

    Do you have any ideas ?

  2. #2
    Member Newbie
    Join Date
    Oct 2003
    Posts
    30

    Re: Help me improve my opengl user interface!

    I have found a solution...

  3. #3
    Guest

    Re: Help me improve my opengl user interface!

    What was your solution?

    I'd recommend drawing your scene, clearing the depth buffer, then drawing the controls.

  4. #4
    Member Newbie
    Join Date
    Oct 2003
    Posts
    30

    Re: Help me improve my opengl user interface!

    That was my solution. But given that the controls may use stencil and alpha, i'll clear those also

Similar Threads

  1. User Interface
    By imported_Roberto in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 10-31-2014, 11:53 AM
  2. User Interface using OpenGL
    By Mukund in forum OpenGL: Windows
    Replies: 2
    Last Post: 03-18-2010, 08:28 PM
  3. 2D User Interface
    By Rodrix in forum OpenGL: Basic Coding
    Replies: 6
    Last Post: 03-02-2006, 03:46 PM
  4. user interface
    By rothgar in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 01-30-2004, 04:38 PM
  5. User Interface
    By in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 12-16-2002, 01:33 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