Skip to main content
gamedev.net
🔒 Locked

User Interface

Started by JodoKast May 17, 2004 at 3:27 PM 14 replies 800+ views
Original Post
JodoKast
JodoKast
How do I implement a nice looking frame around the outside of my screen (like in Diablo and Diablo II)? Do I render the whole scene and then render a transparent texture that covers the screen area last? Thanks
Kris2456
Kris2456
Are yuo trying to make a HUD? If so then i would use Ortho. But atthe mo im pretty much on the same question as u...

--------



"Here lies a toppled God,
His fall was not a small one,
We but built his pedastle,
A narrow, and a tall one"
Frank Herbert (Dune:Messiah)
------------ "Here lies a toppled God,His fall was not a small one,We but built his pedastle,A narrow, and a tall one" Frank Herbert (Dune:Messiah)
_the_phantom_
_the_phantom_
switch to ortho, draw top, left, right and bottom parts, switch back to perspective, job done.
Raduprv
Raduprv
Unless he uses the scissor test, to avoid drawing on the edges, or uses two different viewports, a smaller one for the scene and a bigger one for the GUI, then he should first draw the scene (persoective) and then go to Ortho and draw the GUI.
_the_phantom_
_the_phantom_
i was detailing the method of doing it assuming you have already draw your scene, granted i could have been clearer but hey, thats life
Trienco
Trienco
hmm.. i take it the scissor test can reject quite a bit earlier than the z-test? though the latter allows for fancy shapes. drawing the gui first with minimal z should usually work in most cases, shouldnt it?
f@dzhttp://festini.device-zero.de
_the_phantom_
_the_phantom_
drawing it last, with z-testing disabled, in ortho mode would work in all cases however
Raduprv
Raduprv
quote:
Original post by Trienco
hmm.. i take it the scissor test can reject quite a bit earlier than the z-test? though the latter allows for fancy shapes. drawing the gui first with minimal z should usually work in most cases, shouldnt it?


Well, it''s always a good idea to draw the GUI last, Z test disabled. It''s safer, because you don''t want the have parts of the GUI covered by a clif or something (by accident).
Trienco
Trienco
quote:
Original post by Raduprv
Well, it''s always a good idea to draw the GUI last, Z test disabled. It''s safer, because you don''t want the have parts of the GUI covered by a clif or something (by accident).


yep, but at the same time the gui is usually cheap and simple and might hide a lot of multitextured fancy shaded geometry. not to mention that drawing it last automatically wastes more fillrate. i would expect drawing in ortho mode making it easy to assure the gui is ending up with 0 in the z-buffer. using less instead of less-equal should prevent anything sticking through it.

of course clipping early would be even better for parts completely covered by the gui. yes, i know.. performance junky.

f@dzhttp://festini.device-zero.de
Sphet
Sphet
I always set up my GUI to render last incase I ever want anything alpha-blended against my rendered scene - the fillrate cost is a valid concern, but the HUD should never be too complex anyways.
Raduprv
Raduprv
If you use a scissor test, or having the game scene viewport smaller than the gui, then no fillrate/performance is wasted.
And as Sphet well said, you can get alpha blending this way as well (we actually even have most of the menus alpha blended with the scene).
JodoKast
JodoKast
How about some sample code?
Trienco
Trienco
quote:
Original post by Sphet
I always set up my GUI to render last incase I ever want anything alpha-blended against my rendered scene


good point. i think im developing a fill rate phobia. cards can push a million triangles at 100fps, but fancy texturing and vegetation can still kill your app.

f@dzhttp://festini.device-zero.de

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.