Originally Posted by bdbcat
I worked on this a bit last winter. Inconclusive results. The major issues (at least for raster charts) involve texture mapping, as I'm sure you know. You need a lot of texture memory on the graphics card to make this work right.
When I found that with my feeble video hardware, the performance was worse, I dropped the effort.
I encourage you to carry on with this effort. I believe it would be a good step forward in functionality and performance with the right hardware.
I got it rendering through opengl today! Like you say, it uses textures in video memory (although opengl can store textures in ram too) I bypassed quilting support, so that isn't working yet (having multiple charts
, or huge charts
in video memory could prove difficult), as well as all the other stuff (routes tides etc...) but that part shouldn't be too hard to convert. So far I have to do quite a bit more to actually get the smooth scrolling, rotation support, and smooth zooming I am looking for.
I noticed opencpn
does a lot of image manipulation in software
which is generally much slower than if hardware accelerated. Right now I am basically leaving it mostly the way it is, then having it copy the current
chart into a texture which is rather slow, but happens only once when you switch textures, then when manipulating that chart, everything is in video memory and hardware accelerated. It really isn't that much slower even if I copy it every frame which I don't need to, so it isn't that bad. It could likely be speed up significantly with various other rearrangements to bypass the use of wxdc's althogether, but it's too much code for me to swallow at once.
As for vector charts, it would be great to have native support in GL, but initially I might "rasterize" them in software
to a texture since it is easier, but of course, slower and more memory intensive.
I kept the normal rendering code intact so it will let you choose opengl or not in the config window. That way if there are bugs anywhere (maybe even in the driver) it is easy for users to toggle it on or off, and if you compile on a system without all the needed opengl libraries, it will still work.
Hopefully in a few days or a week I will have a patch. Then we can get all the ends tied up and try to build it on other operating systems. It is sure to break on windows, and I imagine this will require a bunch of ifdefs to make things right.