Difference between revisions of "GLScene"

From Free Pascal wiki
Jump to navigationJump to search
Line 1: Line 1:
 
{{GLScene}}
 
{{GLScene}}
  
=== Sobre ===
+
=== About ===
GLScene é uma biblioteca 3D baseada em OpenGL. Foi escrita inicialmente para Delphi, agora está rodando em C++ Builder, Kylix, Delphi e Lazarus.  
+
GLScene is an OpenGL based 3D library for Delphi. It was written initially for Delphi, now it is running in C++ Builder, Kylix, Delphi and Lazarus.  
  
Suas características principais são:
+
Its main characteristics are:
  
Descrição do Cenário (Scene)
+
Scene description
*Estrutura de objetos hierárquica, com tantos objetos quanto a memória permitir, facilmente expansível.
+
*hierarchical objects structure, with as many objects as memory allows, easily extendable
*Interatividade com o gerenciamento da cena (vários peritos em Delphi).
+
*interactive scene management (numerous Delphi experts)  
*Fácil de usar as funções de rotação e movimentação para cada objeto.
+
*easy to use rotation and movement functions for each object
*Objetos pré-definidos (todos os padrões do cubo para a chaleira, depois para sprite), facilmente expansível.
+
*predefined objects (all standards from cube to teapot to sprite), easily extendable
*Objetos estruturados (cubo falso (dummy cube), objeto representante (proxy object)) para gerenciar objetos compostos.
+
*structural objects (dummy cube, proxy object) for manageing composite objects
*Objetos processuais (altitude raio de visão (heightfield), sólidos de revolução, tubos (pipes), tesselators...).
+
*procedural objects (heightfield, revolution solids, pipes, tesselators...)  
*Suporte completamente integrado a objetos 2D e 1D (suporte a sprites, linhas e spline).
+
*support for 2D and 1D objects (sprites, lines with spline support) fully integrated
*Objetos HUD (sprites renderizados em coordenadas 2D)
+
*HUD objects (sprites rendered in 2D coordinates)  
*Objetos Utilitários (Utility) (grades (grids), céu em formato de cúpula (skydome), setas (arrows)...).
+
*Utility objects (grids, skydome, arrows...)  
*Suporta classes para acessar o diretamente OpenGL
+
*support classes for directly accessing OpenGL  
*Objetos do tipo câmera e luz podem ser usados em qualquer lugar em uma hierarquia de objetos do cenário.
+
*camera and light objects that can be used anywhere in a scene objects hierarchy
*Objetos de comportamento podem ser anexados a objetos com o propósito de animação, facilmente expansível.
+
*behaviour objects can be attached to objects for animation purposes, easily extendable
*Efeitos especiais por objeto (aplicar a renderização antes/depois aos objetos e efeitos secundários ao cenário), facilmente expansível.
+
*per-object special effects (before/after object rendering and scene after-effects), easily extendable
*Suporte para sistemas de partículas, qualquer objeto ou objeto estruturado pode ser uma partícula.
+
*support for particle systems, any object or object structure can be a particle
*Importação de arquivos do 3D Studio e coordenadas das texturas com cálculo automático e preciso dos vetores normais (usando os determinados grupos suavizadores do arquivo).
+
*3D Studio file import with automatic and precise normal vector calculation (using the given smoothing groups of the file) *and texture coordinate import
*Outros formatos importados: OBJ/OBJF, SMD, MD2, STL, TIN, PLY
+
*Other imported formats : OBJ/OBJF, SMD, MD2, STL, TIN, PLY
  
Materiais
+
Materials
*Fácil de usar, otimizado, materiais para objetos.
+
*easy to use, optimized, material object
*Biblioteca de material para compartilhar e re-utilização de materiais.
+
*material library to share and reuse materials
*Suporte a ambientes, difusão, emissão, reflexo e brilho.
+
*ambient, diffuse, emission, specular and shininess support
*Suporte a modos combinatórios (transparência, aditivo...)
+
*support of blending modes (transparency, additive...)  
*Autogeração de canal alfa.
+
*alpha-channel auto-generation
*Suporte a formato de textura OpenGL, incluindo formatos comprimidos (DXT, S3TC etc.)  
+
*support for OpenGL texture formats, including compressed ones (DXT, S3TC etc.)  
*Suporte a plug-in shaders genérico 
+
*generic plug-in shaders support
*Suporte a classes de alto-nível de shaders Cg.
+
*High-level Cg shaders support classes
*Suporte a imagem polimorfica para texturização (permite muitos formatos como também texturas processuais), facilmente expansível.
+
*polymorphic image support for texturing (allows many formats as well as procedural textures), easily extendable
*Mais de 150 cores pré-definidas como clrCornflowerBlue ou clrCoolCopper (facilmente expansíveis) além de cores padrão e especificações diretas do padrão RGBA  
+
*more than 150 predefined colors like clrCornflowerBlue or clrCoolCopper (easily extendable) in addition to standard colors and direct RGBA specifications
*Fácil de usar as propriedades de movimentação de textura e de escalabilidade, independentemente das coordenadas de textura.
+
*easily to use texture movement and scaling properties, independently from texture coordinates
*Suportam classes de Bitmap de 32 bits
+
*32 bits Bitmap support class
  
Renderização
+
Rendering
*Usa automaticamente o driver do hardware OpenGL se disponível.
+
*automatically uses the hardware OpenGL driver if available
*Um bom funcionamento do modelo de câmera usando comprimento focal e a mira.
+
*a well working camera model using focal length and targeting
*Múltiplas visões para uma ou mais cenas, fácil mudança de visão por seleção de câmera.
+
*multiple viewers for one or more scenes, easy change of view through camera selection
*Suporte a névoa e a visão de profundidade.
+
*fog and depth-of-view support
*Renderiza para um arquivo, para um bitmap ou para a impressora em qualquer resolução de cor e pixel.
+
*render to a file, a bitmap or to the printer in any color and pixel resolution
*Suporta a tela cheia com mudanças dinâmicas de resolução.
+
*full screen support with dynamic resolution changes
*Reflexões e efeitos de espelho.
+
*reflections and mirror effects
*Fundição de sombras dinamicamente.
+
*dynamic shadow casting
*Suporte a sistema de alta-performance de partículas transparentes em cenários largos.
+
*high-performance scene-wide transparent particles system support
*Seleção automática (por hierarquia ou por objeto) de frustrum.
+
*automatic frustrum culling (hierarchical or per-object)  
  
Animação
+
Animation
*Propagação de eventos de progressão de tempo.
+
*propagation of time progression events
*Animação de esqueleto (múltiplos ossos (bones) por vértice).
+
*skeletal animation (multiple bones per vertex)  
*Interpolação de quadro (frame) e mudança de alvos (morph targets).
+
*frame interpolation and morph targets  
*Comportamentos facilmente expansíveis.
+
*easily extendable Behaviours
*Física dinâmica: inércia, aceleração, umidade e força de aplicação.
+
*dynamic physics : inertia, acceleration, damping and force application
*Iluminação automática e em tempo real da cena.
+
*automatic, realtime scene cadenceing
  
 
Interface
 
Interface
*Funções fácil-de-usar para determinar os objetos escolhidos.
+
*easy-to-use functions to determine picked objects
*Funções de ajuda para movimentação da câmera.
+
*helper functions for camera movements
*Funções de ajuda para a tradução do objeto escolhido.
+
*helper functions for picked object's translation
*Funções de ajuda para conversão entre telas e coordenadas globais, trajetória de raios (raycasting)
+
*helper functions for converting between screen and world coordinates, raycasting
  
Som
+
Sound
*Suporte embutido para fontes som 3D e para o ouvinte.
+
*built-in support for 3DSound sources and listener
*Atualização automática da posição, da velocidade e da orientação das fontes de som e do ouvinte.
+
*automatic update of position, velocity and orientation of sources and listener
*Amostras de som da biblioteca do componente.
+
*sound samples library component
*Gerenciadores de sons para WaveOut, BASS e FMOD.
+
*sound managers for WaveOut, BASS and FMOD.
  
Utilitários
+
Utilities
*Aperfeiçoamento de funções de geométricas e utilitários (vetor, quaternion e matriz...).
+
*optimized geometry functions and utilities (vector, quaternion and matrix...)  
*Suporte a funções e classes spline cúbica.
+
*cubic spline support functions and class
*Engrenaram a manipulação e a otimização (stripification, vertex-cache awareness, etc.).
+
*mesh manipulation and optimization (stripification, vertex-cache awareness, etc.)  
*Componente para fazer o salvar-tela (screen-saver) totalmente configurável em alguns cliques.
+
*component to make full-featured screen-saver in a few clicks
*Determinação precisa da velocidade do quadro (frame).
+
*precise frame speed determination
*Cronômetro assíncrono (multi-threaded).
+
*asynchronous timer (multi-threaded)  
*Suporte a joystick.
+
*joystick support
*Acesso assíncrono ao teclado, suporte ao mapa de caracteres.
+
*asynchronous keyboard access, keymap support
  
Bibliotecas de terceiros
+
Third party libraries
*Suporte para biblioteca de física de ODE.
+
*Build in support for ODE physics library
*Suporte para Delphi Web Script (DWS).
+
*Build in support for Delphi Web Script (DWS)  
*Suporte para Camadas Diretas de Mídia Simples (Simple Direct Media Layer - SDL).
+
*Build in support for Simple Direct Media Layer (SDL)  
*Suporte ao conjunto de ferramentas da biblioteca CG NVidea shader.
+
*Build in support for CG NVidea shader library toolkit
  
Observações:
+
Notes:
O Delphi 5 tem suporte basicamente a BMP, WMF, EMF, ICO e JPG , você pode acrescentar suporte para GIF, TIF, TGA, PSD e muitos mais incluindo a biblioteca GraphicEx de Mike Lischke
+
Delphi 5 basically supports BMP, WMF, EMF, ICO and JPG, you can add support for GIF, TIF, TGA, PSD and many more by including the GraphicEx library from Mike Lischke.
  
 
=== Screenshots ===
 
=== Screenshots ===

Revision as of 21:59, 4 April 2008

Deutsch (de) English (en) français (fr) Bahasa Indonesia (id) 日本語 (ja) 한국어 (ko) português (pt) русский (ru) 中文(中国大陆)‎ (zh_CN)

About

GLScene is an OpenGL based 3D library for Delphi. It was written initially for Delphi, now it is running in C++ Builder, Kylix, Delphi and Lazarus.

Its main characteristics are:

Scene description

  • hierarchical objects structure, with as many objects as memory allows, easily extendable
  • interactive scene management (numerous Delphi experts)
  • easy to use rotation and movement functions for each object
  • predefined objects (all standards from cube to teapot to sprite), easily extendable
  • structural objects (dummy cube, proxy object) for manageing composite objects
  • procedural objects (heightfield, revolution solids, pipes, tesselators...)
  • support for 2D and 1D objects (sprites, lines with spline support) fully integrated
  • HUD objects (sprites rendered in 2D coordinates)
  • Utility objects (grids, skydome, arrows...)
  • support classes for directly accessing OpenGL
  • camera and light objects that can be used anywhere in a scene objects hierarchy
  • behaviour objects can be attached to objects for animation purposes, easily extendable
  • per-object special effects (before/after object rendering and scene after-effects), easily extendable
  • support for particle systems, any object or object structure can be a particle
  • 3D Studio file import with automatic and precise normal vector calculation (using the given smoothing groups of the file) *and texture coordinate import
  • Other imported formats : OBJ/OBJF, SMD, MD2, STL, TIN, PLY

Materials

  • easy to use, optimized, material object
  • material library to share and reuse materials
  • ambient, diffuse, emission, specular and shininess support
  • support of blending modes (transparency, additive...)
  • alpha-channel auto-generation
  • support for OpenGL texture formats, including compressed ones (DXT, S3TC etc.)
  • generic plug-in shaders support
  • High-level Cg shaders support classes
  • polymorphic image support for texturing (allows many formats as well as procedural textures), easily extendable
  • more than 150 predefined colors like clrCornflowerBlue or clrCoolCopper (easily extendable) in addition to standard colors and direct RGBA specifications
  • easily to use texture movement and scaling properties, independently from texture coordinates
  • 32 bits Bitmap support class

Rendering

  • automatically uses the hardware OpenGL driver if available
  • a well working camera model using focal length and targeting
  • multiple viewers for one or more scenes, easy change of view through camera selection
  • fog and depth-of-view support
  • render to a file, a bitmap or to the printer in any color and pixel resolution
  • full screen support with dynamic resolution changes
  • reflections and mirror effects
  • dynamic shadow casting
  • high-performance scene-wide transparent particles system support
  • automatic frustrum culling (hierarchical or per-object)

Animation

  • propagation of time progression events
  • skeletal animation (multiple bones per vertex)
  • frame interpolation and morph targets
  • easily extendable Behaviours
  • dynamic physics : inertia, acceleration, damping and force application
  • automatic, realtime scene cadenceing

Interface

  • easy-to-use functions to determine picked objects
  • helper functions for camera movements
  • helper functions for picked object's translation
  • helper functions for converting between screen and world coordinates, raycasting

Sound

  • built-in support for 3DSound sources and listener
  • automatic update of position, velocity and orientation of sources and listener
  • sound samples library component
  • sound managers for WaveOut, BASS and FMOD.

Utilities

  • optimized geometry functions and utilities (vector, quaternion and matrix...)
  • cubic spline support functions and class
  • mesh manipulation and optimization (stripification, vertex-cache awareness, etc.)
  • component to make full-featured screen-saver in a few clicks
  • precise frame speed determination
  • asynchronous timer (multi-threaded)
  • joystick support
  • asynchronous keyboard access, keymap support

Third party libraries

  • Build in support for ODE physics library
  • Build in support for Delphi Web Script (DWS)
  • Build in support for Simple Direct Media Layer (SDL)
  • Build in support for CG NVidea shader library toolkit

Notes: Delphi 5 basically supports BMP, WMF, EMF, ICO and JPG, you can add support for GIF, TIF, TGA, PSD and many more by including the GraphicEx library from Mike Lischke.

Screenshots

Gl effect.jpg Gl cel.jpg Gl trinity.jpg
Gl ode.jpg

Author

Author: initially Mike Lischke
at time maintained by Eric Grange
LCL Port: Christian Ulrich

Download

Latest (v1.0.0.2)

This should be almost identical to the original cvs repository of today in terms of functionality and bugfixes, however, there are still some parts missing. There wont be a "Lazarus-with-GLScene-Installer" with this new release, unless someone else creates it. --Crossbuilder 20:16, 18 July 2007 (CEST)

Outdated

An older release (version 0.9.1.6) can be found on the Lazarus CCR Files page together with a lazarus installer with GLScene already in the Lazarus IDE and GLScene demoes. UPDATE: This is pretty old now. If possible, use the svn checkout (see below).

SVN

you can checkout the actual source from
http://svn.freepascal.org/svn/fpcprojects/glscene/trunk/

The command would be:

svn co http://svn.freepascal.org/svn/fpcprojects/glscene/trunk glscene

This will download the trunk (main) repository to "glscene" dir to whereever you invoked the command from.

In windows you can use clients like tortoise SVN and others.

Bug reporting

Bug Reporting/Featurerequest Please select Project "Packages" and Category "glscene" for your reports. Thanks.

Change Log

  • 18.07.2007 Snapshot release version 1.0.0.2
    • adjusted some things, so it works with latest lazarus svn version
    • added object bitmaps for the SceneEditor
    • fixed another AV in SceneEditor
    • incorporated all patches and bugfixes from original glscene cvs repo like dynamic textures ..
  • 13.06.2007 Snapshot release version 1.0.0.1
    • incorporated all patches and bugfixes from original glscene cvs repo
    • improved scene editor (crashes less, but still needs some love)
      Tip: Save your project frequently ;-)
    • seperated mmsystem dependent stuff from generic sound support so e.g. FMOD is available in linux, too
    • many more ..
  • 01.12.06 Added support for ODE, gtk2 and Cg shaders in Linux (ODE is limited to normal release, unsupported are cone, ccylinder and terrains)
  • 10.08.05 Too many changes to post here see cvs history
  • 16.07.05 GLScene 0.9.X Port
  • look at GLScene Sourceforge Account for complete Changelog

Status: Beta

Installation version 1.0.0.2

Requires fpc 2.1.4 or greater and lazarus 0.9.23 rev. 11348 or greater !!

  • extracting the sources
    • ZIP:
      • in "lazarus/components/" folder execute "unzip glscene-1.0.0.2.zip"
        This will create the lazarus/components/glscene/ folder
    • SVN:
      • in "lazarus/components/" folder execute
        svn co http://svn.freepascal.org/svn/fpcprojects/glscene/trunk glscene
        This will create the lazarus/componets/glscene/ folder
      • Tortoise SVN: add the folder "glscene" manually so you have lazarus/components/glscene. Then right-click onto new folder and choose "SVN Checkout...". At field "URL of repository" add
        http://svn.freepascal.org/svn/fpcprojects/glscene/trunk
        Confirm by "OK".


  • Finish the installation:
    • copy "lazarus/components/glscene/globallinks/*.lpl" to "lazarus/packager/globallinks/"
    • start lazarus
    • select "Configure installed packages ..." from the "Components" menu
    • select "glscenelazarus" from the "Available packages" list
    • click "Install selection" button
    • click "Save and rebuild IDE" button
      • ATTENTION: There may occur an error that package "jpegforlazarus" is not found. If so do the following:
      • Components --> Open loaded package...
      • Choose "glscenelazarus" (Version 1.0.0.3) and click "Open..."
      • In the following list go down to "Required Packages" and remove dependency from "jpegfromlazarus".
      • Look for unit "jpeg" in folder /lazarus/components/glscene/Source/base and replace "LazJPEG" (in uses clause) by "LazJPG" (from package ImagesForLazarus).
      • Save and repeat last 4 steps again.
      • HINT: You should have installed package "ImagesForLazarus" (the same way as described for "glscenelazarus" package).
    • repeat the last 4 steps for the other packages you want to use.
      • Note: glsceneode and glscenecgshader need their respective libs on the system during installation!
    • Note: you can also try to select and install all packages in one go. However, I prefer to do things step by step, so I see where it fails, if it fails ;)
    • Install "glscenelazarus" - mistakes: (only needed when using glscene-1.0.0.2.zip, in svn these are already fixed)
      • To correct the unit GLLCLViewer: procedure TGLSceneViewer.CreateParams(var Params: TCreateParams); - at procedure TGLSceneViewerLCL.CreateParams(var Params: TCreateParams);
      • To correct the unit GLLCLViewer: procedure TGLSceneViewer.EraseBackground(DC: HDC); - at procedure TGLSceneViewerLCL.EraseBackground(DC: HDC);
      • To correct the unit GLLCLFullscreenViewer: Change "RegisterClasses([TGLSceneViewer, TGLFullScreenViewer]);" to "RegisterClasses([TGLFullScreenViewer]);"
  • List of packages:
    • glscenelazarus The main package.
    • glscenecgshader Cg Shader components
    • glsceneode ODE components
    • glss_fmodlaz FMOD component
    • gls_winonly Windows only, contains sound support over mmsystem, BASS support and GLScreenSaver component
  • Сompilation "demo" - mistakes:
    • If not found class - TGLSceneViewer: To correct the uses (demo): GLLCLViewer - at GLViewer

Installation version 0.9.6.1

  • Create the directory lazarus\components\GLScene
  • On this directory, unzip the files from the zip file
  • Open lazarus
  • Open the package glscenelazarus.lpk with Component/Open package file (.lpk) from lazarus\components\glscene\Lazarus
  • (Click on Compile is only necessary, if you don't want to install the component into the IDE)
  • Click on Install
  • Repeat these steps (open .lpk, click install) for the other packages you want to use. Note: these additional packages need additional libs (fmod, ode, Cg).
    • glscenecgshader.lpk : Cg shaders (only with NVidia cards?)
    • glsceneode.lpk : support for ode lib
    • glsss_fmodlaz.lpk : support for fmod lib
    • gls_winonly.lpk : this can be installed on windows only. Contains screensaver stuff as well as support for BASS lib.

Hint: sometimes an Error "GLGraphics not found" occurs. Don't worry, just do Tools->Build Lazarus again and it should be ok.

A full install of Lazarus with GLScene already in the IDE is available as binary win32 release or http://www.skinhat.com/lazarus

Just a warning for (new) Linux users: GLScene in its current state is not working "out of the box" (lots of modifications/additions needed). UPDATE: this is not true anymore. glscene for lazarus is pretty up-to-date and most things work good right out of the box for windows as well as for linux.

As of latest trunk version (see svn above) the linux version is working well. Some demos (about 20%) are still broken but the majority of glscene is now working. We're also moving towards making it work in other Unix platforms like FreeBSD.

The missing/nonworking parts on non-windows are: glKeyboard (uses winapi, but is not required mostly), glSound(which uses mm, we need to use openal or somesuch)

A fully featured windows installer is planned.

Help