Re: [osg-users] Geometry shader based apps/examples have shader compile failures...

2015-07-24 Thread Sebastian Messerschmidt

Hi Mark,

If a shader gets compiled correcty has nothing to do with osg. You 
probably updated your driver recently. NVidia decided to follow the GLSL 
grammar more strictly.
For instance code like float x = vec2(1) is not working anymore, since 
implicit conversion of types is not allowed in GLSL. So try to fix your 
shaders with that in mind.
BTW: I'm using GPU ShaderAnalyzer[1] by AMD  to validate my shader code, 
as it seems to be awfully strict ;-)


Cheers
Sebastian

[1]
http://developer.amd.com/tools-and-sdks/graphics-development/gpu-shaderanalyzer/

Hello,

I am using OSG ver 3.4.0-Rc1 under Window 8.1, Visual Studio 2012 Win64. NVidia 
laptop driver Ver: 353.30.

Of-late, I started noticing strange geometry shader compile failures with 
applications that worked perfectly (in 3.2) after I switched to osg 3.4.0-rc1.

First-of, my own application that has one geometry shader (#version 400) that is 
ending up with compile errors, and then I see corrupt source string in 'src' when 
I did std::string src = geomObject-getShaderSource();

Variables uv, normal are correctly declared but the error log says -
GEOMETRY glCompileShader  FAILED
GEOMETRY Shader  infolog:
ERROR: 0:64: 'uv' : undeclared identifier
ERROR: 0:64: 'assign' :  cannot convert from '2-component vector of float' to 
'float'
ERROR: 0:72: 'normal' : undeclared identifier
ERROR: 0:72: 'assign' :  cannot convert from '3-component vector of float' to 
'float'

iow, original shader code says:
out vec2 uv;
out vec3 normal;

and geomObject-getShaderSource() says:
out vec2 uv;mal;

The shader source is in a text file and is read using
osg::ref_ptrosg::Shader geomObject = 
osg::Shader::readShaderFile(osg::Shader::GEOMETRY, gsFilename.txt);

Then, I also see similar geometry shader compile failures with examples such as 
osgForest, osgSSBO, osgTessellationShader...

I am not sure what is going on. Any help here is sincerely appreciated.

Thanks, Regards,
-Mark

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





___
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] What is the difference of adding an additional camera as child or slave

2015-07-24 Thread Werner Modenbach

Dear OSG users,

can someone give me an explanation about the difference in:

view-addSlave(camera.get(),true);

and

view-getCamera()-addChild(camera.get());

Many thanks in advance

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


Re: [osg-users] OpenSceneGraph-3.4.0 release candidate 7 tagged

2015-07-24 Thread Pjotr Svetachov
The changed for VS2015 look good. I still get the following warning:
3I:\Libraries\OpenSceneGraphTrunk\include\osg/GraphicsThread(45): warning 
C4589: Constructor of abstract class 'osg::GraphicsOperation' ignores 
initializer for virtual base class 'osg::Referenced' (compiling source file 
I:\Libraries\OpenSceneGraphTrunk\src\osg\TextureCubeMap.cpp)
3  I:\Libraries\OpenSceneGraphTrunk\include\osg/GraphicsThread(45): note: 
virtual base classes are only initialized by the most-derived type (compiling 
source file I:\Libraries\OpenSceneGraphTrunk\src\osg\TextureCubeMap.cpp)
3  I:\Libraries\OpenSceneGraphTrunk\include\osg/GraphicsThread(45): note: This 
diagnostic occurred in the compiler generated function 
'osg::GraphicsOperation::GraphicsOperation(const osg::GraphicsOperation )' 
(compiling source file 
I:\Libraries\OpenSceneGraphTrunk\src\osg\TextureCubeMap.cpp)

But according Microsoft it's a vs2015 bug that will be fixed in the next update 
(https://connect.microsoft.com/VisualStudio/feedback/details/1570496/vs-2015-generates-a-copy-constructor-and-then-complains-about-it)

Btw VS2015 now also warns when a variable is shadowing another one, this 
amounts to over 600 warnings. In gcc or clang you can probably turn them on 
with -Wshadow. Some of them are in osg core, I'll look into those when I get 
back from vacation.

Cheers,
Pjotr

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





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


Re: [osg-users] [ANN] View-dependent progressive meshes on OpenSceneGraph

2015-07-24 Thread michael kapelko
Yep, give us the code, otherwise this never happened.

2015-07-23 18:42 GMT+07:00 Sebastian Messerschmidt 
sebastian.messerschm...@gmx.de:

 Am 23.07.2015 um 12:37 schrieb Jim Tan:

 View-dependent progressive meshes on OpenSceneGraph

 Hello dear OSG-community,

 I have implemented Hoppe's view-dependent progressive meshes related
 technology on OpenSceneGraph.

 Great work.


 Viewer  convert tool can be find in my blog: jimtan0805 dot blogspot dot
 tw

 Interested in VDPM technology is welcome to discuss with me.

 Any chance we can get the imlementation? This would be a useful asset for
 creating seamless LOD.

 Cheers
 Sebastian


 Best regards,
 Jim

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





 ___
 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] ClipNode Opposite Behavior

2015-07-24 Thread Christian Buchner
I believe your fragment shader is not setting the output fragment color at
all, which is a minimum requirement for a fragment shader to work.

Christian


2015-07-23 23:59 GMT+02:00 Erik Hensens ehens...@hunter.com:

 Sorry for the triplicate post, I received an error message on trying to
 post until I removed the quotes...

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





 ___
 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] what's wrong with removechild

2015-07-24 Thread LUO Jianguo
Hi,

I want to pick one node using mouse. then the node deleted. but I failed. I 
don't know why. the nodepick.h attached.

the osg::Node* pNode can be picked. and it can be changed to red.

but the following mViewer-getSceneData()-asGroup()-removeChild(pNode); 
failed. 

I also used m_Rt-removeChild(pNode); failed again. 

So puzzled. help me plz.


Thank you!

Cheers,
LUO

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




Attachments: 
http://forum.openscenegraph.org//files/nodepick_135.h


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


Re: [osg-users] ClipNode Opposite Behavior

2015-07-24 Thread Erik Hensens
Thanks Christian. It's funny you mention that because since I'm not setting the 
color, the quad looks like an old television tuned to a frequency not in 
service, i.e. static or snow. I think every time the quad is rendered each 
fragment's color is set to whatever value is in some uninitialized portion of 
memory, and each fragment changes color each time it is rendered. Quite a funny 
effect!

I added the following line to set the color, and now it is always blue, but 
it's still not putting a hole in my quad, it's all there or all gone depending 
on whether I say if (fDist  rad) or if (fDist  rad):


Code:

// The fragment shader program source code
std::string szFragSource(
uniform vec3 center;\n
uniform float rad;\n
void main()\n
{\n
float fDistX = gl_FragCoord.x - center.x;\n
float fDistY = gl_FragCoord.y - center.y;\n
float fDistZ = gl_FragCoord.z - center.z;\n
float fDist = sqrt(fDistX * fDistX + fDistY * fDistY + fDistZ * fDistZ);\n
gl_FragColor = vec4(0.0,0.0,1.0,1.0);\n
if (fDist  rad) discard;\n
}\n
);




Any other ideas about why my code doesn't achieve what I want? For example, am 
I using gl_FragCoord correctly? Are there other errors in my frag source?

Thanks again!


cbuchner1 wrote:
 I believe your fragment shader is not setting the output fragment color at 
 all, which is a minimum requirement for a fragment shader to work.
 
 
 Christian
 
 
 
 2015-07-23 23:59 GMT+02:00 Erik Hensens  ():
 
  Sorry for the triplicate post, I received an error message on trying to 
  post until I removed the quotes...
  
  --
  Read this topic online here:
  http://forum.openscenegraph.org/viewtopic.php?p=64458#64458 
  (http://forum.openscenegraph.org/viewtopic.php?p=64458#64458)
  
  
  
  
  
  ___
  osg-users mailing list
   ()
  http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org 
  (http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org)
  
  
  
 
 
  --
 Post generated by Mail2Forum


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





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


Re: [osg-users] I created 10000 cylinder, osg run very slow

2015-07-24 Thread LUO Jianguo
Yeah, it's not ladder. It's cable tray in the power plant. . In fact, I used 
not more than 1000 cylinders, osg runs very slow. I ignore the cylinders, it 
gets much faster.

then I have to disable shadow,
osg::ref_ptrosgShadow::SoftShadowMap  ssm = new osgShadow::SoftShadowMap;
//  float bias = ssm-getBias();
//  ssm-setBias(bias*2.0);
//  mShadowedSceneRoot-setShadowTechnique(ssm.get());
//  
mShadowedSceneRoot-setReceivesShadowTraversalMask(ReceivesShadowTraversalMask);
//  
mShadowedSceneRoot-setCastsShadowTraversalMask(CastsShadowTraversalMask);

the program runs fast again.

So I enable shadow again, and disable the cylinders // 
setNodeMask(CastsShadowTraversalMask);
the program still slow.

Maybe I can't draw my power plant prefectly, without shadow.

And would you please answer my another question in the other article, it's 
still about the power plant. thanks.

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




Attachments: 
http://forum.openscenegraph.org//files/cabletray_292.jpg


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


[osg-users] How to delete Node from the root

2015-07-24 Thread LUO Jianguo
Hi,

I use addchild to create root tree.
Yeah, we can use removechild to pruning. But the removed node is still in the 
memory.
I wonder how i can delete it totally from the memory.
We can get any node using computeIntersections(x,y,intersections).
We got the osg::Node *node, then free(node), the node is null. but we new many 
kinds of objects when new node, e.g., osg::Image image, osg::Texture2D 
texture, osg::ShapeDrawable doorShape and so on.
how can i delete these pointers. 
Need I create free function for each node?
 
Thank you!

Cheers,
LUO

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





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