Perl OpenGL


Perl OpenGL

Infobox_Software
name = Perl OpenGL



caption = A screenshot illustrating FBO and Vertex/Fragment program extensions via POGL
developer = Stan Melax, Kenneth Albanowski, Ilya Zakharevich, Jean-Louis Morel, Bob Free
latest_release_version = 0.57
latest_release_date = September 27, 2008
operating_system = Cross-platform
genre = 3D computer graphics software (library/API)
license = Perl Artistic and GPL licenses
website = [http://graphcomp.com/opengl graphcomp.com/opengl]

Perl OpenGL (POGL) is a portable, compiled wrapper library that allows OpenGL to be used in the Perl programming language.

POGL provides support for most OpenGL 2.0 extensions, abstracts OS-specific proc handlers, and supports GLUT, a simple cross-platform windowing interface.

POGL provides additional Perl-friendly APIs for passing/returning strings and arrays.

Platform Support

* Microsoft Windows: NT/XP/Vista
* Mac OS X: version 10.5 (Leopard) only
* Linux: Fedora 6, Debian Etch, Ubuntu Dapper, Gentoo
* FreeBSD
* Solaris

Confirmed with:

* nVidia (Quadro-110M,6600,6800,7300,7800,7950,8800)
* ATI (Radeon 9000/9200, FireGL)
* Cygwin/X Window System (Mesa)

Interoperability

ImageMagick - Image Loading/Modification/Saving

The POGL team has collaborated with the ImageMagick team to add PerlMagick APIs that allow GPUs and ImageMagick to share cache buffers via C pointers - optimizing performance for FBOs and VBOs - for use with loading/saving textures and GPGPU data transfer.

These APIs have been added to ImageMagick 6.3.5:

* Get('Scene') - returns the number of scenes in an IM image.
* Get('Quantum') - returns IM's cache depth.
* GetImagePixels() - returns a C pointer to IM's image cache.
* SyncImagePixels() - sync's IM's image cache after a write (for large/paged images).

Benchmarks demonstrate GetImagePixels is 188x faster than ImageToBlob or GetPixels.

FFmpeg - Video Frame Textures

CPAN's FFmpeg module may be used in conjunction with POGL and the above

Performance

POGL provides OpenGL performance comparable to that of C, and consistently outperformsother Perl Bindings like SDL::OpenGL and other language bindings like Python.

* Benchmarks with source are available on the [http://graphcomp.com/opengl/benchmarks POGL Developer's Site]

Comparison With Other Language Bindings

Perl vs C

General Purpose GPU (GPGPU) processing is one area in which Perl compares with compiled languages in terms of performance.

[http://graphcomp.com/opengl/bench.html GPU benchmarks] show no significant performance differences between C and Perl (via POGL), when rendering a realtime 3D animated object with dynamically generated texturemaps.

GPGPU vertex shaders can execute complex c-like code on large arrays of data, rarely touching the CPU. The CPU is left doing event handling, system calls, disk I/O and UI - which contributes a minor portion of the overall processing time. The performance difference between C and Perl becomes statistically insignificant.

Since GPU performance depends on tight integration with an OS' windowing system (WGL/X11/etc), OpenGL APIs (particularly GPGPU extensions) are OS-dependent. POGL abstracts these dependencies, allowing portable code.

* Portable benchmark source (in C and Perl) are available on the [http://graphcomp.com/opengl/benchmarks POGL Developer's Site] .

Perl vs Java

Perl tends to rely on more binary modules than Java, providing additional performance benefitsFact|date=May 2008. POGL is a compiled module, and may be used in conjunction with compiled imaging modules (such as ImageMagick) for loading/saving data arrays (textures).

As of this writing, the Java OpenGL (JOGL) binding does not support Framebuffers Fact|date=May 2008.

Perl vs Python

As of this writing, Python OpenGL bindings do not support Framebuffers and other advanced GPGPU extensions.Fact|date=May 2008

* Benchmarks demonstrate that POGL performs over 20% faster than Python [http://graphcomp.com/pogl.cgi?v=0111s3B2] . This includes a blog posting by PyOpenGL's author explaining why Python's OpenGL implementation is likely to be slower than POGL. These benchmarks are based on Trislam, an independent OpenGL benchmark; these results were independently reproduced by Trislam's author.

OpenGL Objects

POGL provides specialized objects that dramatically enhance Perl performance.POGL objects store data as typed C arrays, and pass data between APIs using C pointers -eliminating the need to copy/convert/cast when passing data between interfaces.

The result is maximized performance, with the added flexibility/portability of Perl.

OpenGL::Array (OGA)

OGAs store OpenGL data as typed C arrays. OGAs may be populated by C pointer, Perl packed arrays (strings) or Perl arrays.

OGAs may be bound/mapped to VBOs to share data between the GPU and Perl.

Accessor methods provide a means to get/set array elements by C pointer, packed arrays or Perl arrays.

Documentation can be found on [http://graphcomp.com/opengl/index.cgi?v=0111s3p1 POGL's Developer Site]

OpenGL::Image (OGI)

OGIs use OGAs to wrap image buffers from various imaging libraries. OGI simplifies loading/modifying/saving OpenGL textures, FBOs and VBOs.

OGI provides an extensible plug-in architecture to support new imaging libraries: OGI supports ImageMagick (v6.3.5 or newer), and by default Targa (uncompressed RGBA files).

OGI provides direct C pointer access to ImageMagick's image cache, resulting in dramatic performance in transferring images/data between the GPU and IM.

Documentation can be found on [http://graphcomp.com/opengl/index.cgi?v=0111s3p6 POGL's Developer Site]

OGI is available on CPAN as a separate OpenGL-Image module [http://search.cpan.org/~bfree/OpenGL-Image-1.00/Image.pod] .

OpenGL::Shader (OGS)

The OSG module abstracts OpenGL APIs for ARB (assembly), Cg and GLSL shading languages.

$shdr = new OpenGL::Shader();my $ext = lc($shdr->GetType());my $stat = $shdr->LoadFiles("fragment.$ext","vertex.$ext");

$shdr->Enable();$Shader->SetVector('surfacecolor',1.0,0.5,0.0,1.0);$Shader->SetMatrix('xform',$xform);

# Draw here

$shdr->Disable();

Documentation can be found on [http://graphcomp.com/opengl/index.cgi?v=0111s3p7 POGL's Developer Site]

OGS is available on CPAN as a separate OpenGL-Shader module [http://search.cpan.org/~bfree/OpenGL-Shader-1.00/Shader.pm] .

Sample Renderings

Status and Standardization

The latest CPAN release of the following POGL modules are
* OpenGL v0.56
* OpenGL-Image v1.02
* OpenGL-Shader v1.00

Updates and binary distributions are available onGraphcomp's [http://graphcomp.com/opengl Perl OpenGL (POGL)] site.

POGL supports the following OpenGL extensions:

* GL_ARB_color_buffer_float
* GL_ARB_depth_texture
* GL_ARB_draw_buffers
* GL_ARB_fragment_program
* GL_ARB_fragment_program_shadow
* GL_ARB_fragment_shader
* GL_ARB_half_float_pixel
* GL_ARB_multisample
* GL_ARB_multitexture
* GL_ARB_pixel_buffer_object
* GL_ARB_point_parameters
* GL_ARB_point_sprite
* GL_ARB_shader_objects
* GL_ARB_shading_language_100
* GL_ARB_shadow
* GL_ARB_texture_border_clamp
* GL_ARB_texture_cube_map
* GL_ARB_texture_env_add
* GL_ARB_texture_env_combine
* GL_ARB_texture_env_dot3
* GL_ARB_texture_float
* GL_ARB_texture_mirrored_repeat
* GL_ARB_texture_non_power_of_two
* GL_ARB_texture_rectangle
* GL_ARB_vertex_buffer_object
* GL_ARB_vertex_program
* GL_ARB_vertex_shader
* GL_ATI_texture_float
* GL_ATI_texture_mirror_once
* GL_EXT_Cg_shader
* GL_EXT_abgr
* GL_EXT_bgra
* GL_EXT_blend_color
* GL_EXT_blend_subtract
* GL_EXT_framebuffer_object
* GL_EXT_packed_pixels
* GL_EXT_pixel_buffer_object
* GL_EXT_rescale_normal
* GL_EXT_separate_specular_color
* GL_EXT_shadow_funcs
* GL_EXT_stencil_wrap
* GL_EXT_texture3D
* GL_EXT_texture_cube_map
* GL_EXT_texture_env_combine
* GL_EXT_texture_env_dot3
* GL_EXT_texture_filter_anisotropic
* GL_EXT_texture_lod_bias
* GL_EXT_texture_mirror_clamp
* GL_EXT_vertex_array
* GL_HP_occlusion_test
* GL_IBM_rasterpos_clip
* GL_NV_blend_square
* GL_NV_copy_depth_to_color
* GL_NV_depth_clamp
* GL_NV_fog_distance
* GL_NV_fragment_program2
* GL_NV_fragment_program_option
* GL_NV_light_max_exponent
* GL_NV_packed_depth_stencil
* GL_NV_texgen_reflection
* GL_NV_texture_expand_normal
* GL_NV_texture_rectangle
* GL_NV_texture_shader
* GL_NV_texture_shader2
* GL_NV_texture_shader3
* GL_NV_vertex_program2_option
* GL_NV_vertex_program3
* GL_S3_s3tc
* GL_SGIS_generate_mipmap
* GL_SGIS_texture_lod
* GL_SGIX_depth_texture
* GL_SGIX_shadow
* GL_SUN_slice_accum

The primary author of this release is [http://graphcomp.com/bfree Bob Free] of [http://graphcomp.com Graphcomp] .

Bob Free was made primary owner of CPAN's Perl OpenGL module on April 13, 2007.

External links

* [http://search.cpan.org/dist/OpenGL/ CPAN OpenGL] (POGL)
* [http://search.cpan.org/dist/OpenGL-Image/ CPAN OpenGL-Image]
* [http://search.cpan.org/dist/OpenGL-Shader/ CPAN OpenGL-Shader]
* [http://graphcomp.com/opengl The Official POGL Website] - documentation, examples, benchmarks, latest updates
* [http://graphcomp.com/opengl/videos POGL Video Gallery]
* [http://graphcomp.com/opengl/test.txt POGL Sample Test App]
* [http://graphcomp.com/opengl/benchmarks/ OpenGL Benchmarks - C vs Perl, Perl vs Python]
* [http://graphcomp.com/opengl/arrays/ OpenGL::Array] (OGA) Documentation
* [http://graphcomp.com/opengl/imaging/ OpenGL::Image] (OGI) Documentation
* [http://graphcomp.com/opengl/shaders/ OpenGL::Shader] (OGS) Documentation
* [http://www.perl.com/pub/a/2007/04/12/lightning-four.html?page=2 O'Reilly Lightning article] : Perl Outperforms C with OpenGL
* [http://graphcomp.com/opengl/currents/ POGL Currents] : POGL Developer's Blog
* [http://graphcomp.com/opengl/signup POGL News] : Signup for Graphcomp's Monthly Newsletter
* [http://graphcomp.com/opengl/index.cgi?v=0111s1m8#SIGGRAPH2007 SIGGRAPH 2007] : POGL live reporting from San Diego


Wikimedia Foundation. 2010.

Look at other dictionaries:

  • OpenGL — Original author(s) Silicon Graphics Developer(s) Khronos Group Stable release 4.2 …   Wikipedia

  • OpenGL — Desarrollador Khronos Group www.opengl.org Información general Diseñador Silicon Graphics …   Wikipedia Español

  • OpenGL — Тип API Раз …   Википедия

  • Perl Data Language — (PDL) Класс языка: векторная (en:Array programming) Появился в: 1996 Автор(ы): Карл Глейзбрук, Шарль Бринчманн, Томас Лукка и Кристиан Соллер Релиз: 2.4.11 (20 мая 2012) …   Википедия

  • OpenGL User Interface Library — GLUI Screenshot  Demonstration of the GLUI program Developer(s) …   Wikipedia

  • Comparison of OpenGL and Direct3D — Direct3D and OpenGL are competing application programming interfaces (APIs) which can be used in applications to render 2D and 3D computer graphics, taking advantage of hardware acceleration when available. Modern graphics processing unit (GPUs)… …   Wikipedia

  • Сравнение языков программирования — Эту статью следует викифицировать. Пожалуйста, оформите её согласно правилам оформления статей.  Условные обозначения  …   Википедия

  • Liste de moteurs de jeu — La liste de moteurs de jeu répertorie des logiciels moteurs de jeu utilisés par les développeurs de jeux vidéo. Sommaire 1 Moteurs de jeu libres 2 Moteurs propriétaires gratuits 3 Moteurs commerciaux …   Wikipédia en Français

  • Abkürzungen/Computer — Dies ist eine Liste technischer Abkürzungen, die im IT Bereich verwendet werden. A [nach oben] AA Antialiasing AAA authentication, authorization and accounting, siehe Triple A System AAC Advanced Audio Coding AACS …   Deutsch Wikipedia

  • Liste der Abkürzungen (Computer) — Dies ist eine Liste technischer Abkürzungen, die im IT Bereich verwendet werden. A [nach oben] AA Antialiasing AAA authentication, authorization and accounting, siehe Triple A System AAC Advanced Audio Coding AACS …   Deutsch Wikipedia


We are using cookies for the best presentation of our site. Continuing to use this site, you agree with this.