i am using microsoft visual studio 2005,  still do i required to setup glew 
header and lib's  as we do in OpenGL? 
 
Best Regards
Brajesh Lal 

 



----- Original Message ----
From: Simon Haegler <[EMAIL PROTECTED]>
To: [email protected]
Sent: Sunday, May 13, 2007 2:42:36 PM
Subject: Re: [Opensg-users] GLSL+OpenSG

> I am new to OpenSG.
> 
> I want to do use GLSL with OpenSG. How i can setup GLSL for OpenSG?

i'm also quite new to the GLSL part in OpenSG, but it worked almost at once...

1) create an shl chunk

   SHLChunkPtr shl = SHLChunk::create();
   beginEditCP(shl);
       shl->readVertexProgram(...);
       shl->readFragmentProgram(...);

       // if necessary, pass some params to the shader program
       shl->setUniformParameter(...);
   endEditCP(shl);



2) add it to your material

  SimpleMaterialPtr mat = SimpleMaterial::create();
  beginEditCP(mat);
     // set other params ...
     mat->setAmbient      (Color3f(0.0,0.0,0.0));
     mat->setDiffuse      (Color3f(...));
     mat->setEmission     (Color3f(0.0,0.0,0.0));
     mat->setSpecular     (Color3f(0.3,0.3,0.3));
     mat->setShininess    (5.0f);
     mat->setTransparency (0.0f);
     mat->setColorMaterial(GL_AMBIENT_AND_DIFFUSE);

     // add the GLSL part
     mat->addChunk(shl);

     // add texture chunks
     mat->addChunk(texChunk);
endEditCP(mat);

cheers,
simon

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users







       
____________________________________________________________________________________You
 snooze, you lose. Get messages ASAP with AutoCheck
in the all-new Yahoo! Mail Beta.
http://advision.webevents.yahoo.com/mailbeta/newmail_html.html
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to