Re: [osg-users] Uniform arrays.

2012-05-14 Thread Eldar Insafutdinov
lyceel wrote: The problem actually only occurs with recent NVIDIA drivers (older versions didn't have this issue). As David mentioned, the latest SVN and the most recent developer releases also include this workaround, so you won't need to add the [0] yourself if you use one of those.

Re: [osg-users] Uniform arrays.

2012-05-09 Thread Eldar Insafutdinov
Well, adding [0] actually did the trick! Mismatch of the array sizes did not matter in the end(I want to pass arrays of variable length to glsl with sizes up to 20 elements, so that's fine with me). Not sure why my drivers don't work here, I'm on Linux with NVIDIA card and fairly up to date

[osg-users] Uniform arrays.

2012-05-08 Thread Eldar Insafutdinov
Hi I am trying to use uniform arrays with OSG, but it fails. Here are the snippets of code that a'm using: Code: osg::StateSet *ss = node-getOrCreateStateSet(); // one way of populating uniform array that I tried for(int i = 0; i sz; ++i) { char buf[30]; sprintf(buf,

[osg-users] How to apply setUseModelViewAndProjectionUniforms to the scene

2012-04-04 Thread Eldar Insafutdinov
Hi I switched to using osg_* variables in my shaders instead of built-in gl_* in order to comply with with OpenGL 3.x/ OpenGL ES 2.0. However it doesn't seem to work for me I found that it's managed by the State class, and I can obtain the state object from the GraphicsContext. however a code

Re: [osg-users] How to apply setUseModelViewAndProjectionUniforms to the scene

2012-04-04 Thread Eldar Insafutdinov
Thanks, Robert, that did the trick! However after setting UseVertexAttributeAliasing parameter I got another problem - the surface nodes that don't use any shaders (I keep them as a fallback option) are broken now - textures are not applied to them anymore. Is there a way to both use new style

Re: [osg-users] Nodes in osg::Group affect each other's state.

2012-03-22 Thread Eldar Insafutdinov
Hi Robert, Thanks for explanation, the only thing is that in this case I'm applying a texture to the node, and I thought that will somehow override the colour settings and I wouldn't need to specify any colours. Cheers, Eldar -- Read this topic online here:

Re: [osg-users] Nodes in osg::Group affect each other's state.

2012-03-20 Thread Eldar Insafutdinov
Hi I was able to find a workaround to this problem by adding an overall white colour to the textured quad Code: osg::ref_ptrosg::Vec4Array colors = new osg::Vec4Array; colors-push_back(osg::Vec4(1.0f, 1.0f, 1.0f, 1.0f)); // needs to be white! geom-setColorArray(colors.get());

[osg-users] Geometry object shared by multiple Nodes.

2012-03-20 Thread Eldar Insafutdinov
Hi, I am trying to reuse Geometry objects between multiple osg::Node instances and apply geometry shader to reposition them. On the attached testcase I tried to implement this. The first osg::Node instance uses unmodified Geometry, and the second one uses vertex shader to shift the quad

Re: [osg-users] Geometry object shared by multiple Nodes.

2012-03-20 Thread Eldar Insafutdinov
Thanks, Glenn. I now think it really is the case, because if I position 2 geometries close enough, the second one isn't truncated. I will investigate in details the CullSettings class. Cheers, Eldar -- Read this topic online here:

Re: [osg-users] Geometry object shared by multiple Nodes.

2012-03-20 Thread Eldar Insafutdinov
There's actually one more question I intended to ask: in case of sharing a Geometry object through the API does it actually create only one instance of it on the graphics card side? The whole reason I use this trick to save both systems and graphics memory. Cheers, Eldar --

[osg-users] Nodes in osg::Group affect each other state.

2012-03-16 Thread Eldar Insafutdinov
Hi all, I am new to OSG, so maybe my question is silly, but I'm trying to apply some little knowledge on how scene graphs should work here. I've managed to reduce the problem I have to a reasonably sized testcase which I attached to the post. I have two nodes there: a quad with a texture