> 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