[osg-users] Vertex Shader problem
Adrian Egli OpenSceneGraph (3D)
3dhelp at gmail.com
Mon May 26 05:44:14 PDT 2008
Try with this osg file (Geo)
(1) osgviewer test.osg
(2) your app, osgDB::readfile(test.osg)
(3) are you sure that the camera at correct position, did you reset camera ?
2008/5/26 Rahul Jain <rahulj at darshan3d.com>:
> Hi all ,
> I have a scene graph some thing like this MatrixTransform -> Geode ->
> Geometry . In the MatrixTransform i am setting matrix to be
> {10, 0, 0, 0,
> 0, 10, 0, 0,
> 0, 0, 10, 0
> 2, 2, 0 , 1 }
> In the geometry i have a quad with a range (0,0) - > (1,1). Basically i
> am trying to scale and translate the quad geometry. This works fine. But
> when i try to replicate the same in my vertex shader i am not able to
> see anything. I have overridden the "Geode" node computeBound function
> to set the camera accordingly. My vertex shader looks like this
> ===================================================================
> uniform mat4 matrix; ( same as the one above : passed through osg::Uniform)
> vec4 newVertexPos;
>
> void main()
> {
> vec4 oldVertexPos = gl_Vertex;
> vec4 newVertexPos = oldVertexPos * matrix ;
>
> gl_Position = gl_ModelViewProjectionMatrix * newVertexPos;
> }
>
> ======================================================================
>
> Can some one tell me what am i doing wrong
> cheers
> RJ
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
--
********************************************
Adrian Egli
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20080526/6ec58f4c/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.osg
Type: application/octet-stream
Size: 1285 bytes
Desc: not available
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20080526/6ec58f4c/attachment.obj>
More information about the osg-users
mailing list