Archived

This topic is now archived and is closed to further replies.

JodoKast

User Interface

Recommended Posts

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

Share this post


Link to post
Share on other sites
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)

Share this post


Link to post
Share on other sites
Well, yeah, the ortho mode is standard, but he asked how to render a scene and not cover it by the HUD.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
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).

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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).

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites