Re: [osg-users] blending with shader

2016-09-30 Thread David Heitbrink
Its kind of tough to say without having a good idea about what exactly you can 
do with your plugin. I can say what you most likely need to do is to bind a 
texture with your blend map to your scene some how.

Ideally you would do this in a 2nd rendering pass. Basically you want to 
perform blending on a final image. 

In your fragment shader you can use gl_FragCoord, this will get you the screen 
coordinate of the current fragment (basically pixel). Then you can use 
texelFetch to lookup a scaler for your output pixel. For example if you had 
this function you called last in your fragment shader:

uniform sampler2D blendTexture;
void BlendFunct(inout vec4 color){
vec4 blendVal = texalFetch(blendTexture,gl_FragCoord.xy,0);
color.rgb = color.rgb * blendVal.rgbl;
} 

In practical terms you often have to deal with the gamma settings for your 
projectors, and things are not always linear. When you have things in your 
scene with transparency were things get blended together, its ideal to do a 
multi-pass rendering.

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=68835#68835





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] What tools do you use

2016-09-30 Thread Andrey Skvortsov

> There are some osg based tools like osgEdit (outdated)


I made some fixes, which allow to build osgedit with OpenSceneGraph 3.4.0.

Thank you!

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=68834#68834





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] OSG Ellipsoid to Sphere Conversion

2016-09-30 Thread Inna Reddy
Hi Mr. Robert, 

It worked for me. I have made Sphere from the osg Geometry. Thanks for the 
suggestion . 

... 

Thank you!

Cheers,
Inna

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=68833#68833





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] blending with shader

2016-09-30 Thread Gianni Ambrosio
Hi All,
I have a projector attached to a PC where a 3rd party application runs. The 3rd 
party application uses OSG 3.0.1 and allows to add custom code re-implementing 
some virtual methods of their base Plugin class.

I need to apply a blending operation to the visualized scene so that the 
projector displays the blended image on the (curved) screen (please see 
attached image). I guess the source image (=image of the scene just like an osg 
viewer does) must be warped also but that's story I will investigate on later.

Even if I have just a rough idea of shaders, as far as I have understood that's 
the way to implement the required blending.

I found several examples in which a shader manipulates the 3D scene but in my 
case I think I have to modify the resulting image of the scene.
Now, it is not clear to me how pass the required informations to the shader 
code and if I can handle the whole rendered image of the scene from the shader 
and how.

Regards,
Gianni

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=68832#68832



___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] multiple input with osgwidgets

2016-09-30 Thread Gianni Ambrosio
Hi Meldryt,
I worked with osgWidget in the past. I move a widget with left_mouse+mouse_move 
and resize it with central_mouse_button+mouse_move.
I also tried to show a contextual menu clicking with right mouse button on it.
Now I'm on OSG 3.4.0 but moved recentrly from OSG 3.0.1.

Could you please just write "one" of the cases not working in your 
implemetation?

Cheers,
Gianni

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=68831#68831





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] different materials for a geometry and highlight

2016-09-30 Thread Gianni Ambrosio
Hi Sebastian,
thanks for the example.

The roads I use may have from 600K to a maximum of 9 milion elements 
(=triangles). Maybe a mean of 2 milions.

Gianni

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=68830#68830





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] multiple input with osgwidgets

2016-09-30 Thread Sebastian Schmidt
bump!
Does anyone else have this issue?

I have no problem when i try to track this event inside my handle function of 
the custom osgGA::StandardManipulator class.

But for my GUI widgets its easier to track this input events just by overriding 
mousePush, mouseDrag, ... events of osgWidget::Input.

So there is this situation when i dont receive mouseDrag event.
1. push left or right mouse button and hold down.
2. now push the other button and release it
3. drag the first button

I use version 3.0.1

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=68829#68829





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org