Re: [osg-users] Constructor parameters of osg::Uniform
Am 28.06.2018 um 15:03 schrieb Robert Osfield: > On Thu, 28 Jun 2018 at 13:57, Robert Osfield wrote: >> The original osg::Uniform class is a bit of unwieldy mess. In >> hindsight we shouldn't have gone for this particular implementation as >> it's a bit too open ended. > As a bit of background, Mike Weiblen with a bit of input from myself > created the GLSL support for the OSG before OpenGL 2.0 came out and on > prototype drivers. It was completely bleeding edge of OpenGL as well > as trying to implement this stuff in scene graphs, there was no prior > art, it was very much winging it. The fact that is has lasted so long > without a major rewrite suggests Mike came up with reasonable > solution. > > The first git log entry for osg::Uniform is : > > Date: Thu Feb 24 13:33:35 2005 + > > From Mike Weiblen, adding prelimimnary GL Shader Language support > into core OSG lib. >with renaming and reordering by Robert Osfield, > > 13 years later it's easy to spot better ways of doing it, but kinda > cool this stuff was once pushing things forward - this work was even > used a demo at the OpenGL BOF that GLSL/2,0 was launched :-) > > Robert. -- *TEXION Software Solutions, Rotter Bruch 26a, D-52068 Aachen* Phone: +49 241 475757-0 Fax: +49 241 475757-29 Web: http://texion.eu eMail: i...@texion.eu ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Constructor parameters of osg::Uniform
It would be the easiest putting an "explicit " in front of the constructor but I guess there would be far to many reclaims then :) - Werner - Am 28.06.2018 um 15:03 schrieb Robert Osfield: > On Thu, 28 Jun 2018 at 13:57, Robert Osfield wrote: >> The original osg::Uniform class is a bit of unwieldy mess. In >> hindsight we shouldn't have gone for this particular implementation as >> it's a bit too open ended. > As a bit of background, Mike Weiblen with a bit of input from myself > created the GLSL support for the OSG before OpenGL 2.0 came out and on > prototype drivers. It was completely bleeding edge of OpenGL as well > as trying to implement this stuff in scene graphs, there was no prior > art, it was very much winging it. The fact that is has lasted so long > without a major rewrite suggests Mike came up with reasonable > solution. > > The first git log entry for osg::Uniform is : > > Date: Thu Feb 24 13:33:35 2005 + > > From Mike Weiblen, adding prelimimnary GL Shader Language support > into core OSG lib. >with renaming and reordering by Robert Osfield, > > 13 years later it's easy to spot better ways of doing it, but kinda > cool this stuff was once pushing things forward - this work was even > used a demo at the OpenGL BOF that GLSL/2,0 was launched :-) > > Robert. -- *TEXION Software Solutions, Rotter Bruch 26a, D-52068 Aachen* Phone: +49 241 475757-0 Fax: +49 241 475757-29 Web: http://texion.eu eMail: i...@texion.eu ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Constructor parameters of osg::Uniform
On Thu, 28 Jun 2018 at 13:57, Robert Osfield wrote: > The original osg::Uniform class is a bit of unwieldy mess. In > hindsight we shouldn't have gone for this particular implementation as > it's a bit too open ended. As a bit of background, Mike Weiblen with a bit of input from myself created the GLSL support for the OSG before OpenGL 2.0 came out and on prototype drivers. It was completely bleeding edge of OpenGL as well as trying to implement this stuff in scene graphs, there was no prior art, it was very much winging it. The fact that is has lasted so long without a major rewrite suggests Mike came up with reasonable solution. The first git log entry for osg::Uniform is : Date: Thu Feb 24 13:33:35 2005 + From Mike Weiblen, adding prelimimnary GL Shader Language support into core OSG lib. with renaming and reordering by Robert Osfield, 13 years later it's easy to spot better ways of doing it, but kinda cool this stuff was once pushing things forward - this work was even used a demo at the OpenGL BOF that GLSL/2,0 was launched :-) Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Constructor parameters of osg::Uniform
On Thu, 28 Jun 2018 at 13:06, Sebastian Messerschmidt wrote: > @Robert: > Any insights? The original osg::Uniform class is a bit of unwieldy mess. In hindsight we shouldn't have gone for this particular implementation as it's a bit too open ended. In master I have written a osg::UniformBase class and a template uniform class that enables use to create a series of explictly typed uniforms such as IntUnfirom, FloatUnfiorm etc. This scheme is a bit more robust when it comes to being able to easily pick the type you want. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Constructor parameters of osg::Uniform
Hi Werner, Hi all, I recently discovered a strange case in creation of a Uniform: farRadiusRescaleUniform=newosg::Uniform("farRadiusRescale",2.0f); The only constructor I could find is like that: Uniform(Typetype,conststd::string,intnumElements=1); The wrong construction sometimes leads to unexpected results. Why is the compiler not reclaming about this mismatch in parameters? This is called implicit conversion and is totally legal. In order to make to compiler avoid implicit conversion it can be tagged as explicit. As i've tumbled over this one more than once it might acutally be a good idea to change the uniform constructors which take only the name and "numElements". @Robert: Any insights? Cheers Sebastian - Werner - ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Constructor parameters of osg::Uniform
Hi all, I recently discovered a strange case in creation of a Uniform: farRadiusRescaleUniform=newosg::Uniform("farRadiusRescale",2.0f); The only constructor I could find is like that: Uniform(Typetype,conststd::string,intnumElements=1); The wrong construction sometimes leads to unexpected results. Why is the compiler not reclaming about this mismatch in parameters? - Werner - ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org