Horde3D

Next-Generation Graphics Engine
It is currently 09.11.2024, 00:51

All times are UTC + 1 hour




Post new topic Reply to topic  [ 9 posts ] 
Author Message
 Post subject: Overlay Improvements
PostPosted: 10.02.2010, 01:34 
Offline
Engine Developer

Joined: 10.09.2006, 15:52
Posts: 1217
The current overlay coordinate system which has coordinates in the range [0..1] on both axes does not work well with different aspect ratios which you have a lot these days (4:3, 16:9, 16:10). To avoid stretching of overlays and additional logic to compensate for that, I think we should have the the y-axis fixed (0..1) and the x-axis aspect ratio dependent with a range of [0..aspect ratio]. That way overlays can have a more intuitive size. The horde logo for example which uses a 256,128 resolution texture would always have twice the width compared to its height, independent of the screen resolution and aspect ratio.

I would also propose to change the interface to reduce the number of function parameters and make the function more powerful:

Code:
void h3dShowOverlay( float *verts, int vertCount, float colR, float colG, float colB, float colA, H3DRes materialRes, int flags )


Flags could be PixelPerfect (for drawing pixel-accurate fonts), DrawLines (lines instead of quads, useful for performance graphs) and other goodies like using two corners to define a quad etc. The layers are gone in the the proposal and the submission order would be taken instead. For better performance, horde would automatically batch consecutive overlays that have the same material and flags.


Top
 Profile  
Reply with quote  
 Post subject: Re: Overlay Improvements
PostPosted: 01.03.2010, 18:48 
Offline

Joined: 09.09.2009, 18:58
Posts: 107
I just want to throw in my two cents here, but I will offer the backend code of Mob2D under the LGPL to help accomplish this. It is very efficient at rendering 2D elements, and can even animate them if the definitions are set properly, and I am sure could be even better. I am still constantly making improvements to it myself to act as a standalone engine, but I think it could provide a huge boost to Horde's 2D rendering abilities.


Top
 Profile  
Reply with quote  
 Post subject: Re: Overlay Improvements
PostPosted: 19.03.2010, 08:12 
Offline

Joined: 05.01.2008, 19:46
Posts: 6
I have personally liked how agar lib handles the windows, maybe something can be built based off this in order to add support for powerful gui libraries like libagar ( http://libagar.org/index.html )


Top
 Profile  
Reply with quote  
 Post subject: Re: Overlay Improvements
PostPosted: 08.04.2010, 20:17 
Offline
Engine Developer

Joined: 10.09.2006, 15:52
Posts: 1217
The new overlay function (called h3dShowOverlays), including the changes to the coordinate system, is in the trunk now. It should be quite a bit more efficient as it does not use immediate mode any more and tries to batch together overlay drawcalls.


Top
 Profile  
Reply with quote  
 Post subject: Re: Overlay Improvements
PostPosted: 25.09.2011, 17:44 
Offline

Joined: 29.10.2010, 14:28
Posts: 46
Location: Hungary
Hello!

I tried to add a rotation parameter to the overlay drawing.
But the glRotate is ignored. I touched the Renderer::drawOverlays()
function, before the glBegin/glEnd section. How can I rotate
the modelview matrix?


Top
 Profile  
Reply with quote  
 Post subject: Re: Overlay Improvements
PostPosted: 25.09.2011, 20:58 
Offline
Tool Developer

Joined: 13.11.2007, 11:07
Posts: 1150
Location: Germany
You are using fixed function pipeline commands. Those are not supported by Horde3D. You have to rotate the overlays in the shader.


Top
 Profile  
Reply with quote  
 Post subject: Re: Overlay Improvements
PostPosted: 01.10.2011, 11:47 
Offline

Joined: 29.10.2010, 14:28
Posts: 46
Location: Hungary
Thank You!

Can You tell me, how can I do it?


Top
 Profile  
Reply with quote  
 Post subject: Re: Overlay Improvements
PostPosted: 03.10.2011, 21:14 
Offline
Engine Developer

Joined: 10.09.2006, 15:52
Posts: 1217
Does this thread help you?

http://www.horde3d.org/forums/viewtopic.php?f=2&t=489


Top
 Profile  
Reply with quote  
 Post subject: Re: Overlay Improvements
PostPosted: 04.10.2011, 19:02 
Offline

Joined: 29.10.2010, 14:28
Posts: 46
Location: Hungary
Yes, thank You :)
But this solution is not the fastest...
I tried to make it with the gpu.
I hope once You will implement it into the engine :)


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: Bing [Bot] and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group