Hi Dirk,

On 6/26/07, Dirk Reiners <[EMAIL PROTECTED]> wrote:


Yup. Whatever texture you want to use in the shader needs to be part of
the
material, or it not be active when the object is rendered. Given that your
shader defines which textures are sampled, it's up to you to decide if and
how
to use it.

        Dirk


I tried to add the texture as a chunk to my material, but I still couldn't
get the shader working correctly. I added the texture like this:

   SimpleMaterialPtr simpleMaterial = SimpleMaterial::create();
   beginEditCP(simpleMaterial);
       simpleMaterial->addChunk(shl);
       simpleMaterial->addChunk(texture);
   endEditCP(simpleMaterial);

Where shl is a SHLChunk object, and texture is a TextureChunk object.

I took a look at the testCGShader.cpp (located at Source/Contrib/CGChunk),
and the only difference with my code would be that in my shader, the uniform
sampler is declared globally to the shader, whereas in testCGShader it's
declared as a parameter to the main function.


Thanks for your attention,

Theo
-------------------------------------------------------------------------
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