Hello all,

My first post on the new forum, thanks for accepting my request, and for 
the amazing work on OSG over the years.

I intend to use OSG to display the construction sequence of a building site.
Some elements will just appear at a given frame (that's easy), but others 
I'd like to appear progressively.

I don't mean that they will "move" to their destination, but rather, that 
they will be partially visible in their final position as if being 
partially clipped, until they are entirely visible:

[image: Clipping.svg.png]

Since timing will be different for each object, a few clipping planes would 
not be enough. 

>From what I read, it should be possible to use the fragment shader to cut 
elements fairly arbitrarily. 

I've got a couple of questions:

1) Is it possible to use fragment shaders to cut objects at a custom 
distance from a shared reference plane (the distance should be independent 
for each object, see hA and hB in the image above)?

2) What path would you suggest me to attempt? Is gl_ClipDistance the right 
way to go?
Am I completely wrong thinking of something like:

gl_ClipDistance[0] = dot(u_plane0,vsPos) + *CustomObjectH*;

3) Is the StateSet of an object the right way to pass (and update) a custom 
variable for the fragment shader (i.e. the distance from the reference 
plane)?

Many thanks,
Claudio

-- 
You received this message because you are subscribed to the Google Groups 
"OpenSceneGraph Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/osg-users/9173059e-957c-471c-a71b-f0dd52a1afb0n%40googlegroups.com.
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to