Re: [osg-users] Why is setTexCoordArray(0, texcoords) needed if array is modified in-place

2016-07-08 Thread Florian Castellane
Hi Robert, Yes, I am indeed changing the texcoord array at the indices relevant to the part of the geometry I am texturing. :o You can indeed see in the code that I am accessing the texArray using (*texArray)[idx] ... which is actually short for Code: (*texArray)[ (*indices)[id] ] 8)

Re: [osg-users] Why is setTexCoordArray(0, texcoords) needed if array is modified in-place

2016-07-07 Thread Robert Osfield
Hi Florian, On 7 July 2016 at 15:02, Florian Castellane wrote: > I am modifying some indices of a texture coordinate array that correspond to > a subset of my floor that is divided into several parts (here, we are working > on the center part. Other

Re: [osg-users] Why is setTexCoordArray(0, texcoords) needed if array is modified in-place

2016-07-07 Thread Florian Castellane
Hi everyone, thanks for the tips. @Sebastian: Code: geometry->getPrimitiveSet(0)->setDataVariance(DataVariance::DYNAMIC) ; did not solve the problem unfortunately. As Robert points out, I'm not sure that is the problem here. @Trajce: Code: texArray->getVertexBufferObject()->dirty();

Re: [osg-users] Why is setTexCoordArray(0, texcoords) needed if array is modified in-place

2016-07-07 Thread Robert Osfield
Hi Florian, I read your post but came away confused about what your are doing/how you are going about things. As a general note, DataVariance is not used in compile or uploading of OpenGL data, just in giving hints to the operations like in osgUtil::Optimizer or in the draw traversal for holding

Re: [osg-users] Why is setTexCoordArray(0, texcoords) needed if array is modified in-place

2016-07-07 Thread Trajce Nikolov NICK
I think it was something like tcoords->getVertexBufferObject()->dirty(); On Thu, Jul 7, 2016 at 2:15 PM, Sebastian Messerschmidt < sebastian.messerschm...@gmx.de> wrote: > Hi Florian, > >> Hi Sebastian, thanks for the answer. >> >> Calling texArray->dirty() does not seem to be enough, since my

Re: [osg-users] Why is setTexCoordArray(0, texcoords) needed if array is modified in-place

2016-07-07 Thread Sebastian Messerschmidt
Hi Florian, Hi Sebastian, thanks for the answer. Calling texArray->dirty() does not seem to be enough, since my texture is not displayed. I can confirm that my shader is being applied though - it just doesn't seem to get the texture coordinates. My custom geometry class

Re: [osg-users] Why is setTexCoordArray(0, texcoords) needed if array is modified in-place

2016-07-07 Thread Florian Castellane
Hi Sebastian, thanks for the answer. Calling texArray->dirty() does not seem to be enough, since my texture is not displayed. I can confirm that my shader is being applied though - it just doesn't seem to get the texture coordinates. My custom geometry class (MyNameSpace::MyGeometry) does

Re: [osg-users] Why is setTexCoordArray(0, texcoords) needed if array is modified in-place

2016-07-07 Thread Sebastian Messerschmidt
Hi Florian Calling dirty on the modified array should be enough. Are you sure you set the useDisplayList to false and the useVertexBufferObject to true? You don't need to call setTexCoordArray unless you want to assign a different array. I don't quite recall if you need to set the datavariance

[osg-users] Why is setTexCoordArray(0, texcoords) needed if array is modified in-place

2016-07-07 Thread Florian Castellane
Greetings fellow OSG users :) There is a detail in my code that I found disturbing: Code: void applyTextureToCenter( MyNameSpace::SpecificNode* floor ) { MyNameSpace::MyGeode* center = floor->getCenterGeode() ; osg::StateSet* stateSet = center->getOrCreateStateSet() ;