90 likes | 232 Views
TPad + GL. ”GL in pad”:. TRootCanvas/TRootEmbeddedCanvas were extended to support OpenGL – specific pixel format (Windows) or visual (X11), OpenGL context creation, etc.
E N D
”GL in pad”: • TRootCanvas/TRootEmbeddedCanvas were extended to support OpenGL – specific pixel format (Windows) or visual (X11), OpenGL context creation, etc. • TVirtualPadPainter - TPad::PaintLine(..), TPad::PaintBox(..) etc. now call TVirtualPadPainter's methods: and TGLPadPainter – GL version of TVirtualPadPainter – can use OpenGL functions to draw in a GL window. • Histograms, TF, etc. use TVirtualHistPainter: and TGLHistPainter - GL version of TvirtualHistPainter - can use OpenGL API to draw in a GL window. • Any other object from TPad's list of primitives, can use OpenGL to draw itself in a GL window.
”GL in pad”: Loop over TPad's collection: pavelabel->Paint(), box->Paint(), line->Paint() … TH2, … ) TPaveLabel::Paint(): gPad->PaintBox gPad->PaintPolyLine ... TBox::Paint(): gPad->PaintBox ... TLine::Paint(): gPad->PaintPolyLine TVirtualHistPainter (THistPainter or TGLHistPainter) TPad::PaintBox TPad::PaintPolyLine X11 TVirtualPadPainter OpenGL GDI (win 32)
History • All started as an attempt to reproduce different ”lego” and ”surf” options with OpenGL: • Version 1: based on bitmaps and pixmaps – software only OpenGL, 2D and text were done by TvirtualX. • Version 2: hack – mix of double-buffered GL plus bitmaps/pixmaps/ximages. Hardware accelerated, but had many memory copy operations (from GL-buffer into the pixmap, and pixmap to the screen). 2D and text are still done by TVirtualX. • Version 3 (the current version): - pure OpenGL solution, 2D is done by TVirtualPadPainter and text rendering – use the solution, implemented by Matevz and Alja Tadel and Olivier Couet, based on FTGL library.
Different plots: ”gllego+” options (TH2) ”glsurf+” options (TH2, TF2) ”glbox” (TH3) TF3 glparametric
Additional abilities: • More ”interactive” plots: • Highlight selected part (TH2, TH3) • Clipping box • ”Slicing”
Question from Olivier about sizes: root + surfaces.C, approx. 32 MB
Question from Olivier about sizes: ROOT + glsurfaces.C, approx. 42 MB
The future - version 4: - Move to TGLWidget, remove "gl manager" (obsolete class used by TPad/TCanvas/TRootCanvas). - FBO. Nice effects like cover-flow + animations. - Better integration with GLviewer (initially, all plots were tuned for TPad, and now have to be extended to work well in GLViewer (eve?) - this will be explained in the next presentation by Matevz. - New types of math plots - in many case it's just several hours to implement with OpenGL. - TGLPadPainter in GLViewer? (Matevz will mention this in the next presentation). - Cool, high quality 2D graphics with acceleration? (just a dream :) ) Cover-flow :) OpenVG with OpenGL back-end