Re: [osg-users] svn and git versions builds fail

2016-10-10 Thread Torben Dannhauer
Hi Robert,

The issue is fixed.

Sorry for the noise, it was a malformed VisualStudie project.

Everything works as expected!

Thank you!

Cheers,
Torben

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





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


[osg-users] Weird linker error while building an osg-based app on a virtual machine

2016-10-10 Thread Andreas Goebel
Hi,

sorry, as this is slightly off-topic, but in case someone here has seen
an error like this, this would be really helpful for me.

I develop my osg-based app on windows, but I also compile on linux.

For this I use virtual box with OpenSuSE 13.2 installed in it (with
guest additions for hardware-accelerated graphics).

At the very end of my build-process I get the following linker-error:

*** /var/lib/VBoxGuestAdditions/lib/libEGL.so.1: undefined reference to
`RTAssertMsg1Weak'
*** /var/lib/VBoxGuestAdditions/lib/libEGL.so.1: undefined reference to
`RTErrConvertFromErrno'
*** /var/lib/VBoxGuestAdditions/lib/libEGL.so.1: undefined reference to
`RTMemAllocTag'
*** /var/lib/VBoxGuestAdditions/lib/libEGL.so.1: undefined reference to
`RTAssertShouldPanic'
*** /var/lib/VBoxGuestAdditions/lib/libEGL.so.1: undefined reference to
`RTR3InitDll'
*** /var/lib/VBoxGuestAdditions/lib/libEGL.so.1: undefined reference to
`RTOnceSlow'
*** /var/lib/VBoxGuestAdditions/lib/libEGL.so.1: undefined reference to
`RTMemFree'

I haven´t even used libEGL (but as far as I understand, gtk uses it,
which I use). While this seems to be a bug in virtual box, maybe someone
of you who builds cross-platform like this, too, has seen that error and
knows a solution.

Thanks for reading,

Andreas

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


Re: [osg-users] blending with shader

2016-10-10 Thread Gianni Ambrosio
Hi David,
I'm not able to use the BlendFunct you posted but it seems I can get something 
nice with the following (fragment) shader:

char myBlendingProgram[] =
"uniform float width;\n"
"uniform float height;\n"
"uniform sampler2D sceneTexture;\n"
"uniform sampler2D blendTexture;\n"
"void main(void) {\n"
"   vec2 texCoord = vec2(gl_FragCoord.x/width, gl_FragCoord.y/height);\n"
"   vec4 sceneColor = texture2D(sceneTexture, texCoord);\n"
"   vec4 blendingColor = texture2D(blendTexture, texCoord);\n"
"   gl_FragColor = sceneColor * blendingColor;\n"
"}\n";

Anyway I have some questions.

In your BlendFunct I don't know how you get the "inout vec4 color" parameter. I 
guess it's something like "sceneColor" in my shader. But I would like to know 
the proper way you suggest to get it.

Then,
just like the osgdistortion example, I have the following OSG node structure:


Code:
root (osg::Group)
+--- renderToTextureCamera (osg::Camera)
|  +--- (Scene)
+--- hudCamera(osg::Camera)
   +--- geode (osg::Geode)
  +--- geometry (osg::Geometry)



To the renderToTextureCamera I call:
camera->attach(osg::Camera::COLOR_BUFFER, texture);

While I attach the texture to the geometry with the code:
osg::StateSet* stateset = geometry->getOrCreateStateSet();
stateset->setTextureAttributeAndModes(0, texture, osg::StateAttribute:: ON);
stateset->setMode(GL_LIGHTING, osg::StateAttribute::OFF);

And I attach the shader to the Geode node.

Is it correct to attach the shader to the geode?

Anyway, here is the code I use to attach the shader and related uniforms to the 
geode stateset:


Code:
void OsgPlugin::addShader(osg::Geode* node)
{
osg::StateSet * stateset = node->getOrCreateStateSet();

osg::Program * program = new osg::Program;
stateset->setAttribute(program);
program->addShader(new osg::Shader(osg::Shader::FRAGMENT, 
myBlendingProgram));

stateset->addUniform(new osg::Uniform("width", (float)1280.0));
stateset->addUniform(new osg::Uniform("height", (float)720.0));

osg::ref_ptr< osg::Image> blendingImage = 
osgDB::readImageFile("C:/Users/User/Desktop/temp/blending.png");
osg::Texture2D* texture = new osg::Texture2D(blendingImage.get());
texture->setFilter(osg::Texture2D::MIN_FILTER, osg::Texture2D::LINEAR);
texture->setFilter(osg::Texture2D::MAG_FILTER, osg::Texture2D::LINEAR);

stateset->setTextureAttribute(1, texture);
stateset->addUniform(new osg::Uniform("blendTexture", 1));
}




One note: I have to use 1 as first parameter of setTextureAttribute to make my 
example working (with 0 it didn't work).
On the other hand I was surprised to have a valid sceneTexture in my shader 
without setting it on the stateset of the geode nor adding a uniform for it! 
Can you exaplain me why? I can suppose the TextureAttribute can be inherited 
from the stateset of the related geometry but I can't understand why the 
uniform is not needed.

Moreover, the "sceneTexture" variable I get in the shader is not distorted. In 
fact I used the same code of osgdistortion exampe for the moment where a sort 
of distortion is implemented on the geometry.
If I remove the shader I can correctly see the distortion. Can you explain me 
why please?

I have one more question (problem to solve) but I think that's enough for the 
moment.

Best regards,
Gianni

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





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


Re: [osg-users] Correct creation of the terrain

2016-10-10 Thread Robert Osfield
On 10 October 2016 at 14:47, Nickolai Medvedev  wrote:
> Thanks for councils, Robert. I will try to look for the necessary array of 
> heights in a VPB code.


The first thing you should do is check the over-sampling issue,
messing around with code when it's the input paramters that you are
doing wrong won't fix the actual problem.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Correct creation of the terrain

2016-10-10 Thread Nickolai Medvedev
Thanks for councils, Robert. I will try to look for the necessary array of 
heights in a VPB code.

Good luck!

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





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


Re: [osg-users] Correct creation of the terrain

2016-10-10 Thread Robert Osfield
Hi Nickolia,

I haven't seen VPB generate terrain like this, are you forcing the
height field resolution higher than what VPB chooses by default?  I
say this as this is the type of artefact I'd expect with over
sampling.

As where to modify VPB to add filtering in, I'm afraid I don't recall
off the top of my head, it's been a number of years since I worked on
it.  Do a search for HeightField in the code.

However, if it's just a sampling artefact I would suggest just let VPB
decide what is the appropriate resolution for the input data and see
what result it comes up with.

Robert.


On 10 October 2016 at 13:44, Nickolai Medvedev  wrote:
> Hi again, Robert.
>
> All sense in "roughnesses":
>
> __ __
>|_  \
>   |_   must be  \
>  |__ \__
>
>|   |
>  VPBWith Box Filter
>
>
> I would like to insert Box Filter into the VPB code.
> I would like to know, where to take float array of heights values, before 
> creation of geometry to pass them through box filter for smoothing of 
> roughnesses.
>
> P.S. Sorry, Robert, i badly know English, therefore me it is difficult to 
> express my thoughts. I hope, you understood something...
>
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=68943#68943
>
>
>
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] svn and git versions builds fail

2016-10-10 Thread Torben Dannhauer
Hi Robert,

yes I build it as usual. Maybe they changes things on their side, will look 
into it again. thanks!

Cheers,
Torben

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





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


Re: [osg-users] GUIEventHandler called twice - possible bug(s)

2016-10-10 Thread Robert Osfield
Hi Riccardo,

On 10 October 2016 at 12:17, Riccardo Corsi  wrote:
> both double call and crash fixed on my side as well.

Good to hear things are now resolved.

> Now that one can safely implement a callback by deriving directly from
> osg::Callback, I think most users should go that way for their new code.
> If that's the case, the not-very-intuitive path of implementing operator()
> rather than run() in the NodeCallback should be a minor issue.

Yep, have to agree it's a bit convoluted having the old API's around.

> Maybe a note in the comments suggesting to derive from osg::Callback rather
> than the legacy classes could be worth it?

The subclasses still have an advantage that they often adapt the
parameters to something easier to work with in the context of the
subclass. Using osg::Callback can require a bit more legwork to cast
types.

As a general rule, subclassing from osg::Callback is what I'd prefer.

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


Re: [osg-users] GUIEventHandler called twice - possible bug(s)

2016-10-10 Thread Riccardo Corsi
Hi Robert,

both double call and crash fixed on my side as well.

Now that one can safely implement a callback by deriving directly from
osg::Callback, I think most users should go that way for their new code.
If that's the case, the not-very-intuitive path of implementing operator()
rather than run() in the NodeCallback should be a minor issue.

Maybe a note in the comments suggesting to derive from osg::Callback rather
than the legacy classes could be worth it?

Thank you,
Riccardo






On Thu, Oct 6, 2016 at 7:30 PM, Robert Osfield 
wrote:

> Hi Riccardo,
>
> I have found the cause of the double call, fixed it and have now
> checked in this fix and the other fixes to event callback handling.
> Changes checked into OSG git master.
>
> Could you test them out on your application to make sure that things
> are now behaving themselves.
>
> Thanks,
> Robert
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] bug: new OpenSceneGraph-3.5.5 threading...

2016-10-10 Thread Christian Buchner
I can suggest three possible fixes in order of descending "cleanliness"

1)
You can tag your application using an application manifest that tells
Windows that the application
is DPI aware and handles all the scaling itself.

2)
Another possible fix is to force compatibility scaling individually per
executable in the Compatibility tab of the
Application properties ("Tell Windows not to scale an app that's not
DPI-aware")
https://technet.microsoft.com/en-us/library/dn528847.aspx?f=255=-2147217396

3)
Another possible fix is to tell Windows 10 to use a custom scaling of 100%
on your affected display
(Option #2 To Set Custom DPI Scaling Level for All Displays in Control
Panel)
http://www.tenforums.com/tutorials/5990-dpi-scaling-level-displays-change-windows-10-a.html


#3 might be quickest, but affects all applications
#2 has to be reapplied on every compilation of your binary
#1 seems to be the preferred solution because it sticks with the
application as it is applied on compilation

Christian


2016-10-08 23:25 GMT+02:00 Robert Osfield :

> Hi Li,
>
> I'm not a Windows expert so can't provide answers on Windows specific
> issues like this.  My guess Windows 10 has introduced some form of
> window scaling that the osgViewer isn't yet aware of so doesn't take
> account of.  To resolve this issue will require a Windows 10 dev to
> dive in an investigate.
>
> Robert.
>
> On 8 October 2016 at 18:31, Li Chi  wrote:
> > Hi,
> >
> > I tested the newest code, it works perfectly, thank you very much.
> >
> > Just another problem:
> > Under the windows 10 OS (may be other OS has the same result), when
> screen's TEXT SIZE isn't 100% (my computer's setting is 150%), the
> osgViewer.exe's full screen mode works a little odd. It just like some of
> the screen content is cutted, please see the attached screenshot picture.
> >
> > Thank you!
> >
> > Cheers,
> > Li
> >
> > --
> > Read this topic online here:
> > http://forum.openscenegraph.org/viewtopic.php?p=68915#68915
> >
> >
> >
> >
> > Attachments:
> > http://forum.openscenegraph.org//files/screenshot_970.jpg
> >
> >
> > ___
> > osg-users mailing list
> > osg-users@lists.openscenegraph.org
> > http://lists.openscenegraph.org/listinfo.cgi/osg-users-
> openscenegraph.org
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] svn and git versions builds fail

2016-10-10 Thread Robert Osfield
Hi Torben,

Thanks for updating the 3rd party dependencies.

It looks like the new giflib.lib has added external dependency that
would provide the reallocarray, I'm afraid I don't know what this
might be, the gif developers will be the ones who know about this.

Did you build giflib yourself?

Robert.

On 10 October 2016 at 09:09, Torben Dannhauer  wrote:
> Hi robert,
>
> I'm working on a new release of the windows 3rdParty package.
>
> The gif plugin makes still problems. It compiles well ,but throws errors 
> while linking..
>
> error LNK2019: Unresolved external symbol "reallocarray" in function 
> "DGifSlurp".   
> D:\OpenSceneGraph\OpenSceneGraph-trunk_x64\src\osgPlugins\gif\giflib.lib(dgif_lib.obj)
> error LNK2001: Nicht aufgelöstes externes Symbol "reallocarray".
> D:\OpenSceneGraph\OpenSceneGraph-trunk_x64\src\osgPlugins\gif\giflib.lib(gifalloc.obj)
>
> The used giflib is 5.1.4, the current stable release.
>
> any ideas?
>
> Thanks,
> Torben
>
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=68926#68926
>
>
>
>
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Correct creation of the terrain

2016-10-10 Thread Robert Osfield
Hi Nickolai,

On 10 October 2016 at 06:20, Nickolai Medvedev  wrote:
> Where in VirtualPlanetBuilder i can get float array of the heights to process 
> it in the BoxFilter?

I can't make any sense of what you are after given the context of
VirtualPlanetBuilder.  VPB is a standlone tool that you run on your
DEMS and geospatial imagery to generated a paged database, you don't
typically go modifying it's data as it builds.

Are you modifying VPB or is that you are just doing post processing on
the OSG paged database that it generates?

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


Re: [osg-users] svn and git versions builds fail

2016-10-10 Thread Torben Dannhauer
Hi robert,

I'm working on a new release of the windows 3rdParty package.

The gif plugin makes still problems. It compiles well ,but throws errors while 
linking..

error LNK2019: Unresolved external symbol "reallocarray" in function 
"DGifSlurp".   
D:\OpenSceneGraph\OpenSceneGraph-trunk_x64\src\osgPlugins\gif\giflib.lib(dgif_lib.obj)
error LNK2001: Nicht aufgelöstes externes Symbol "reallocarray".
D:\OpenSceneGraph\OpenSceneGraph-trunk_x64\src\osgPlugins\gif\giflib.lib(gifalloc.obj)

The used giflib is 5.1.4, the current stable release.

any ideas?

Thanks,
Torben

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





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