Re: [osg-users] Non-convex polytope picking

2017-09-14 Thread tianzjyh
Hi, Antoine, 
   Yes, I think so, you have to split the non-convex polygon. Convex polygon is 
convenient to do point-containing test since it is just an AND-combination of 
half-space. But non-convex polygon is not that simple.





--





Cheers, 
---
TianZJ



At 2017-09-15 01:34:44, "Antoine Rennuit"  wrote:
>Dear OSG forum,
>
>I am currently using PolytopeIntersector with rectangular polygons for 
>picking. I am thinking of extending this selection mode with polygons than 
>could potentially be complex, non-convex for instance (e.g. polygons resulting 
>from hand drawn areas).
>
>Now I understand that the osg::Polytope class can only handle convex polygons.
>
>Does that mean that if I want to pick using non-convex polygons I need to 
>split my non-convex polygon into multiple convex osg::Polytopes and call the 
>IntersectionVisitor multiple times? Is this handled in OSG? Are there helpers 
>or should I do all this on the app side?
>
>Kind regards,
>
>Antoine.
>
>--
>Read this topic online here:
>http://forum.openscenegraph.org/viewtopic.php?p=71725#71725
>
>
>
>
>
>___
>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] Raytraced shader code

2017-09-14 Thread Clement.Chu
Hi all,

   I am using volume rendering with ray traced technique.  I saw black color 
along the edge of image.  I checked the shader code.  There is a variable 
called fragColor and initial value is set to  vec4(0.0, 0.0, 0.0, 0.0);.  I 
would like to know why this value is using black on initial.  Should we use 
background colour for the initial?  Thanks.


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


Re: [osg-users] Mirror transformation

2017-09-14 Thread Ale Maro
Hi Robert,

I tried to simplify the scene graph (no shadow, effects, textures, shaders...) 
and the problem was still there.
I originally disabled back face culling since I have 2-sided lighting with 
different material.

So I supposed it is the expected behaviour for mirrored nodes and I try add 
some code to adjust the result.

With mirroring the direction of face normals changes so I first tried to update 
all normals (hoping they are also used to distinguish front and back face) but 
it did not work.
I thought to revert all faces directions changing primitive sets but this means 
to change the geometry and it is not so straightforward.

Reverting faces using statesets works fine 
it is not ideal becouse I always need to check the matrix and also I need to 
recourse all children of a mirrored node to apply the FrontFace state (becouse 
children can have a transformation that reset the mirroring).

If you have any other suggestion please let me know.

I will also go in depth with your suggestion to use a multipass shader to avoid 
multiple effect groups. Thank you.
I still have some issues with multipass shaders due to interaction with Qt... 
but I will try to go to this direction.

Ale

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





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


Re: [osg-users] Executing subtree multiple times / repeater node?

2017-09-14 Thread Robert Osfield
Hi Antiro,

If you just want to render whole subgraphs subgraph multiple times then a
cull callback can be used, or have a custom node override traverse() and
handle the CullVisitor as a special case and traverse the subgraph multiple
times.  When you use this approach you will typically alter the rendering
for each pass by pushing/popping StateSet or other controls onto the
CullVisitor to specialize the rendering state for each pass.

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


Re: [osg-users] Executing subtree multiple times / repeater node?

2017-09-14 Thread Julien Valentin
I don't think there's a builtin/elegant solution for this in osg
What I did for the purpose of iterative algorithms with pingpong FBO I did 
smething like this

Code:
class FBOWritter public Geometry{
void setFBO(FrameBufferObject);
void setPingPongTexture(Texture*,texture*);
void setHalfPassCount()
draimplementation(){
state.bind(fbo)
for(i in 0..halpasscount){
fbo.framebuffertexture(pingpong[1])
Geometry::drawimplementation()
fbo.framebuffertexture(pingpong[0])
Geometry::drawimplementation()
}
}
};



And I put this FBOwritter as Child as a camera2FBO.
It avoid the requirement of multiple camera setup and so work pretty great but 
don't know if there's a better alternative..
Cheers


antiro42 wrote:
> Hi,
> 
> I am implementing a Gaussian blur effect by alternating between a horizontal 
> and a vertical blur shader (in the implementation they are the same shader, 
> switching based on a uniform).
> 
> In OSG I managed to implement this by adding the two shaders to geometry 
> nodes containing a screen sized quad and having the camera configured for 
> rendering to a texture. To get the best looking effect I want to execute this 
> pair of shaders several times in a single frame. I can of course add the pair 
> of nodes to the scene graph multiple times, but there must be a more elegant 
> solution:
> 
> Is there some kind of "repeater" node which simple executes its subtree 
> multiple times?
> 
> If not, how would I implement such a node? Should I write a new traverse 
> method? How to handle the different kinds of visitors?
> 
> Thank you!
> 
> Cheers,
> antiro


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





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


[osg-users] Executing subtree multiple times / repeater node?

2017-09-14 Thread antiro black
Hi,

I am implementing a Gaussian blur effect by alternating between a horizontal 
and a vertical blur shader (in the implementation they are the same shader, 
switching based on a uniform).

In OSG I managed to implement this by adding the two shaders to geometry nodes 
containing a screen sized quad and having the camera configured for rendering 
to a texture. To get the best looking effect I want to execute this pair of 
shaders several times in a single frame. I can of course add the pair of nodes 
to the scene graph multiple times, but there must be a more elegant solution:

Is there some kind of "repeater" node which simple executes its subtree 
multiple times?

If not, how would I implement such a node? Should I write a new traverse 
method? How to handle the different kinds of visitors?

Thank you!

Cheers,
antiro

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





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


Re: [osg-users] [osganimation branch] Review, test, critics

2017-09-14 Thread Dario Minieri
Hi,

I post my request here because osgAnimation related.

There is some examples/possibility to blend two animations? So, make the 
transition from an animation to another in a smooth way?

Thank you!

Cheers,
Dario

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





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


Re: [osg-users] osgconv "noTriStripPolygons" give tri. fans only

2017-09-14 Thread Kari Ringdal
Hi Robert,

Thank you for your answer! 

I have the same problem when viewing a simple model in osgviewer. I've included 
screenshots of the stats with and without the noStripPolygons option. The 
vertex count is 3241 with no options and 18960 with the option.

I use this model:
graphics.stanford.edu/courses/cs148-10-summer/as3/code/as3/teapot.obj

My OSG-3.4.1 was built on Windows 7 x64 with Visual Studio 2010.


Kari

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




Attachments: 
http://forum.openscenegraph.org//files/notristrippolygons_209.png
http://forum.openscenegraph.org//files/nooptions_157.png


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


[osg-users] Automated builds of 3rdParty libraries

2017-09-14 Thread Björn Blissing
Hi,

I have been successful in completely automating the builds of 3rdParty 
libraries for Visual Studio. This is done using the continuous delivery service 
AppVeyor.

This means that there will be updated prebuilt versions of the 3rdParty 
libraries available to download for different versions of Visual Studio 
(currently 2015 and 2017; both 32-bit and 64-bit). These will be automatically 
rebuilt every time the GitHub repository is updated and the latest successful 
builds will available as download links on the readme page at:
https://github.com/bjornblissing/osg-3rdparty-cmake

The builds currently contain: zlib, libpng, libjpeg, libtiff, FreeType, GLUT, 
GIFLIB, MINIZIP and cURL.

Hopefully this will help others who need prebuilt 3rd party libraries.

If any of you are missing a certain library, please fork the GitHub repository 
and try to add it and then send me a pull request. Or you could add a request 
for a library as an issue in the issue tracker on GitHub.

Regards,
Björn

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





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


Re: [osg-users] Mirror transformation

2017-09-14 Thread Robert Osfield
Hi Ale,

On 13 September 2017 at 16:51, Ale Maro  wrote:

> I use this scene graph structure to set some standard rendering features
> to scene objects... so it is not easy to change it for me.
> Anyway I tried to export the scene in osg format and change manually all
> groups that can give problems (clipnode, outline, shadow) to simple "Group".
> After loading the modified file with osgviewer the result is the same the
> object is black.
> I see now that moving the object (so light intersect the object with a
> different angle) the object is still dark but I can see the interior
> material (instead of exterior one)
>
> So I guess if the solution is to reverse vertices, normals and primitive
> set or do you expect it works just using transformations?
>

I can only speculate on what the problem you are having is, it's really
open ended as you've put together some many different effects.  You can see
things first hand and are best place to work this out.  It could be
lighting, it could be back face culling, it could be an interaction with
the depth texture or shaders.

With convoluted combinations like these I generally find it's best to take
a big step back and try to work out what effects you are trying to achieve
and then work out what technique is most appropriate rather than try to fix
and convoluted and possibly misguided approach.

I expect the best solution for your applicaton is not to combine
ClipNode/osgShadow and osgFX all together, but to come up with your own
custom shader and multipass approach.  This might require a bit more intial
understanding of shaders and rendering techniques but will provide much
greater flexibility, performance and maintainability long term.

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


Re: [osg-users] Mirror transformation

2017-09-14 Thread Ale Maro
Hi,

yes, I can have mirror on each axis so I have already implemented a check 
similar to the one you suggested.
Thank you for the clarification.

Ciao,
Ale

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





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