Hi Dirk & Carsten ! As usual you were right ! It didn't work cause my textureChunks were not *both* bound to the material ! So I tried :
beginEditCP(ChunkMat); ChunkMat->addChunk(texChunk1); ChunkMat->addChunk(texChunk2); endEditCP(ChunkMat); And then no problem binding them to the shader with indexes 0 and 1 ! Thank you very much ! :D Yann > > Hi Yann, > > Yann Mazel wrote: >> Hi ! >> >> I'm encountering a strange behaviour trying to link 2 different >> textureChunks to a fragment shader. I'm using OpenSG 1.8 >> I want to access 2 different textures in my fragment shader to do some >> depth related blending. But when I access my uniform sampler2DRects in >> the >> shader I get the same texture in both samplers. Nevertheless I checked >> the >> 2 TexChunk->getGLId() indexes and they have different values... >> I also assume I'm in a non-standard OpenSG behaviour AFAI'm on server >> code >> (I retrieve the client-side declared shaderChunkPtr via the >> the()->getFieldContainerStore() technique, many thanks Dirk). Do you >> think >> my problem is related to this ? > > Without code there is only the basic questions of what can go wrong: Do > you set > your sampler variables to the correct slots (i.e. the same ones that are > used in > the TextureChunks)? The samplers actually need to the slot or texture unit > you're using, not the texture id. You also need to have both TCs bound to > the > Material with the shader for them to be active. > > Can you post the snippet of your code that creates the material? > > Hope it helps > > Dirk > > ------------------------------------------------------------------------------ > Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are > powering Web 2.0 with engaging, cross-platform capabilities. Quickly and > easily build your RIAs with Flex Builder, the Eclipse(TM)based development > software that enables intelligent coding and step-through debugging. > Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com > _______________________________________________ > Opensg-users mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/opensg-users > > -- Yann Mazel INRIA Grenoble Rhône-Alpes Doctorant - Equipe I3D Tèl : 04 76 61 55 75 ------------------------------------------------------------------------------ Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are powering Web 2.0 with engaging, cross-platform capabilities. Quickly and easily build your RIAs with Flex Builder, the Eclipse(TM)based development software that enables intelligent coding and step-through debugging. Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com _______________________________________________ Opensg-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/opensg-users
