[osg-users] ClipNode Opposite Behavior

Christian Buchner christian.buchner at gmail.com
Thu Jul 23 01:59:58 PDT 2015


For creating a circular hole into a plane, clip planes indeed will not
work. But generally speaking, flipping a clipping plane reverses its effect
(boolean negation)

To punch holes in arbitrary geometry at render time, a fragment shader will
be a good solution.

You can check either object or world coordinates, e.g. distance to a given
centerpoint and discard the fragment entirely if the computed distance is
below a threshold radius.

If you need multiple holes, you need to pass a list of such centerpoints
and radii to the shader, e.g. in a Uniform array.

Christian




2015-07-23 10:49 GMT+02:00 Werner Modenbach <Werner.Modenbach at texion.eu>:

>  Are you sure? I think this will leed to nothing being displayed. But I
> didn't verify it. It is just how I understand clipping.
>
>
> Am 23.07.2015 um 10:35 schrieb Christian Buchner:
>
>
> I think you only need to flip the clipping plane around (reverse the
> plane's normal vector) to get the desired effect.
>
>
> 2015-07-22 21:28 GMT+02:00 Erik Hensens <ehensens at hunter.com>:
>
>> Hi everyone!
>>
>> I have a geode that is just a quad rectangular surface and I need to be
>> able to put circular holes in it. To better visualize what I'm talking
>> about, think about a flat slice of Swiss cheese.
>>
>> I just discovered the ClipNode node and I figured I could achieve what I
>> want by adding clip nodes that were the roughly circular, but ClipNode
>> apparently behaves opposite to how I originally thought (I'm new to this).
>>
>> Is there a way to make ClipNode remove parts of the scene instead or
>> keeping only those parts in the clip node region?
>>
>> Or, is there a better way to achieve this flat slice of Swiss cheese
>> shape? Thanks very much in advance!
>>
>> Thank you!
>>
>> Cheers,
>> Erik
>>
>> ------------------
>> Read this topic online here:
>> http://forum.openscenegraph.org/viewtopic.php?p=64437#64437
>>
>>
>>
>>
>>
>> _______________________________________________
>> osg-users mailing list
>> osg-users at lists.openscenegraph.org
>> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>>
>
>
>
> _______________________________________________
> osg-users mailing listosg-users at lists.openscenegraph.orghttp://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>
> --
> *TEXION Software Solutions, Rotter Bruch 26a, D-52068 Aachen*
> Phone: +49 241 475757-0
> Fax: +49 241 475757-29
> Web: http://texion.eu
> eMail: info at texion.eu
>
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20150723/84384bce/attachment-0003.htm>


More information about the osg-users mailing list