Best way to get 2D overlays or images on screen (for a GUI).

Started by
10 comments, last by Kwizatz 10 years, 10 months ago

immediate OGL calls?

More like single vertex calls like glColor(1,1,0,1) etc.

I am not seeing any issues right now with my approach either, I am not really looking for alternatives right now

There's nothing wrong with your approach.

but its kind of something you don't see talked about too much, I've seen all kinds of shaders for example, but not one specific to GUI rendering, so I was just wondering if there was some sort of defacto way to do it I didn't knew about.

In fact you can render your whole gui as 3d mesh (consisting of multilayered quads in front of a orthogonal camera). This way you could utilize some interesting effects, e.g. dynamic lighting of the gui, where the cursor is the light source, or automatic highlighting/bloom outlines of selected elements, gui shadows etc. This is not for pure functional guis, but it is really nice to pimp your gui visuals :)

Advertisement

I see, immediate mode, there is no reason why my GUI won't work with that, but since is no longer on core profile, I decided to drop it. but you're right, the amount of vertex calls for a single quad are too few in comparison to a full mesh that immediate mode shouldn't have that much of an impact in this situation.

In fact you can render your whole gui as 3d mesh (consisting of multilayered quads in front of a orthogonal camera). This way you could utilize some interesting effects, e.g. dynamic lighting of the gui, where the cursor is the light source, or automatic highlighting/bloom outlines of selected elements, gui shadows etc. This is not for pure functional guis, but it is really nice to pimp your gui visuals smile.png

I hadn't though much about that, It is nice, and you gave me a reason to expose shaders to the user, its all pimping of the UI as you said though, what I meant was that you never see any shaders for the basic operations, for example doing the bulk of the drawing on the fragment shader rather than just effects, but I guess its not really practical, and the way to do it is still the same as it was before the dynamic shader pipeline.

Thanks for your help! :)

This topic is closed to new replies.

Advertisement