Re: [GtkGLExt] Is it possible to use overlays with gtkglextmm?



Hi Shawn,

The application is specifically a viewer for these datasets and, while in normal operation the user would be expected to reduce the detail level (and so the number of points) when viewing very large files, one of the requirements is to have the facility to view large files in full detail. Applying transformations globally and moving the points away from the origin also cannot work because OpenGL uses single precision floating point, which cannot handle the need for having coordinates that can express, with precision, values such as 20000.345, so I currently place the points around the origin, their coordinates subtracted by offsets that change each time. Also, I have been using GTK because the program has quite a few functions and it allows me easily to control widgets, multiple resizeable windows and a few other things. Performance related to the CPU, RAM or the GPU is not the problem, the problem is only the slow speed of HDD I/O, which I want to reduce the use of by drawing the points only when they change, not when something above them changes to uncover some of them.

So, given that, I think my only option (apart from my hastily implemented method that draws certain things with GTK above the OpenGL parts (not ideal) or the other possibility of mainipulating the front and back buffers, which seems a little complicated) is to use overlays, which my hardware can handle. Given that the function Gdk::GL::Config::get_layer_plane() exists, it would seem that gtkglext has the functionality to allow the use of layers, perhaps by creating different contexts for each layer, but I cannot work out how to do it. How does it work?

On 10/02/10 18:08, Shawn Bakhtiar wrote:
hhmmmm....

That is a very VERY large data set. 1 million points! And the user needs to interact with all these points? Have you tried coming up with a clipping volume application side, which would reduce the number of points to render?

If the vectors are static around the origin, then the compilation should work, since all the rotation and translation would be applied globally . If the vectors are moving independently and change in respect to each other, then you are right compiling will not help. Compiling si good for rigid structures NOT fluid, as you have to recompile every time you make changes to the model.

I guess my next question would be why, this intensive an application, would you use a GUI anyway? For these many vectors you need LOTS of memory, and some power full CPU/GPU combination (optimization at the GPU level, really comes from drawing triangular surfaces, as they have hardware matrix calculators build in, more importantly the line cal is done hardware side). And why consume all that memory, with a windowing system. IMHO, all that many points are no good, unless it is full screen, so drop the gtkmm re-write in C, using the direct OpenGL libraries using platform specific.

I think you will see performance drastically improve ( -GUI).

just my MHO, hope it helps.
Shawn







i'm EMAILING FOR THE GREATER GOOD
Join me



Date: Wed, 10 Feb 2010 10:59:10 +0000
From: harg pml ac uk
To: gtkglext-list gnome org
Subject: Re: [GtkGLExt] Is it possible to use overlays with gtkglextmm?

Hi Shawn,

Unfortunately, I do not think that will work for me. I am dealing with something of the order of 100 million points or more, and I tried to use display lists previously. If I remember correctly, the reason I stopped using them was because they used up a huge amount of my memory when created (I do not know whether they always do this or if it was some sort of excess after the graphics card memory had been filled). That was a couple of months ago. Since then the program has been changed so that now the points move (change vectors, I presume) around the origin as, before, there were precision problems relating to OpenGL's conversion of doubles to floats. As it is, the program is pretty quick in most situations except when we are using the hard drive to store data and caching it (we do this because the data can, on occasions, be 10 GB or more), and I do not see how display lists can be used with caching.

For that reason I want the facility to write to different "layers" independently, such as the overlay facility, if it possible. Currently I am attempting to fiddle with the front and back buffers, copying from one to the other, but I would rather try the overlays (which my graphics card says it can handle) which I believe would be easier to understand and maintain. So, can I do this in gtkglextmm, and how? As I said, Gdk::GL::Config::get_layer_plane() appears to return the number of a layer, but I do not know what to do with it. Do I somehow create a new context for each layer?

Regards,

Haraldur


On 10/02/10 01:46, Shawn Bakhtiar wrote:


hhmmmm...

Have you tried to compile the data points for the model (if they do not change vectors)

somthing like this (from the log example):

  /* Forward "G". */
  glNewList (LOGO_G_FORWARD, GL_COMPILE);
    glDisable (GL_CULL_FACE);
    glMaterialfv (GL_FRONT, GL_AMBIENT_AND_DIFFUSE, mat_blue);
    logo_draw_g_plane (); /* My user function that calls the actual gl* to draw */
    glEnable (GL_CULL_FACE);

    glMaterialfv (GL_FRONT, GL_AMBIENT_AND_DIFFUSE, mat_black);
    logo_draw_i (); /* My user function that calls the actual gl* to draw */
  glEndList ();


Hope this helps,
Shawn




i'mEMAILING FOR THE GREATER GOOD
Join me


> Date: Tue, 9 Feb 2010 17:15:24 +0000
> From: harg pml ac uk
> To: gtkglext-list gnome org
> Subject: [GtkGLExt] Is it possible to use overlays with gtkglextmm?
>
> Greetings,
>
> I have been writing, as my first significant project using OpenGL, a GUI
> using gtkglextmm for viewing large datasets as a cloud of points. I have
> some measuring tools that are currently rendered by drawing some of the
> points and then the line or box of the tool while the user is dragging
> the cursor. This works well with small datasets but gets sluggish with
> the larger ones, particularly the ones that require caching. I would
> like to use overlays as a conceptually and practically simple (I hope)
> way of drawing the rulers (and so on) without having to redraw the
> points each time.
>
> How do I do this while using gtkglextmm? I found the method
> Gdk::GL::Config::get_layer_plane() but no other obvious things in the
> documentation. Looking at an example using WGL, it appears I need to
> create an "layer context" for the overlay, but I do not see how to do
> that in gtkglextmm. Does it work in a similar way and, if so, how?
>
> Thanks in advance,
>
> Haraldur
>
> --------------------------------------------------------------------------------
> Plymouth Marine Laboratory
>
> Registered Office:
> Prospect Place
> The Hoe
> Plymouth PL1 3DH
>
> Website: www.pml.ac.uk
> Registered Charity No. 1091222
> PML is a company limited by guarantee
> registered in England & Wales
> company number 4178503
>
> PML is a member of the Plymouth Marine Sciences Partnership
> Website: www.pmsp.org.uk
> --------------------------------------------------------------------------------
> This e-mail, its content and any file attachments are confidential.
>
> If you have received this e-mail in error please do not copy, disclose it to any third party or use the contents or attachments in any way. Please notify the sender by replying to this e-mail or e-mail forinfo pml ac uk and then delete the email without making any copies or using it in any other way.
>
> The content of this message may contain personal views which are not the views of Plymouth Marine Laboratory unless specifically stated.
>
> You are reminded that e-mail communications are not secure and may contain viruses. Plymouth Marine Laboratory accepts no liability for any loss or damage which may be caused by viruses.
> --------------------------------------------------------------------------------
> _______________________________________________
> gtkglext-list mailing list
> gtkglext-list gnome org
> http://mail.gnome.org/mailman/listinfo/gtkglext-list


Plymouth Marine Laboratory
Registered Office:
Prospect Place
The Hoe
Plymouth PL1 3DH

Website: www.pml.ac.uk
Registered Charity No. 1091222
PML is a company limited by guarantee
registered in England & Wales
company number 4178503

PML is a member of the Plymouth Marine Sciences Partnership
Website: www.pmsp.org.uk

Please think before you print.

This e-mail, its content and any file attachments are confidential.
If you have received this e-mail in error please do not copy, disclose it to any third party or use the contents or attachments in any way. Please notify the sender by replying to this e-mail or e-mail forinfo pml ac uk and then delete the email without making any copies or using it in any other way.
The content of this message may contain personal views which are not the views of Plymouth Marine Laboratory unless specifically stated.
You are reminded that e-mail communications are not secure and may contain viruses. Plymouth Marine Laboratory accepts no liability for any loss or damage which may be caused by viruses.





Plymouth Marine Laboratory
Registered Office:
Prospect Place
The Hoe
Plymouth PL1 3DH

Website: www.pml.ac.uk
Registered Charity No. 1091222
PML is a company limited by guarantee
registered in England & Wales
company number 4178503

PML is a member of the Plymouth Marine Sciences Partnership
Website: www.pmsp.org.uk

Please think before you print.


This e-mail, its content and any file attachments are confidential.

If you have received this e-mail in error please do not copy, disclose it to any third party or use the contents or attachments in any way. Please notify the sender by replying to this e-mail or e-mail forinfo pml ac uk and then delete the email without making any copies or using it in any other way.

The content of this message may contain personal views which are not the views of Plymouth Marine Laboratory unless specifically stated.

You are reminded that e-mail communications are not secure and may contain viruses. Plymouth Marine Laboratory accepts no liability for any loss or damage which may be caused by viruses.






[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]