Re: [osg-users] Shadow mapping, multiple lights

2013-11-07 Thread Robert Osfield
Hi Mustafa, The ViewDepedentShadowMap implementation has the beginnings of multiple light support but it isn't yet complete. The basic infrastructure for generating multiple shadow map texture is there, but the final bits that tie together like shaders and management aren't there yet. Robert.

Re: [osg-users] OSG Qt integration and thread safety

2013-11-07 Thread Trajce Nikolov NICK
Hi Jan, Your approach isn't safe. OSG is *not threadsafe*. Or, rather, it is not threadsafe from arbitrary modifications. If you want to be safe, the only time when modifications to the scene graph may happen is before or after the frame() is invoked, not while frame() is running. On Wed, Nov

Re: [osg-users] OSG Qt integration and thread safety

2013-11-07 Thread Trajce Nikolov NICK
Hi Jan, You can modify the scenegraph in the update traversal as well. Like I did in the TerraPage (txp) loader. In the Cull traversall I collect info for what is to be modified and then in the update traversal I update the scenegraph safely. Just a note Nick On Thu, Nov 7, 2013 at 9:33 AM,

Re: [osg-users] OSG Qt integration and thread safety

2013-11-07 Thread Deniz Koçak
Hi Trajce, I think Jan's answer [1] in the first mail mentions a similar solution. Setting a flag (by using userdata of the drawable may be) and updating the drawable in the osg::Drawable::UpdateCallback (of course by checking the flag) MAY solve the problem. It seems that, thrusting the Qt's

Re: [osg-users] OSG Qt integration and thread safety

2013-11-07 Thread Trajce Nikolov NICK
Hi Deniz, yes I read Jan has mentioned this. Have a look in the osgdb_txp loader in TXPNode::traverse() for inspiration if helps a bit Nick On Thu, Nov 7, 2013 at 9:40 AM, Deniz Koçak lend...@gmail.com wrote: Hi Trajce, I think Jan's answer [1] in the first mail mentions a similar

Re: [osg-users] OSG Qt integration and thread safety

2013-11-07 Thread Deniz Koçak
Thank you Trajce. On Thu, Nov 7, 2013 at 10:59 AM, Trajce Nikolov NICK trajce.nikolov.n...@gmail.com wrote: Hi Deniz, yes I read Jan has mentioned this. Have a look in the osgdb_txp loader in TXPNode::traverse() for inspiration if helps a bit Nick On Thu, Nov 7, 2013 at 9:40 AM, Deniz

Re: [osg-users] Is it possible to use EffectCompositor to describe effects per object?

2013-11-07 Thread michael kapelko
Hi. I decided to go with single pipeline that provides big shaders and objects using own uniforms and textures to change the pipeline behaviour. I started to design a simple material format so that it resembles the one of EffectCompositor. Thanks. 2013/10/31 michael kapelko korn...@gmail.com

Re: [osg-users] OSG Qt integration and thread safety

2013-11-07 Thread Jan Ciger
Hi, On Thu, Nov 7, 2013 at 9:35 AM, Trajce Nikolov NICK trajce.nikolov.n...@gmail.com wrote: You can modify the scenegraph in the update traversal as well. Like I did in the TerraPage (txp) loader. In the Cull traversall I collect info for what is to be modified and then in the update

Re: [osg-users] OSG Qt integration and thread safety

2013-11-07 Thread Jan Ciger
On Thu, Nov 7, 2013 at 9:40 AM, Deniz Koçak lend...@gmail.com wrote: It seems that, thrusting the Qt's Signal/Slot mechanism is not a good option as Jan pointed. I think the trouble is that you are expecting it to do something that it isn't meant to do. Perhaps you have confused the

Re: [osg-users] Drawing lines using OpenGL ES 2.0

2013-11-07 Thread deniz diktas
Hi, you are outputting the position as color, that's why you see black (because these have negative coordinate values) and the three values. Just set an arbitrary fixed color value in the frag-shader to see anything. But if you need to see colors, then you need to define your own vertex

Re: [osg-users] Is it possible to use EffectCompositor to describe effects per object?

2013-11-07 Thread Sebastian Messerschmidt
Hi Michael, I solved a similar problem by overriding osg::Program which composes a shader from an Ubershader. This is not done via uniforms but defines. It seems to work somehow and improved the performance over branching based on uniforms. Hi. I decided to go with single pipeline that

Re: [osg-users] Is it possible to use EffectCompositor to describe effects per object?

2013-11-07 Thread michael kapelko
Hi, Sebastian. So you compose one shader per object? Thanks. 2013/11/7 Sebastian Messerschmidt sebastian.messerschm...@gmx.de Hi Michael, I solved a similar problem by overriding osg::Program which composes a shader from an Ubershader. This is not done via uniforms but defines. It seems

Re: [osg-users] Is it possible to use EffectCompositor to describe effects per object?

2013-11-07 Thread Sebastian Messerschmidt
Am 07.11.2013 12:55, schrieb michael kapelko: Hi, Sebastian. So you compose one shader per object? No, one program per define-set (e.g. #define NORMAL_MAPPING,#define PARALLAX_MAPPING, ...) The idea is not to compose the shader from functional blocks, but to write one shader containing all

Re: [osg-users] Is it possible to use EffectCompositor to describe effects per object?

2013-11-07 Thread michael kapelko
Can you please provide an example of how an object manages its define-set? In my case, I simply get the object's StateSet and setup uniforms. But I don't get how to setup defines. Thanks. 2013/11/7 Sebastian Messerschmidt sebastian.messerschm...@gmx.de Am 07.11.2013 12:55, schrieb michael

Re: [osg-users] Is it possible to use EffectCompositor to describe effects per object?

2013-11-07 Thread Sebastian Messerschmidt
As this is company code and part of a bigger framework I can only give you some hints. I have a custom shader loader which parses the shader source in order to later add the defines and creates a osg::Program derived class e.g. CustomProgram. In GLSL you can use preprocessor macros like in

Re: [osg-users] Is it possible to use EffectCompositor to describe effects per object?

2013-11-07 Thread michael kapelko
I was thinking of creating some sort of material.xml and assign it to each object (or a group of objects). As far as I understand, the define approach creates one shader per object eventually. And that turns out to be faster than one shader per pipeline with different StateSets and uniforms per

Re: [osg-users] Is it possible to use EffectCompositor to describe effects per object?

2013-11-07 Thread Sebastian Messerschmidt
Am 07.11.2013 14:04, schrieb michael kapelko: I was thinking of creating some sort of material.xml and assign it to each object (or a group of objects). You could totally do this. So material.xml could contain the defines. As far as I understand, the define approach creates one shader per

Re: [osg-users] Drawing lines using OpenGL ES 2.0

2013-11-07 Thread John Moore
Actually I solved it... one of the problems was that the number I was using for the attribute was too big (or reserved). I am forced to use OpenGL ES 2.0 because I develop on iOS platform! Thank you anyway for your advice. Cheers, John This is the working code Code: #define

Re: [osg-users] Drawing lines using OpenGL ES 2.0

2013-11-07 Thread John Moore
I want to add that this is the fragment shader I used for drawing the wireframe model Code: precision highp float; varying vec3 vBC; #extension GL_OES_standard_derivatives : enable float edgeFactor(){ vec3 d = fwidth(vBC); vec3 a3 = smoothstep(vec3(0.0), d*1.0, vBC); return

Re: [osg-users] Drawing lines using OpenGL ES 2.0

2013-11-07 Thread deniz diktas
Hi, for learning basic shader programming you do not have to constrain yourself to opengl es 2.0. It is sufficient to do the same basic stuff with OGL 3.0 in order at least to understand the difference between assigning a coordinate value and a color value as the final fragment value. I

[osg-users] [linux] OSG + X11 and question about osgViewer

2013-11-07 Thread First Last
                                             « Hi people of OSG mailing list I'm Nicoo, and I come in peace! » well, I try to write a minimal application  using X11 and OSG, I would like to know first if the library osgViewer is something written only to help newcomer. I borrowed a book

[osg-users] blending on multiple targets

2013-11-07 Thread Bram Vaessen
Hi, I ran into something weird, or something that I don't know how it works exactly. What I want to do when rendering to multiple targets is that I selectively write to certain color buffers in my shader, but leave others alone. for example Code: gl_FragData[3] = vec4(0,1,0,1); without

Re: [osg-users] blending on multiple targets

2013-11-07 Thread Sebastian Messerschmidt
Hi Bram, There is nothing weird about what you are seeing given what you're doing. Blending with MRT ist always applied to all bound render targets of the framebuffer object. If you want to blend only a single buffer, then do a separate pass, where you blend it. In case you want to apply