Single Surface GUI - good | bad idea?

Blitz3D Forums/Blitz3D Programming/Single Surface GUI - good | bad idea?

Techlord(Posted 2007) [#1]
Post your opinions.


Stevie G(Posted 2007) [#2]
It really depends on what the GUI is for? The 3d gui lib I recently wrote was pixel perfect but it was not necessary to use single surfaces for multiple gadgets. Each gadget is a separate quad entity which makes managing / manipulating them easier. Single surface is good for rendering in terms of raw speed but I don't think it's necessary for a GUI unless you have alot of gadgets on screen. It's a case of trading speed over flexibility - I choose the later.


Techlord(Posted 2007) [#3]
@Stevie G: Thanks for the insight. I'm using the GUI for my RPG FPS. I anticipate lots of gadgets for dialogboxes, inventory list, and in-game editors.


Danny(Posted 2007) [#4]
I'd seriously consider using the FastText and FastImage libraries. Even with single surface you'd still have to build a bitmap based texture for it. And using FastImage you won't have the texture-resolution problem of it needing to be 256x256 or 512x512, etc...

d.


Abrexxes(Posted 2007) [#5]
http://mgui.designdevil.de/blog/editor_video_08.html

Wait for this...... ;)


EPS(Posted 2007) [#6]
Link is not longer present. Look here:

http://www.east-power-soft.de/index.php?menu=blitzbasic_bmgui


bytecode77(Posted 2007) [#7]
all in all you're best with a normal GUI. a single surface gui might be faster and allow transparency but causes problems like to one to make one!


Chroma(Posted 2007) [#8]
Stevie...did you just parent your gui quads to the camera or use a system similar to sswift's method of drawing them way out of view etc?


_33(Posted 2007) [#9]
A single surface gui implies that you will use a bitmap to draw into all your buttons and bars and text and graphics. I think it's a very bad idea. It won't be fast since your constantly playing with pixels in the main memory, and you'll have to upload your texture (copy to texture buffer) everytime you change the graphics.

It's much preferable to map all your individual graphics to unique polygons, and manage all of those apart. It's much more work, but it will be fast on everything and you will like the results in all the resolutions. You can do this sort of work in FastImage easily, and it will be FAST.


Stevie G(Posted 2007) [#10]

A single surface gui implies that you will use a bitmap to draw into all your buttons and bars and text and graphics



I don't think it implies that at all. Drawing text to the buttons would defeat the purpose for the reasons you mention.

I render the whole GUI using a GUI cam way out of the scene and use several big textures for text and button graphics etc.. where I create a button by specifying various params and then convert pixel sizes to u,v offsets. My text system recalculates offsets on a row of quads depinding on which character is to be displayed. Using vertex colours I can also do a simple shading effect.

As a game menu does not really require raw speed, for simplicity I use a new entity per button. It makes things easier to manage.

Here's what it currently looks like in the Stramash editor .. I will be using similar for my Vehicle game.




_33(Posted 2007) [#11]
I didn't explain myself clearly. But Stevie G's system does what I was talking about.