Ralf Habacker | 30 May 12:05 2016
Picon
Gravatar

Install msvc debug files along with the binaries

Hi Robert,

the appended files contains a patch, which solves an issue with msvc
builds not installing debug files along with the related binaries.

The related commit is at
https://github.com/rhabacker/osg/commit/f4896a44b317d583c15c5a9dd78c23983d1f1b84

BTW: For easier merging, which saves your time,  I also can provide the
patch as pull request on github.com

Regards
Ralf

Attachment (ModuleInstall.cmake): text/x-cmake, 1687 bytes
Attachment (OsgMacroUtils.cmake): text/x-cmake, 26 KiB
_______________________________________________
osg-submissions mailing list
osg-submissions@...
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
Ralf Habacker | 30 May 12:00 2016
Picon
Gravatar

Identify files in object cache by filename and optional provided options.

Hi Robert,

the appended file contains a patch fixing an object cache issue, we had
in an application
(http://www.openscenegraph.org/index.php/gallery/use-cases/189-fm-profil)

Objects with the same filename may be different from others based on the
provided plugin options. Using filename *and* the provided options as
object cache key helps to avoid fetching the wrong object.

related commit
https://github.com/rhabacker/osg/commit/b41f6dd905df2a39c97bbde8d9f986572c80f285

Regards
 Ralf

Attachment (Registry.cpp): text/x-c++src, 56 KiB
_______________________________________________
osg-submissions mailing list
osg-submissions@...
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
Ralf Habacker | 30 May 11:56 2016
Picon
Gravatar

Fix bug not detecting unc pathes in osgDB::isAbsolutePath()

Hi Robert,

the appended file contains a fix for the bug mentioned in the subject.

The related commit is at
https://github.com/rhabacker/osg/commit/b6c19fd2f0c40a22616ca5e55ca0af6de3523618

Regards
 Ralf

Attachment (FileNameUtils.cpp): text/x-c++src, 16 KiB
_______________________________________________
osg-submissions mailing list
osg-submissions@...
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
Julien Valentin | 28 May 17:12 2016
Picon

use bufferobject in TextureBuffer instead of raw gl

Hi,
I updated osg::TextureBuffer in order to use delegation to a bufferobject
(osg::TextureBufferObject)instead of raw gl
Maybe this new class should be added in BufferObject files

It require some minor change in osggpucull example but nothing drastic (just a few indirection to the new 
texbuffer member)

... 

Thank you!

Cheers,
Julien

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=67268#67268

Attachment (osggpucull.cpp): text/x-c++src, 106 KiB
Attachment (TextureBuffer): application/octet-stream, 6536 bytes
Attachment (TextureBuffer.cpp): text/x-c++src, 10 KiB
_______________________________________________
osg-submissions mailing list
osg-submissions@...
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
(Continue reading)

Ben Woods | 21 May 16:10 2016
Picon
Gravatar

Replace deprecated FFmpeg API to fix build with ffmpeg-3.0.x

Please find attached files to update the files in src/osgPlugins/ffmpeg/ to replace the deprecated FFmpeg API with the new FFmpeg API.

Without these changes OpenSceneGraph will fail to build against FFmpeg 3.0.x.

These are full files, with changes made against those in the current GitHub repository. All 4 files should be place in src/osgPlugins/ffmpeg/.
        modified:   FFmpegDecoderAudio.cpp
        modified:   FFmpegDecoderVideo.cpp
        modified:   FFmpegDecoderVideo.hpp
        modified:   FFmpegParameters.cpp

Regards,
Ben
Attachment (ffmpegAPIfix.zip): application/zip, 13 KiB
_______________________________________________
osg-submissions mailing list
osg-submissions@...
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
François Cami | 19 May 22:02 2016

[trivlal] AUTHORS.txt: convert to UTF-8

Hi,

The AUTHORS.txt uses 8-bit encoding (ISO-8859*) but this does not fit
the intended usage. The result is mangled contributor names.

I've attached a UTF-8 version which was converted from the original
one with iconv, except for:
Miha Ravšelj
John Hedström
Clément Bœsch
whose names seemed mangled in the original file. I hope I fixed them properly.

Best regards,
François
OpenSceneGraph Library 3.5.2

582 Contributors:

Firstname Surname
-----------------
Robert Osfield
Stephan Huber
Paul Martz
Farshid Lashkari
Mathias Fröhlich
Wang Rui
Jean-Sébastien Guay
Mike Weiblen
Ulrich Hertlein
Marco Jez
Sukender
Eric Wing
Cedric Pinson
Brede Johansen
Bob Kuehne
Wojciech Lewandowski
Michael Platings
Laurens Voerman
Geoff Michel
Eric Sokolowsky
David Callu
Colin McDonald
Tim Moore
Martin Lavery
Trajce Nikolov
Mattias Helsing
Jason Beverage
Jannik Heller
Tree Wed
Pjotr Svetachov
Luigi Calori
Alberto Luaces
Mike Wittman
Jan Peciva
Chris Hanson
Roland Smeenk
Roger James
Jeremy Moles
J.P. Delport
Andy Skinner
Magnus Kessler
David Fries
Tom Jolley
Paul Melis
Luc Frauciel
Aurelien Albert
Brad Christiansen
Terry Welsh
Pavel Moloshtan
Olaf Flebbe
Mathieu Marache
Lionel Lagarde
Jason Daly
Art Tevs
Philip Lowman
Per Fahlberg
Norman Vine
Chris Denham
Serge Lages
Mourad Boufarguine
Alberto Farre
Torben Dannhauer
Sherman Wilcox
Romano José Magacho da Silva
Marco Fri
Glenn Waldron
André Garneau
Adrian Egli
Sebastian Messerschmidt
Randall Hopper
Kristofer Tingdahl
Jan Ciger
Gideon May
Don Tidrow
Ruben Lopez
Michael Gronager
Martin Naylor
Joakim Simonsson
David Spilling
Daniel Sjölie
Bryan Thrall
Robert Michael
Rafa Gaitan
Mike Connell
Konstantin Matveyev
Fabien Lavignotte
Andreas Ekstrand
Thomas Hogarth
Riccardo Corsi
Melchior Franz
Jordi Torres
Johannes Baeuerle
Stephane Lamoliatte
Neil Hughes
Martin Beckett
Marc Helbling
Joran Jessurun
Gino van den Bergen
David Guthrie
Csaba Halasz
Cory Riddell
Chuck Seberino
Boris Bralo
Sondra Iverson
Simon Julier
Ravi Mathur
Rainer Oder
Nico Kruithof
Martin Aumueller
Mario Valle
Lukasz Izdebski
Jorge Izquierdo Ciges
Gordon Tomlinson
Frederic Marmond
Frederic Bouvier
Carlo Camporesi
Björn Blissing
Alexander Sinditskiy
Yefei He
Thibault Genessay
Sasa Bistrovic
Ralf Habacker
Mikhail Izmestev
Markus Trenkwalder
Loic Dachary
Joseph Steel
John Shue
Brad Colbert
Ben Discoe
Vivek Rajan
Uwe Woessner
Tony Horrobin
Thom DeCarlo
Tatsuhiro Nishioka
Tanguy Fautré
Ryan Kawicki
Richard Schmidt
Peter Hrenka
Paul de Repentigny
Nikolaus Hanekamp
Neil Salter
Neil Groves
Mihai Radu
Michael Hartman
Martins Innus
Maciej Krol
Lilin Xiong
Leandro Motta Barros
Julien Valentin
Johan Nouvel
Javier Taibo
Hartwig Wiesmann
Donn Mielcarek
Corbin Holtz
Blasius Czink
Alexander Irion
Ulrich Fri
Toshiyuki Takahei
Sebastien Grignard
Rune Schmidt Jensen
Rudolf Wiedemann
Maria Ten
Liang Aibin
Katharina Plugge
John Vidar Larring
John Kelso
John Ivar
Gustav Haapalahti
Erik den Dekker
Emmanuel Roche
Domenico Mangieri
Daniel Larimer
Colin Dunlop
Bruce Clay
Bradley Anderegg
Andreas Goebel
Alok Priyadarshi
Ali Botorabi
Alan Dickinson
Wee See
Vladimir Shabanov
Vladimir Chebaev
Tugkan Calapoglu
Tim Daoust
Sylvain Marie
Stephane Fri
Sohey Yamamoto
Sergey Leontyev
Sean Spicer
Santosh Gaikwad
Ryan Pavlik
Robert Milharcic
Rene Molenaar
Piotr Domagalski
Phil Atkin
Pawel Ksiezopolski
Patrick Neary
Nathan Monteleone
Miha Ravšelj
Miguel Escriva
Mattias Linde
Mark Sciabica
Marcin Prus
Lee Butler
Lars Nilsson
Konstantin Sinitsyn
Ken Sewell
Julian Ortiz
Julen Garcia
John Kaniarz
Johannes Scholz
Jim Vaughan
Jeremy Bell
Jaromir Vitek
James French
Jaap Glas
Guillaume Millet
Gary Quinn
Garrett Potts
Gabor Dorka
Fabio Mierlo
Doug McCorkle
Donald Cipperly
Don Leich
Don Burns
Dietmar Funck
Colin Cochran
Christian Ruzicka
Christian Buchner
Charles Cole
Blake Williams
Björn Hein
Aurélien Chatelain
Antoine Hue
Andrew Bettison
Andreas Henne
Anders Backman
Alexander Wiebel
Alessandro Terenzi
Alberto Barbati
Zach Deedler
Yuzhong Shen
Warren Macchi
Vincent Bourdier
Terrex
Tassilo Glander
Steve Lunsford
Stephane Simon
Stephan Eilemann
Sergey Polischuk
Sean Sat
Rune Mon
Roni Zanolli
Raymond de Vries
Ralf Kern
Piotr Gwiazdowski
Pierre Haritchabalet
Philippe Renon
Perry Miller
Paul Palumbo
Paul Obermeier
Nick Mon
Nguyen Van Truong
Nathan Cournia
Morten Haukness
Morné Pistorius
Michael Mc Donnell
Michael Henheffer
Michael Guerrero
Max Bandazian
Mathias Fiedler
Mathew May
Martin von Gargern
Martin Spott
Martin Lambers
Martijn Kragtwijk
Marius Heise
Marcin Hajder
Marcel Pursche
Lilith Bryant
Kevin Moiule
Keith Steffen
Joseph Winston
John Aughey
Joachim Pouderoux
Jean-Christophe Lombardo
Jan Klimke
James Turner
James Moliere
Igor Kravtchenko
Himar Carmona
He Sicong
Guy Volckaert
Gustavo Wagner
Guillaume Taze
Guillaume Chouvenc
Giuseppe Donvito
Gill Peacegood
Giampaolo Viganò
Gerrick Bivins
George Tarantilis
Geoff Fri
Ferdi Smit
Eduardo Poyart
Edgar Ellis
Dmitry Marakasov
Dimi Christopoulos
Diane Delallée
David Longest
David Ergo
Daniel Trstenjak
Craig Bosma
Claus Scheiblauer
Christophe Loustaunau
Christian Kehl
Bradley Baker Searles
Brad Anderegg
Aric Aumann
Anish Thomas
Andrew Sampson
Andrew Lorino
Alexandre Amalric
Aitor Moreno
Zbigniew Sroczynski
Yuri Vilmanis
Yefei Wed
Xin Li
Wang Lam
Wand Rui
Walter J. Altice
Volker Walkiewicz
Vladimir Vukicevic
Vlad Danciu
Vivien Delage
Vincent Vivanloc
Vincent Gadoury
Vasily Radostev
Valery Bickov
Valeriy Dubov
Vaclav Bilek
Tyge Løvset
Troy Yee
Tony Vasile
Tomas Hogarth
Tomas Hnilica
Todd Furlong
Tobias Ottenweller
Tino Schwarze
Tim George
Thorsten Brehm
Thomas Weidner
Tan Dunning
Tamer Fahmy
Stewart Andreason
Steven Thomas
Stephan Wenglorz
Stanislav Fri
Stanislav Blinov
Simon Hammett
Simon Carmody
Simon Buckley
Sid Byce
Shuxing Xiao
Shane Arnott
Sergey Kurdakov
Sebastien Kuntz
Ruth Lang
Rune Sat
Ruben Tue
Ruben The
Ruben Smelik
Ross Anderson
Ronny Krueger
Ronald van Maarseveen
Romano Wed
Romain Ouabdelkader
Romain Charbit
Rocco Martino
Robert Swain
Robert Mon
Rob Smith
Rob Radtke
Rob Bloemkool
Rick Pingry
Rick Appleton
Remo Eichenberger
Reinhard Sainitzer
Rein Kadijk
Ragnar Hammarqvist
R Fri
Qing Shen
Piotr Rak
Pierre Bourdin
Philipp Svehla
Philipp Siemoleit
Philipp Mächler
Philip Lamb
Petr Salinger
Peter Bear
Peter Amstutz
Per Nordqvist
Pavel Sat
Paul Idstein
Paul Fredrikson
Paul Fotheringham
Paul Cheyrou-Lagreze
Pau Garcia
Patrick Hartling
Parag Chaudhur
Panagiotis Papadakos
Panagiotis Koutsourakis
Orhun Birsoy
Oren Fromberg
Oliver Neumann
Ole-Morten Duesund
Ognjen Kostic
Nicolas Brodu
Nick Thu
Nick Fri
Nick Black
Neil Tue
Mojtaba Fathi
Mirko Viviani
Mikkel Gjøl
Mike Krus
Mike Garrity
Mick Thu
Michal Durkovic
Michael Schanne
Michael Polak
Michael Morrison
Michael Logan
Michael Kapelko
Michael Bach Jensen
Maya Thu
Maya Leonard
Max Rhiener
Max Behensky
Mauricio Hofmam
Matthew May
Matthew Johnson-Roberson
Matt Green
Matt Burke
Mathias Walker
Mathias Goldau
Mason Menninger
Martin Scheffler
Martin Innus
Martin Beck
Marius Kintel
Mario Guimaraes
Marcus Hein
Marco Thu
Marco Sciabica
Marco Lehmann
Lukas Diduch
Louis Hamilton
Likasz Izebski
Lewis Harmon
Leigh Stivers
Laurens Loerman
Laurence Muller
Laura Cerritelli
Kyle Centers
Kristopher Bixler
Kim Seokhwan
Kim Bale
Karsten Weiss
Karl Heijdenberg
Jutta Sauer
Julian Scheid
Juergen Rensen
Juan Manuel Alvarez
Juan Hernando
Josh Portway
Jonathan Greig
John Tan
John Hedström
John Grant
John Farrier
John Donovan
John Davis
John Cummings
John Argentieri
Joan Abadie
Jim Brooks
Jeroen den Dekker
Jeffrey Kinross
Jay Zuckerman
Jason Howlett
Jason Ballenger
Jamie Robertson
James Killian
James Athey
J.E. Hoffmann
Holger Helmich
Henrique Bucher
Hautio Jari
Hartmut Seichter
Gunter Huber
Gregory Jaegy
Graeme Harkness
Github It
Gian Lorenzetto
George Papagiannakis
Geoff Thu
Galen Faidley
Frida Schlaug
Frederic Smith
Frederic Morin
Frank Warmerdam
Frank Midgley
Frank Lindeman
Frank Lichtenheld
Francois Tigeot
Filip Arlet
Ferdinand Cornelissen
Fajran Iman
Fabien Dachicourt
Erik Johnson
Eric Thu
Eric Buehler
Eduardo Alberto
Edmond Gheury
Ed Ralston
Duvan Cope
Duncan Cavens
Drew Whitehouse
Douglas A. Pouk
Dmitriy Ogalcev
Dean Iverson
David Jung
Danny Valente
Daniel Stien
Dan Minor
César L. B. Silveira
Cyril Brulebois
Curtis Rubel
Cory Slep
Clément Bœsch
Clay Fowler
Claus Steuer
Chuck Sembroski
Christopher Blaesius
Christopher Baker
Christophe Herreman
Christian Noon
Christian Kaser
Christian Ehrlicher
Chris McGlone
Carlos Garcea
Bryce Eldridge
Bruno Herbelin
Brian Keener
Brede Wed
Brede Thu
Brandon Hamm
Bill Prendergast
Bernardt Duvenhage
Benoit Laniel
Benjamin Wasty
Ben van Basten
Bart Gallet
Axel Volley
Arjun Ramamurthy
Anthousis Andreadis
Andy Preece
Andrew Reyonolds
Andreas Roth
Andreas Jochens
Andre Normann
Alois Wismer
Almalric Alexandre
Allen Bierbaum
Alexey Pavlov
Alberto Jaspe
Alan Purvis
Alan Ott
Alan Harris
Adrien Grandemange
Adrian Clark
Adam Richard
_______________________________________________
osg-submissions mailing list
osg-submissions@...
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
Davide Raccagni | 18 May 20:02 2016
Picon

GraphicsWindowWin32 compiling errors under Visual Studio 2015

Hi All,
I've kept osg from the git repository and I have the following errors at compile time under Visual Studio 2015 environment:

  D:\Dev\msvs2015_64\osg\src\osgViewer\GraphicsWindowWin32.cpp(704): error C2084: function 'osgViewer::Win32WindowingSystem::Win32WindowingSystem(void)' already has a body [d:\Dev\msvs2015_64\
osg\build\src\osgViewer\osgViewer.vcxproj]
  D:\Dev\msvs2015_64\osg\src\osgViewer\GraphicsWindowWin32.cpp(725): error C2084: function 'osgViewer::Win32WindowingSystem::~Win32WindowingSystem(void)' already has a body [d:\Dev\msvs2015_64
\osg\build\src\osgViewer\osgViewer.vcxproj]
  D:\Dev\msvs2015_64\osg\src\osgViewer\GraphicsWindowWin32.cpp(1550): error C2440: 'initializing': cannot convert from 'osg::observer_ptr<osgViewer::Win32WindowingSystem>' to 'osgViewer::Win32
WindowingSystem *' [d:\Dev\msvs2015_64\osg\build\src\osgViewer\osgViewer.vcxproj]

I have fixed the problem by myself removing the double body declarations in the class and in the implementation of Win32WindowingSystem class and assigning the pointer to osg::observer_ptr<osgViewer::Win32WindowingSystem>: is it possible to have a fixed version on the repository? You can find in attachment my version of the files.

Regards,
Davide 
Attachment (GraphicsWindowWin32.cpp): text/x-c++src, 142 KiB
_______________________________________________
osg-submissions mailing list
osg-submissions@...
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
Alberto Luaces | 18 May 13:21 2016
Picon

#defines for building on Hurd and BSD kernels

Hello,

those patches were required to build OSG on Hurd and systems that only
use BSD as a kernel (Debian FreeBSD).  They are pretty light.

Thank you,

--

-- 
Alberto
_______________________________________________
osg-submissions mailing list
osg-submissions@...
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
Marcin Hajder | 18 May 12:42 2016
Picon

Fix for nvtt plugin to support RGTC1/RGTC2 pixel format

Hi Robert,

Thanks to this simple fix it's possible to compress red/red-green channel of RGB/RGBA image to
GL_COMPRESSED_RED_RGTC1_EXT/GL_COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT pixel format. 

Thank you!

Cheers,
Marcin

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=67141#67141

Attachments: 
http://forum.openscenegraph.org//files/nvttimageprocessor_296.zip
Julien Valentin | 14 May 15:52 2016
Picon

Re: OSG Transform Feedback Example

Hello,
I've cleaned my previous version of  transformFeedBack example in order to use
TransformFeedbackBufferBinding and a DrawCallback

Code:

/* OpenSceneGraph example, osgtransformfeedback
*
*  Permission is hereby granted, free of charge, to any person obtaining a copy
*  of this software and associated documentation files (the "Software"), to deal
*  in the Software without restriction, including without limitation the rights
*  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
*  copies of the Software, and to permit persons to whom the Software is
*  furnished to do so, subject to the following conditions:
*
*  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
*  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
*  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
*  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
*  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
*  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
*  THE SOFTWARE.
*/

/* file:        examples/osgtransformfeedback/osgtransformfeedback.cpp
* author:      Julien Valentin 2013-10-01
* copyright:   (C) 2013
* license:     OpenSceneGraph Public License (OSGPL)
*
* A demo of GLSL geometry shaders using OSG transform feedback
*
*/

/* OpenSceneGraph example, osgtransformfeedback
*
*  Permission is hereby granted, free of charge, to any person obtaining a copy
*  of this software and associated documentation files (the "Software"), to deal
*  in the Software without restriction, including without limitation the rights
*  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
*  copies of the Software, and to permit persons to whom the Software is
*  furnished to do so, subject to the following conditions:
*
*  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
*  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
*  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
*  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
*  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
*  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
*  THE SOFTWARE.
*/

/* file:        examples/osgtransformfeedback/osgtransformfeedback.cpp
* author:      Julien Valentin 2013-10-01
* copyright:   (C) 2013
* license:     OpenSceneGraph Public License (OSGPL)
*
* A demo of GLSL geometry shaders using OSG transform feedback
*
*/

#include <osg/GL2Extensions>
#include <osg/Notify>
#include <osg/ref_ptr>
#include <osg/Geode>
#include <osg/Geometry>
#include <osg/Point>
#include <osg/Vec3>
#include <osg/Vec4>
#include <osg/Program>
#include <osg/Shader>
#include <osg/BlendFunc>

#include <osg/Uniform>
#include <osgViewer/Viewer>

#include <osg/BufferIndexBinding>
#include <osgDB/WriteFile>

#include <iostream>

///////////////////////////////////////////////////////////////////////////

class SineAnimation: public osg::UniformCallback
{
public:
    SineAnimation( float rate = 1.0f, float scale = 1.0f, float offset = 0.0f ) :
        _rate(rate), _scale(scale), _offset(offset)
    {}

    void operator()( osg::Uniform* uniform, osg::NodeVisitor* nv )
    {
        float angle = _rate * nv->getFrameStamp()->getSimulationTime();
        float value = sinf( angle ) * _scale + _offset;
        uniform->set( value );
    }

private:
    const float _rate;
    const float _scale;
    const float _offset;
};

//////////////////////////////////////////////////////////////////////////////////////
namespace osg
{
class OSG_EXPORT TransformFeedBackDrawCallback: public Drawable::DrawCallback
{
protected:

    std::vector<osg::ref_ptr<osg::TransformFeedbackBufferBinding> > _tfbbs;

    GLuint _index;
public:
    TransformFeedBackDrawCallback():Drawable::DrawCallback()
    {
        _type=0;
    }
    TransformFeedBackDrawCallback(const Drawable::DrawCallback&dc,const CopyOp&co);

    /** Get the primitive type of the feedback.
     */
    GLenum getFeedBackType() const
    {
        return _type;
    }
    void  setFeedBackType(GLenum e)
    {
        _type=e;
    }

    void addTransformFeedbackBufferBinding(osg::TransformFeedbackBufferBinding * tfbb);
    void removeTransformFeedbackBufferBinding(osg::TransformFeedbackBufferBinding * tfbb);
    osg::TransformFeedbackBufferBinding *getTransformFeedbackBufferBinding(const unsigned int &i)const
    {
        return _tfbbs[i];
    }

    unsigned int getNumTransformFeedbackBufferBindings()const
    {
        return _tfbbs.size();
    }

    META_Object(osg,TransformFeedBackDrawCallback);

    /** do TransformFeedback draw code.*/
    virtual void drawImplementation(osg::RenderInfo& renderInfo,const osg::Drawable*  drawable ) const;

};
TransformFeedBackDrawCallback::  TransformFeedBackDrawCallback(const
Drawable::DrawCallback&dc,const CopyOp&co):osg::Drawable::DrawCallback(dc,co)
{
}
void
TransformFeedBackDrawCallback::addTransformFeedbackBufferBinding(osg::TransformFeedbackBufferBinding
* tfbb)
{
    if(tfbb)_tfbbs.push_back(tfbb);
}
void
TransformFeedBackDrawCallback::removeTransformFeedbackBufferBinding(osg::TransformFeedbackBufferBinding
* tfbb)
{

    for(std::vector<osg::ref_ptr<osg::TransformFeedbackBufferBinding> >::iterator
i=_tfbbs.begin(); i!=_tfbbs.end(); i++)
    {
        if((*i).get()==tfbb)
        {

            _tfbbs.erase(i);
            return;
        }
    }
}

/** do TransformFeedback draw code.*/
void TransformFeedBackDrawCallback::drawImplementation(osg::RenderInfo& renderInfo,const
osg::Drawable*  drawable ) const
{
    osg::GLExtensions* ext = renderInfo.getState()->get<osg::GLExtensions>();

///required?
    for(std::vector<osg::ref_ptr<osg::TransformFeedbackBufferBinding> >::const_iterator
i=_tfbbs.begin(); i!=_tfbbs.end(); i++)
    {
        (*i)->apply(*renderInfo.getState());

    }

    glEnable(GL_RASTERIZER_DISCARD);
    ext->glBeginTransformFeedback(_type);
    drawable->drawImplementation(renderInfo);

    ext->glEndTransformFeedback();

    glDisable(GL_RASTERIZER_DISCARD);

///unbind all TransformFeedbackBufferBindingS
    ext->glBindBufferBase(GL_TRANSFORM_FEEDBACK_BUFFER, 0, 0);
}
}

///////////////////////////////////////////////////////////////////////////

///////////////////////////////////////////////////////////////////////////
static const char* RendervertSource =
{
    "#version 120\n"
    "varying vec4 v_color;\n"
    "void main(void)\n"
    "{\n"
    "    v_color = gl_Vertex;\n"
    "    gl_Position = gl_ModelViewProjectionMatrix *(gl_Vertex);\n"
    "}\n"
};
static const char* vertSource =
{
    "#version 120\n"
    "#extension GL_EXT_geometry_shader4 : enable\n"
    "varying out vec4 v_color;\n"
    "void main(void)\n"
    "{\n"
    "   gl_Position = (gl_Vertex);\n"
    "	v_color = gl_Vertex;\n"
    "}\n"
};

static const char* geomSource =
{
    "#version 120\n"
    "#extension GL_EXT_geometry_shader4 : enable\n"
    "uniform float u_anim1;\n"
    " varying in vec4 v_color[];\n"
    " varying  vec4 out1;\n"
    "void main(void)\n"
    "{\n"
    "    vec4 v =vec4( gl_PositionIn[0].xyz,1);\n"
    " out1 =  v + vec4(u_anim1,0.,0.,0.);//  gl_Position = v + vec4(u_anim1,0.,0.,0.); \n"
    "  EmitVertex();\n"
    "    EndPrimitive();\n"
    "   out1 =  v - vec4(u_anim1,0.,0.,0.); // gl_Position = v - vec4(u_anim1,0.,0.,0.);  \n"
    " EmitVertex();\n"
    "    EndPrimitive();\n"
    "\n"
    "   out1=  v + vec4(0.,1.0-u_anim1,0.,0.);// gl_Position = v + vec4(0.,1.0-u_anim1,0.,0.); \n"
    "  EmitVertex();\n"
    "    EndPrimitive();\n"
    "   out1 =  v - vec4(0.,1.0-u_anim1,0.,0.); //gl_Position = v - vec4(0.,1.0-u_anim1,0.,0.); \n"
    "  EmitVertex();\n"
    "    EndPrimitive();\n"
    "}\n"
};

static const char* fragSource =
{
    "#version 120\n"
    "#extension GL_EXT_geometry_shader4 : enable\n"
    "varying vec4 v_color_out;\n"
    "void main(void)\n"
    "{\n"
    "    gl_FragColor = vec4(1,0,0,1);//v_color_out;\n"
    "}\n"
};

osg::Program* createGeneratorShader()
{
    osg::Program* pgm = new osg::Program;
    pgm->setName( "osg transformfeedback generator demo" );
    pgm->addShader( new osg::Shader( osg::Shader::VERTEX,   vertSource ) );
    ///setup Transform FeedBack program
    pgm->setParameter( GL_GEOMETRY_VERTICES_OUT_EXT, 4 );
    pgm->setParameter( GL_GEOMETRY_INPUT_TYPE_EXT, GL_POINTS );
    pgm->setParameter( GL_GEOMETRY_OUTPUT_TYPE_EXT, GL_POINTS );
    pgm->addShader( new osg::Shader( osg::Shader::GEOMETRY, geomSource ) );
    pgm->addTransformFeedBackVarying(std::string("out1"));
    pgm->setTransformFeedBackMode(GL_INTERLEAVED_ATTRIBS);
    return pgm;
}

osg::Program* createRenderShader()
{
    osg::Program* pgm = new osg::Program;
    pgm->setName( "osg transformfeedback renderer demo" );
    pgm->addShader( new osg::Shader( osg::Shader::VERTEX,   RendervertSource ) );
    pgm->addShader( new osg::Shader( osg::Shader::FRAGMENT, fragSource ) );
    return pgm;
}
int main( int , char** )
{
    osg::Geode* root( new osg::Geode );
    osg::ref_ptr<osg::Geometry > somePointsGenerator = new osg::Geometry();
    somePointsGenerator->setName("SomePointsGenerator");
    {
        somePointsGenerator->setUseVertexBufferObjects(true);
        somePointsGenerator->setUseDisplayList(false);

        osg::StateSet* sset = somePointsGenerator->getOrCreateStateSet();
        sset->setMode( GL_LIGHTING, osg::StateAttribute::OFF );
        osg::ref_ptr<osg::Vec4Array> vAry = new osg::Vec4Array;
        vAry->push_back( osg::Vec4(0,0,0,1) );
        vAry->push_back( osg::Vec4(0,1,0,1) );
        vAry->push_back( osg::Vec4(1,0,0,1) );
        vAry->push_back( osg::Vec4(1,1,0,1 ));
        somePointsGenerator->addPrimitiveSet( new osg::DrawArrays( GL_POINTS, 0, vAry->size() ) );
        somePointsGenerator->setVertexArray( vAry );

        osg::ref_ptr<osg::Program> _program=createGeneratorShader() ;
        sset->setAttribute(_program );

        // a generic cyclic animation value
        osg::Uniform* u_anim1( new osg::Uniform( "u_anim1", 0.9f ) );
        u_anim1->setUpdateCallback( new SineAnimation( 4, 0.5, 0.5 ) );
        sset->addUniform( u_anim1 );
    }

    osg::ref_ptr<osg::Geometry > somePointsRenderer = new osg::Geometry();
    somePointsRenderer->setName("SomePointsRenderer");
    {
        int numprimgen=somePointsGenerator->getVertexArray()->getNumElements()*4;
        somePointsRenderer->setUseVertexBufferObjects(true);
        somePointsRenderer->setUseDisplayList(false);

        osg::ref_ptr<osg::Vec4Array> vAry2 = new osg::Vec4Array;
        vAry2->resize(numprimgen);
        somePointsRenderer-> setVertexArray(vAry2);
        somePointsRenderer-> addPrimitiveSet( new osg::DrawArrays( GL_LINES, 0,numprimgen));
        osg::StateSet* sset =   somePointsRenderer-> getOrCreateStateSet();
        sset->setMode( GL_LIGHTING, osg::StateAttribute::OFF );
        sset->setAttribute( createRenderShader() );

    }

    {
        ///setup Transform FeedBack callback
        osg::TransformFeedBackDrawCallback *tfcb=new  osg::TransformFeedBackDrawCallback();
        osg::TransformFeedbackBufferBinding *tfbb=new   osg::TransformFeedbackBufferBinding ();
        tfbb->setBufferObject(somePointsRenderer->getVertexArray()->getVertexBufferObject());
        somePointsRenderer->getOrCreateVertexBufferObject();
        tfbb->setSize(somePointsRenderer->getVertexArray()->getTotalDataSize());
        somePointsGenerator->getStateSet()->setAttribute(tfbb);

        tfcb->setType(GL_POINTS);
        tfcb->addTransformFeedbackBufferBinding(tfbb);
        somePointsGenerator->setDrawCallback(tfcb);
    }

    root->addChild(somePointsGenerator);
    root->addChild(somePointsRenderer);
    ///ensure draw sequence
    somePointsGenerator->getStateSet()->setRenderBinDetails(0,"RenderBin");
    somePointsRenderer->getStateSet()->setRenderBinDetails(1,"RenderBin");

    osgViewer::Viewer viewer;
    viewer.setSceneData( root );
    return viewer.run();
}

I've also do some stuff to serialize it but it requires:
-the TransformFeedbackDrawCallback to be integrated somewhere in OSG
(..in osg/Drawable?)
-a osg::BufferObject,osg::UniforBufferBinding class serializers

Does it seams you reasonable?
If so I'll post my work on it...

[/code]

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=67104#67104
Pjotr Svetachov | 11 May 16:50 2016
Picon

optimization to serializers

Hi Robert,

here is a small optimization to the osgb/t serializers.

Best regrads,
Pjotr
Attachment (Serializer): application/octet-stream, 92 KiB
_______________________________________________
osg-submissions mailing list
osg-submissions@...
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org

Gmane