Cruisers Forum
 


Join CruisersForum Today

Reply
 
Thread Tools Rate Thread Display Modes
Old 04-04-2014, 13:00   #181
bcn
Registered User

Join Date: May 2011
Location: underway whenever possible
Boat: Rangeboat 39
Posts: 2,769
Re: Optimized Opencpn: Testers Needed

Chuck,

whats the size once processed?
What about to set up a repository for the cached data set?
(updates would be an open issue of course)

Hubert
__________________

__________________
bcn is offline   Reply With Quote
Old 04-04-2014, 13:30   #182
Registered User

Join Date: Apr 2009
Location: Marina Del Rey
Boat: Hylas 44
Posts: 387
Re: Optimized Opencpn: Testers Needed

Quote:
Originally Posted by bcn View Post
Chuck,

whats the size once processed?
What about to set up a repository for the cached data set?
(updates would be an open issue of course)

Hubert

5.5 GB
__________________

__________________
ChuckSK is offline   Reply With Quote
Old 04-04-2014, 14:34   #183
bcn
Registered User

Join Date: May 2011
Location: underway whenever possible
Boat: Rangeboat 39
Posts: 2,769
Re: Optimized Opencpn: Testers Needed

But starting with how many GB?
__________________
bcn is offline   Reply With Quote
Old 04-04-2014, 14:45   #184
Registered User

Join Date: Apr 2009
Location: Marina Del Rey
Boat: Hylas 44
Posts: 387
Re: Optimized Opencpn: Testers Needed

3.75 GB
__________________
ChuckSK is offline   Reply With Quote
Old 04-04-2014, 14:51   #185
bcn
Registered User

Join Date: May 2011
Location: underway whenever possible
Boat: Rangeboat 39
Posts: 2,769
Re: Optimized Opencpn: Testers Needed

Ok, "disk" space is cheap today.....

Sean, your comment?
__________________
bcn is offline   Reply With Quote
Old 04-04-2014, 15:48   #186
Registered User
 
boat_alexandra's Avatar

Join Date: Aug 2009
Location: chesapeake bay
Boat: bristol 27
Posts: 2,822
Re: Optimized Opencpn: Testers Needed

Quote:
Originally Posted by ChuckSK View Post
Sean

Optimized OpenCPN is now running here with Vista on an old Dell 1525. There were a few tweaks required. Built with MSVC++ 2010.
Code:
diff --git a/src/glChartCanvas.cpp b/src/glChartCanvas.cpp
index 3807da4..2220cb1 100644
--- a/src/glChartCanvas.cpp
+++ b/src/glChartCanvas.cpp
@@ -213,9 +213,11 @@ extern wxString         g_PrivateDataDir;
 
 wxString CompressedCachePath(wxString path)
 {
+     path = path.AfterLast(':');
+
Is this because on windows you have C:\ in the path?
Code:
     /* replace path separators with ! */
     wxChar separator = wxFileName::GetPathSeparator();

 
@@ -352,7 +354,7 @@ void UploadTexture( glTextureDescriptor *ptd, int base_level,
             int offset_table_offset = ((i * nx_tex) + j) * (g_mipmap_max_level + 1) + base_level;
             fs.SeekI(offset_table + offset_table_offset * 4, wxFromStart);
 
-            uint32_t offsets[g_mipmap_max_level + 1];
+            uint32_t offsets[g_mipmap_max_level + 2];
             fs.Read(offsets + base_level, 4 * (ptd->level_min + 1 - base_level) );
             fs.SeekI(offsets[base_level], wxFromStart);
             readcomp_tt_total += sw.Time();
oops. it never caused problems for me, but you are right.
Code:
@@ -708,34 +710,22 @@ static GLboolean QueryExtension( const char *extName )
 static bool GetglEntryPoints( void )
 {
 #if defined(__WXMSW__)
-    s_glGenFramebuffersEXT = (PFNGLGENFRAMEBUFFERSEXTPROC) GetProcAddress( s_hGL_DLL,
-                             "glGenFramebuffersEXT" );
...
+    s_glGetCompressedTexImageARB = (PFNGLGETCOMPRESSEDTEXIMAGEPROC) wglGetProcAddress( "glGetCompressedTexImageARB" );
I don't understand why it wasn't this way in the first place, but it obviously worked before.. why do you have to change it?


I think it starts around 4 gig to begin with? So the cache is a bit bigger, but not terrible. My chromebook generated the cache in about 4 hours. It can only use 1 core so it is possible to improve the speed. I don't think it makes much sense for people to download the cache unless you have a very fast connection and slow computer. It takes time to build, but you can just leave it overnight, and it greatly speeds up the program when you are interacting with it which is what counts.

Anyway... most of the raster charts are 16 colors or less, so really palette compression makes more sense than dxt1 (which is lossy). This requires less processing and the cache on disk would be smaller. This also supports color schemes (you will notice the cache is created in whatever scheme is active day or night so in this form it breaks that) Palette compression is only supported on most opengles systems (see the embedded arm thread) but can be fairly easily implemented with a shader program on any system.
__________________
boat_alexandra is offline   Reply With Quote
Old 04-04-2014, 16:24   #187
Registered User

Join Date: Apr 2009
Location: Marina Del Rey
Boat: Hylas 44
Posts: 387
Re: Optimized Opencpn: Testers Needed

Hi Sean

You are right, the returned path included "C:".

The original calls did not return any entry point addresses, on my system in any case.

Chuck
__________________
ChuckSK is offline   Reply With Quote
Old 05-04-2014, 02:57   #188
Registered User

Join Date: Nov 2012
Location: Orust Sweden
Boat: Najad 34
Posts: 1,968
Re: Optimized Opencpn: Testers Needed

Quote:
Originally Posted by bcn View Post
I think Sean meant "installing raster charts and processing them into the cached version".
Ok---Thanks.

Yes I did installed raster charts see: Optimized Opencpn: Testers Needed.
And there's a new directory below the program files called "raster_texture_cache" containing five files 1 kB each named like this:
Code:
!.!..!Charts!Test!932 Spec Gullholmen.kap.compressed_chart
If I missed something please advise how to do it.
Håkan
__________________
Hakan is offline   Reply With Quote
Old 05-04-2014, 03:23   #189
Registered User
 
AISEAG's Avatar

Join Date: May 2012
Location: Dahouet (Brittany)
Boat: BENETEAU
Posts: 407
Re: Optimized Opencpn: Testers Needed

Hello everyone,

I got 3.3.13034 version running on a XP machine.

What is the latest version of this pluging ?

Any way to get a compiled version of it ?

Serge
__________________
AISEAG is offline   Reply With Quote
Old 08-04-2014, 20:43   #190
Registered User
 
boat_alexandra's Avatar

Join Date: Aug 2009
Location: chesapeake bay
Boat: bristol 27
Posts: 2,822
Re: Optimized Opencpn: Testers Needed

I am beginning to realize more and more possible optimizations. This work becomes endless. I think I can make more significant improvements, but it is a lot of work. Instead I want to focus more on merging with mainline. I really would like more feedback to catch potential problems first though.

Last night I found the reason vector charts were so slow in opengl mode.

Frame rate went up by a factor of 10, now I have 40 to 70 frames a second all the time. Please Test!
__________________
boat_alexandra is offline   Reply With Quote
Old 08-04-2014, 23:19   #191
Registered User

Join Date: Jun 2011
Location: 27south
Boat: Easton 47
Posts: 65
Re: Optimized Opencpn: Testers Needed

Hi Sean,
Had a go at compiling on mac OS X.7.5.
pulled the latest from git this morning and used cmake.
got the following compile errors at 20%.
great work, many thanks.....

code:

Scanning dependencies of target S57ENC
[ 20%] Building CXX object CMakeFiles/S57ENC.dir/src/TexFont.cpp.o
/Users/mo/seandepagnier/OpenCPN/src/TexFont.cpp:72:14: error: use of undeclared identifier 'tex_width'
wxASSERT(tex_width < 2048 && tex_height < 2048);
^
/opt/local/include/wx-2.9/wx/debug.h:273:41: note: expanded from macro 'wxASSERT'
#define wxASSERT(cond) wxASSERT_MSG(cond, (const char*)NULL)
^
/opt/local/include/wx-2.9/wx/debug.h:266:38: note: expanded from macro 'wxASSERT_MSG'
if ( !wxTheAssertHandler || (cond) ) \
^
/Users/mo/seandepagnier/OpenCPN/src/TexFont.cpp:72:34: error: use of undeclared identifier 'tex_height'
wxASSERT(tex_width < 2048 && tex_height < 2048);
^
/opt/local/include/wx-2.9/wx/debug.h:273:41: note: expanded from macro 'wxASSERT'
#define wxASSERT(cond) wxASSERT_MSG(cond, (const char*)NULL)
^
/opt/local/include/wx-2.9/wx/debug.h:266:38: note: expanded from macro 'wxASSERT_MSG'
if ( !wxTheAssertHandler || (cond) ) \
^
/Users/mo/seandepagnier/OpenCPN/src/TexFont.cpp:151:21: warning: array subscript is of type 'char'
[-Wchar-subscripts]
h += tgi['A'].height;
^~~~
/Users/mo/seandepagnier/OpenCPN/src/TexFont.cpp:207:32: warning: array subscript is of type 'char'
[-Wchar-subscripts]
glTranslatef(0, tgi['A'].height, 0);
^~~~
/Users/mo/seandepagnier/OpenCPN/src/TexFont.cpp:219:5: error: call to member function 'RenderString' is
ambiguous
RenderString(string.ToUTF8(), x, y);
^~~~~~~~~~~~
/Users/mo/seandepagnier/OpenCPN/src/TexFont.cpp:196:15: note: candidate function
void TexFont::RenderString( const char *string, int x, int y )
^
/Users/mo/seandepagnier/OpenCPN/src/TexFont.cpp:217:15: note: candidate function
void TexFont::RenderString( const wxString &string, int x, int y )
^
2 warnings and 3 errors generated.
make[2]: *** [CMakeFiles/S57ENC.dir/src/TexFont.cpp.o] Error 1
make[1]: *** [CMakeFiles/S57ENC.dir/all] Error 2
make: *** [all] Error 2
x:build mo$

Mo
__________________
Icnoships is offline   Reply With Quote
Old 09-04-2014, 10:51   #192
Registered User

Join Date: Apr 2009
Location: Marina Del Rey
Boat: Hylas 44
Posts: 387
Re: Optimized Opencpn: Testers Needed

Hi Sean

Here are a few more tweaks. The first is an execution error. The others are compile errors.

Code:
diff --git a/src/chcanv.cpp b/src/chcanv.cpp
index 7e87692..b13466a 100644
--- a/src/chcanv.cpp
+++ b/src/chcanv.cpp
@@ -3246,7 +3246,7 @@ bool ChartCanvas::SetViewPoint( double lat, double lon, double scale_ppm, double
         GetCanvasPointPix( VPoint.clat, lon_norm, &r );
 
         m_true_scale_ppm = sqrt( square((double) ( r.y - r1.y )) +
-                                 square((double) ( r.x - r1.x )) / ( delta_y * 1852. ) );
+                                 square((double) ( r.x - r1.x ))) / ( delta_y * 1852. );
 
         //        A fall back in case of very high zoom-out, giving delta_y == 0
         //        which can probably only happen with vector charts
@@ -3443,7 +3443,7 @@ void ChartCanvas::ShipIndicatorsDraw( ocpnDC& dc, float lpp,
         ll_gc_ll( gLat, gLon, 0, factor, &tlat, &tlon );
         GetCanvasPointPix( tlat, tlon, &r );
 
-        double lpp = sqrt( square(lShipMidPoint.x - r.x) + square(lShipMidPoint.y - r.y ) );
+        double lpp = sqrt((double) (square(lShipMidPoint.x - r.x) + square(lShipMidPoint.y - r.y) ) );
         int pix_radius = (int) lpp;
 
         wxPen ppPen1( GetGlobalColor( _T ( "URED" ) ), 2 );
@@ -10093,7 +10093,7 @@ double ChartCanvas::GetAnchorWatchRadiusPixels( RoutePoint *pAnchorWatchPoint )
         ll_gc_ll( pAnchorWatchPoint->m_lat, pAnchorWatchPoint->m_lon, 0, dabs, &tlat1, &tlon1 );
         GetCanvasPointPix( tlat1, tlon1, &r1 );
         GetCanvasPointPix( pAnchorWatchPoint->m_lat, pAnchorWatchPoint->m_lon, &lAnchorPoint );
-        lpp = sqrt( square(lAnchorPoint.x - r1.x) + square(lAnchorPoint.y - r1.y) );
+        lpp = sqrt((double) (square(lAnchorPoint.x - r1.x) + square(lAnchorPoint.y - r1.y) ) );
 
         //    This is an entry watch
         if( d1 < 0 ) lpp = -lpp;
diff --git a/src/glChartCanvas.cpp b/src/glChartCanvas.cpp
index 67ad93e..8e590db 100644
--- a/src/glChartCanvas.cpp
+++ b/src/glChartCanvas.cpp
@@ -147,7 +147,7 @@ GLuint g_raster_format = GL_RGB;
 static       long g_tex_mem_used;
 
 static int g_tile_size;
-int g_mipmap_max_level = 4;
+const int g_mipmap_max_level = 4;
 
 bool glChartCanvas::s_b_useStencil;
 //static int s_nquickbind;

diff --git a/src/ocpndc.cpp b/src/ocpndc.cpp
index ff10f9a..be3341e 100644
--- a/src/ocpndc.cpp
+++ b/src/ocpndc.cpp
@@ -54,7 +54,7 @@
 
 #include "ocpndc.h"
 
-extern float g_GLMinLineWidth;
+extern double g_GLMinLineWidth;
 wxArrayPtrVoid gTesselatorVertices;
Chuck
__________________
ChuckSK is offline   Reply With Quote
Old 09-04-2014, 11:44   #193
Registered User

Join Date: Jun 2011
Location: 27south
Boat: Easton 47
Posts: 65
Re: Optimized Opencpn: Testers Needed

Hi Sean,
yup that did the trick, but got this at 55% -

code:

[ 55%] Building CXX object CMakeFiles/OpenCPN.dir/src/options.cpp.o
/Users/mo/seandepagnier/OpenCPN/src/options.cpp:4672:21: error: no matching constructor for initialization of
'wxFlexGridSizer'
m_bSizer1 = new wxFlexGridSizer( 2, -1 );
^ ~~~~~
/opt/local/include/wx-2.9/wx/sizer.h:843:5: note: candidate constructor not viable: no known conversion from
'int' to 'const wxSize' for 2nd argument
wxFlexGridSizer( int cols, const wxSize& gap = wxSize(0, 0) );
^
/opt/local/include/wx-2.9/wx/sizer.h:842:5: note: candidate constructor not viable: requires 3 arguments, but 2
were provided
wxFlexGridSizer( int cols, int vgap, int hgap );
^
/opt/local/include/wx-2.9/wx/sizer.h:846:5: note: candidate constructor not viable: requires 4 arguments, but 2
were provided
wxFlexGridSizer( int rows, int cols, int vgap, int hgap );
^
/opt/local/include/wx-2.9/wx/sizer.h:847:5: note: candidate constructor not viable: requires 3 arguments, but 2
were provided
wxFlexGridSizer( int rows, int cols, const wxSize& gap );
^
/opt/local/include/wx-2.9/wx/sizer.h:909:29: note: candidate constructor not viable: requires 1 argument, but 2
were provided
wxDECLARE_NO_COPY_CLASS(wxFlexGridSizer);
^
/opt/local/include/wx-2.9/wx/defs.h:3296:9: note: expanded from macro 'wxDECLARE_NO_COPY_CLASS'
classname(const classname&); \
^
1 error generated.
make[2]: *** [CMakeFiles/OpenCPN.dir/src/options.cpp.o] Error 1
make[1]: *** [CMakeFiles/OpenCPN.dir/all] Error 2
make: *** [all] Error 2
x:build mo$

Thanks Mo
__________________
Icnoships is offline   Reply With Quote
Old 09-04-2014, 12:00   #194
Registered User

Join Date: Dec 2005
Location: WNA
Boat: Dufour 35
Posts: 3,250
Re: Optimized Opencpn: Testers Needed

Downloaded and compiled Git 1 hour ago.
Some preliminary observations.
*No AIS Rollover
*No AIS Target query dialog
*The scale limit for showing AIS target names is not honored. It's on all the time.
*Same thing for current number display.
* The Gps status /North indicator dialog defaults to the lower right corner, hidden behind the chart and status bar. The normal position is top right.
*Dragging the toolbar, for example, leaves gray areas, noticeable for a short moment, before a screen-update kicks in.

Thomas
__________________
cagney is offline   Reply With Quote
Old 09-04-2014, 12:06   #195
Registered User

Join Date: Apr 2009
Location: Marina Del Rey
Boat: Hylas 44
Posts: 387
Re: Optimized Opencpn: Testers Needed

Hi Thomas

The first fix I posted above fixes most of those issues.

Chuck
__________________

__________________
ChuckSK is offline   Reply With Quote
Reply

Tags
opencpn, enc

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




Copyright 2002- Social Knowledge, LLC All Rights Reserved.

All times are GMT -7. The time now is 18:37.


Google+
Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Social Knowledge Networks
Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2017, vBulletin Solutions, Inc.

ShowCase vBulletin Plugins by Drive Thru Online, Inc.