Commit Graph

6 Commits

Author SHA1 Message Date
Robert Osfield
fd806293be From KOS, build fix for osg::Uniform::Callback to osg::UniformCallback change
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14889 16af8721-9629-0410-8352-f15c8da7e697
2015-06-03 09:07:41 +00:00
Robert Osfield
4b9aa1fd24 Replaced deprecated osg::Geometry::set*Binding() usage. 2013-06-27 09:54:12 +00:00
Robert Osfield
803d0dc60c Added missing *. 2009-01-08 12:47:20 +00:00
Robert Osfield
418dc34776 Fixed warnings 2009-01-07 11:24:47 +00:00
Robert Osfield
274aa49f8a From Christophe Loustaunau,"
I have found some errors on the example osgGeometryShaders. It's about the varying in the geometry shader.
take a look at the varying vec4 v_color.
In the vertex shader, v_color is initialized to gl_vertex
then in the geometry shader v_color is initialized to gl_PositionIn[0]
and in the fragment shader v_color is used as the fragment color.

Try to initialized v_color to vec4(1.0, 0.0, 0.0, 1.0) in the vertex shader and comment the line :
"    v_color = v;\n"  in the geometry shader, and you will see the lines as black !

It's because you have to use keywords in and out.

extract from : http://www.opengl.org/registry/specs/EXT/geometry_shader4.txt :

in - for function parameters passed into a function or for input varying
variables (geometry only)

out - for function parameters passed back out of a function, but not
initialized for use when passed in. Also for output varying variables
(geometry only).

Then for a geometry shader, a varying must be an array :
extract from : http://www.opengl.org/registry/specs/EXT/geometry_shader4.txt :

Since a geometry shader operates on primitives, each input varying variable needs to be
declared as an array. Each element of such an array corresponds to a
vertex of the primitive being processed. If the varying variable is
declared as a scalar or matrix in the vertex shader, it will be a
one-dimensional array in the geometry shader. Each array can optionally
have a size declared. If a size is not specified, it inferred by the
linker and depends on the value of the input primitive type.


Here is a patch based on the svn version of osg that correct that.
"
2008-09-17 17:25:39 +00:00
Robert Osfield
578f385760 From Mike Weiblen, support for geometry shaders, and osgeometryshaders example to demonstrate them. 2008-01-08 14:29:44 +00:00