[osg-users] Example with ClipNode not work on iOS

Robert Osfield robert.osfield at gmail.com
Fri Dec 8 01:43:46 PST 2017


Hi Vlad,

osg::ClipNode uses osg::ClipPlane(wrapper around glClipPlane) and
enabling of the fixed function pipeline's support for clip plans.
OpenGL ES doesn't provide support for clip planes, and 2.0 doesn't
have the fixed function pipeline either.

So to implement clipping you'll need to find another approach using a
combination of uniforms and shaders. Off the top of my head I would
look at using fragment shader discard functionality to clip out
fragments using maths internal to the vertex/shader or to use a
multipass approach where you rendered a depth buffer with the
plane/geometry you want to clip with, then test this in the your
fragment shaders.

Cheers,
Robert.

On 6 December 2017 at 09:38, Vlad Domashevich <xerxses182 at gmail.com> wrote:
> Hi, I start work with OSG(OpenSceneGraph) and got some problem on iOS. iOS use OpenGL ES 2.0 and OpenGL ES 3.0 for A7 GPU based devices. I use ClipNode for clipping other object, but it's not work. My code based on example on GitHub: OpenSceneGraph/include/osg/ClipPlane
> Sorry, can not post links..
>
> but I'm not initialise object from file, I use base objects.
>
> I try clip base objects like Geode->ShapeDrawable->Box or Sphere. decorate_with_clip_node method apply for Geode. Can u help me understand why it's not work on iOS or write small example if for iOS need some more code?
>
> Thank you!
>
> Cheers,
> Vlad
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=72543#72543
>
>
>
>
>
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


More information about the osg-users mailing list