Thanks Christophe, fixes now merged and submitted to SVN.

On Tue, Sep 2, 2008 at 10:00 AM, christophe loustaunau
<[EMAIL PROTECTED]> wrote:
> Sorry, there is an error on the files I have send , please use this new
> files.
>
> Thanks.
>
> On Tue, Sep 2, 2008 at 10:42 AM, christophe loustaunau
> <[EMAIL PROTECTED]> wrote:
>>
>> Hi,
>>
>> 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.
>>
>> Regards.
>>
>> --
>> Christophe Loustaunau.
>
>
>
> --
> Christophe Loustaunau.
>
> _______________________________________________
> osg-submissions mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
>
>
_______________________________________________
osg-submissions mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org

Reply via email to