Best method to create overlay style interface...

Started by
3 comments, last by emaurina 22 years, 9 months ago
Hi, I''m experimenting with an interface for a game I''m working on and am having trouble deciding the best method. Basically, I''d like to have a console where the UI is around the center viewport, something like: YYY YxY YYY Y is control I/O area and X is the view into the game world. (Note that scale is not 1:1 as above ) I''ve thought of two basic methods to do this: 1. Use viewports: 111 234 555 1,2,4,5 - UI controls, et al (Orthographic View) 3 - Main View window (Perspective View) I like this idea because it is simple and reduces wastefull fill (see #2 below). I don''t like this idea because it might be slow. I don''t know what the overhead and gotchas of of the viewport call are. I worry about stalling the pipeline. 2. Use one window and do the following a. Render Perspective view of world for this frame, b. Disable Depth buffer c. Switch to Orthographic view d. Enable blending e. display controls, et al to screen, using blending to keep a hole over the perspective view ''open'' I like this idea because it doesn''t require any fancy calculations and because it gets rid of the unknown issue of multiple viewport calls. I don''t like this idea because it is a fill waster. After sending all the data in the perspective view down the pipe I cut out 30%+ by overlaying it with a mask. Considering that my current occlusion method is not 100% efficient (i.e. some overlap) this translates to a lot of waste fill. Thanks for any ideas you might have. -Ed Life is short...live every day.
Life is short...live every day.
Advertisement
I think multiple viewports looks cleaner.

You do not write what you are doing but general speaking do I like games that really use the whole screen. If the player does not needs to see the controls all the time would I go for a split mode system.
During normal play can the GUI be temporary activated by some key.
Obelix,

Thanks for the reply. At this time I''m not sure if I''ll have a dual-mode system. i.e. w/ and w/o GUI.

-Ed

Life is short...live every day.
Why don''t you try them both and see what the speed differences are? The nice thing about #2 is that you do get more area with which to render your scene (if you make your gui semi-transparent). Plus, how are you going to display help menus and stuff in-game if you use #1? Personally, #2 sound to me to be the best.

-Blackstream

Will you, won''t you, will you, won''t you, won''t you take my virus?

-The Mad Hacker

Blackstream''s Webpage
-Blackstream Will you, won't you, will you, won't you, won't you take my virus?-The Mad HackerBlackstream's Webpage
I''m not sure if I understand you''re question exactly... (but that''s just me - are you asking about the best method to draw a interface with the game part in the middle?

I''d try using scissor testing (I think this is what it is), which lets you draw only to a small region of the screen. In other words, draw the surrounding interface, with whatever you like in the middle (nothing, or a colour, or anything, it''ll just be drawn over) and then scissor so that the rest of your gl calls only draw to the center of the screen. Then render your game.

This is probably a lot faster than using multiple viewports or blending like your first post indicated you were doing... of course, I might be totally off on the wrong track for what you want to do.

I think NeHe has a scissor-testing tutorial.

Hope this helped.

This topic is closed to new replies.

Advertisement