Using OGL rendering instead of AGG

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Using OGL rendering instead of AGG

ramchandra
Hi All,
     I am trying to color classify a DEM by adding multiple styles to the layer entry in the map file using the PIXEL value as the EXPRESSION. I am trying to speedup the rendering of the styled layer. I tried using the Hardware accelerated rendering through OpenGL. I have added the cmake flags so that OpenGL binaries are loaded when building Mapserver.
I also made changes in the source code to enable the OGL Rendering by setting the MACRO #USE_OGL to 1. I have also changed my OUTPUTFORMAT as follows to trigger opengl rendering.
OUTPUTFORMAT
    NAME "OGL_PNG24"
    DRIVER "OGL/PNG"
    IMAGEMODE RGB
  END # OUTPUTFORMAT
In-spite of doing all these when i am sending the request it appends a new OUTPUTFORMAT object with AGG Driver as follows.
OUTPUTFORMAT
    NAME "png"
    MIMETYPE "image/png"
    DRIVER "AGG/PNG"
    EXTENSION "png"
    IMAGEMODE RGB
    TRANSPARENT FALSE
  END # OUTPUTFORMAT

It also changes my OGL OUTPUTFORMAT by adding the additional fields MIMETYPE and EXTENSION.
  OUTPUTFORMAT
    NAME "OGL_PNG24"
    MIMETYPE "image/png; mode=24bit"
    DRIVER "OGL/PNG"
    EXTENSION "png"
    IMAGEMODE RGB
    TRANSPARENT FALSE
  END # OUTPUTFORMAT

When I debug the code I see an error when the OGL output format block is parsed.
The error says "OGL_PNG24 driver is not configured".
Can anyone point out what might me causing this error or how to enable OpenGL based rendering.

Regards,
Ram
Reply | Threaded
Open this post in threaded view
|

Re: Using OGL rendering instead of AGG

Lime, Steve D (MNIT)
The OpenGL render is quite old and hasn't been maintained properly - especially in light of the major graphics refactoring done with 6.x. We should probably deprecate it at this point.

Anyway, I don't think you'll have much luck with OpenGL without a good bit of work. I'm not sure that would speed thing up in your case. The pixel-by-pixel expression processing is probably what's killing you. It would make more sense to work on other types of optimizations. Perhaps pre-processing  or re-organizing the DEM data or using lookup tables instead of expressions.

Lots of good information here: http://mapserver.org/input/raster.html.

Steve

-----Original Message-----
From: mapserver-users [mailto:[hidden email]] On Behalf Of ramchandra
Sent: Tuesday, July 25, 2017 6:14 AM
To: [hidden email]
Subject: [mapserver-users] Using OGL rendering instead of AGG

Hi All,
     I am trying to color classify a DEM by adding multiple styles to the
layer entry in the map file using the PIXEL value as the EXPRESSION. I am
trying to speedup the rendering of the styled layer. I tried using the
Hardware accelerated rendering through OpenGL. I have added the cmake flags
so that OpenGL binaries are loaded when building Mapserver.
I also made changes in the source code to enable the OGL Rendering by
setting the MACRO #USE_OGL to 1. I have also changed my OUTPUTFORMAT as
follows to trigger opengl rendering.
OUTPUTFORMAT
    NAME "OGL_PNG24"
    DRIVER "OGL/PNG"
    IMAGEMODE RGB
  END # OUTPUTFORMAT
In-spite of doing all these when i am sending the request it appends a new
OUTPUTFORMAT object with AGG Driver as follows.
OUTPUTFORMAT
    NAME "png"
    MIMETYPE "image/png"
    DRIVER "AGG/PNG"
    EXTENSION "png"
    IMAGEMODE RGB
    TRANSPARENT FALSE
  END # OUTPUTFORMAT

It also changes my OGL OUTPUTFORMAT by adding the additional fields MIMETYPE
and EXTENSION.
  OUTPUTFORMAT
    NAME "OGL_PNG24"
    MIMETYPE "image/png; mode=24bit"
    DRIVER "OGL/PNG"
    EXTENSION "png"
    IMAGEMODE RGB
    TRANSPARENT FALSE
  END # OUTPUTFORMAT

When I debug the code I see an error when the OGL output format block is
parsed.
The error says "OGL_PNG24 driver is not configured".
Can anyone point out what might me causing this error or how to enable
OpenGL based rendering.

Regards,
Ram



--
View this message in context: http://osgeo-org.1560.x6.nabble.com/Using-OGL-rendering-instead-of-AGG-tp5329120.html
Sent from the Mapserver - User mailing list archive at Nabble.com.
_______________________________________________
mapserver-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/mapserver-users
_______________________________________________
mapserver-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/mapserver-users
Reply | Threaded
Open this post in threaded view
|

Re: Using OGL rendering instead of AGG

ruhri
In reply to this post by ramchandra
Hi Ram,

the DEM-service we provide, uses the classic mechanism  with pixel value and expression. The response-times with nearly fullscreen WMS (Format PNG8 or JPEG) are < 1s; there are also some image manipulations done which cost some additional time (BILINEAR-Resampling, COMPOSITE-Features for combination with hillshade, etc.). So in summary mapserver performs generally very well with such raster-data...

MAPFILE-Snippet (Classification from 0 - 500m) :

CLASSITEM "pixel"

CLASS
        EXPRESSION ([pixel] >= 0 AND [pixel] < 100)
        STYLE
                COLORRANGE 108 163 99   165 186 111
                DATARANGE 0 100
                RANGEITEM "pixel"
        END
END

CLASS
        EXPRESSION ([pixel] >= 100 AND [pixel] < 200)
        STYLE
                COLORRANGE 165 186 111   231 213 122
                DATARANGE 100 200
                RANGEITEM "pixel"
        END
END

CLASS
        EXPRESSION ([pixel] >= 200 AND [pixel] < 300)
        STYLE
                COLORRANGE 231 213 122   199 167 92
                DATARANGE 200 300
                RANGEITEM "pixel"
        END
END

CLASS
        EXPRESSION ([pixel] >= 300 AND [pixel] < 400)
        STYLE
                COLORRANGE 199 167 92   176 120 58
                DATARANGE 300 400
                RANGEITEM "pixel"
        END
END

CLASS
        EXPRESSION ([pixel] >= 400 AND [pixel] < 500)
        STYLE
                COLORRANGE 176 120 58   215 127 63
                DATARANGE 400 500
                RANGEITEM "pixel"
        END
END


Maybe your data could be optimized, if you are not satisfied with response-times?
If I remember right, I used 32-bit grayscale GeoTIFF  for DEM and Hillshade (both with DEFLATE-Compression and internal TILING) and I also calculated Overviews with gdaladdo for faster presentation in smaller scales...


Ben



-----Urspr√ľngliche Nachricht-----
Von: mapserver-users [mailto:[hidden email]] Im Auftrag von ramchandra
Gesendet: Dienstag, 25. Juli 2017 13:14
An: [hidden email]
Betreff: [mapserver-users] Using OGL rendering instead of AGG

Hi All,
     I am trying to color classify a DEM by adding multiple styles to the layer entry in the map file using the PIXEL value as the EXPRESSION. I am trying to speedup the rendering of the styled layer. I tried using the Hardware accelerated rendering through OpenGL. I have added the cmake flags so that OpenGL binaries are loaded when building Mapserver.
I also made changes in the source code to enable the OGL Rendering by setting the MACRO #USE_OGL to 1. I have also changed my OUTPUTFORMAT as follows to trigger opengl rendering.
OUTPUTFORMAT
    NAME "OGL_PNG24"
    DRIVER "OGL/PNG"
    IMAGEMODE RGB
  END # OUTPUTFORMAT
In-spite of doing all these when i am sending the request it appends a new OUTPUTFORMAT object with AGG Driver as follows.
OUTPUTFORMAT
    NAME "png"
    MIMETYPE "image/png"
    DRIVER "AGG/PNG"
    EXTENSION "png"
    IMAGEMODE RGB
    TRANSPARENT FALSE
  END # OUTPUTFORMAT

It also changes my OGL OUTPUTFORMAT by adding the additional fields MIMETYPE and EXTENSION.
  OUTPUTFORMAT
    NAME "OGL_PNG24"
    MIMETYPE "image/png; mode=24bit"
    DRIVER "OGL/PNG"
    EXTENSION "png"
    IMAGEMODE RGB
    TRANSPARENT FALSE
  END # OUTPUTFORMAT

When I debug the code I see an error when the OGL output format block is parsed.
The error says "OGL_PNG24 driver is not configured".
Can anyone point out what might me causing this error or how to enable OpenGL based rendering.

Regards,
Ram



--
View this message in context: http://osgeo-org.1560.x6.nabble.com/Using-OGL-rendering-instead-of-AGG-tp5329120.html
Sent from the Mapserver - User mailing list archive at Nabble.com.
_______________________________________________
mapserver-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/mapserver-users
_______________________________________________
mapserver-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/mapserver-users