Hi Laurens,

What is needed in this case is a StateSet::setMode(i, ), similar to
how we have  the setTextureMode(i,..) and have these mods map to
glEnablei/glDisablei.

Or just go the route like osg::Hint uses.  This would entail an
osg::SateAttribute that map the i parameter to the
StateAttibute::getMember() and then have the default value of the
attribute to disable.

In terms of limiting how widely the functionality would end up
spreading into other class implementations I'd have a
osg::EnableDisablei/osg::Modei StateAttribute.

Robert.


On 6 June 2016 at 16:21, Voerman, L. <[email protected]> wrote:
> Hi Robbert,
> I failed to get a good grip on how we could make this work, because of the
> way the new attribute would interact with the existing mode;
> from the spec (viewport_array.txt):
>
>     Calling Enable or Disable with the symbolic constant SCISSOR_TEST is
>     equivalent, assuming no errors, to:
>
>     for (uint i = 0; i < MAX_VIEWPORTS; i++) {
>         Enablei(SCISSOR_TEST, i);
>         /* or */
>         Disablei(SCISSOR_TEST, i);
>     }
>
> therefore the (existing) mode will replace the values set by the new
> attribute, causing the state to leak in unexpected ways.
>
> I will leave this as is for the moment, as I think the scissor array would
> be usable with only a global on/off switch, and a buggy implementation of
> the per-viewport on/off could be very confusing.
>
> Regards, Laurens.
>
>
>
> On Mon, Jun 6, 2016 at 1:22 PM, Robert Osfield <[email protected]>
> wrote:
>>
>> Hi Laurens,
>>
>> I have just done a first pass review and left wondering if we might be
>> able to leverage the existing
>> StateAttribute::getMember()/getTypeMemberPair() functionality in some
>> way.  The osg::Light and osg::ColorMaski are examples of this in
>> action.  Could we do something here?
>>
>> Robert.
>>
>> On 3 June 2016 at 15:59, Voerman, L. <[email protected]> wrote:
>> > Hi Robert,
>> > in order to try stereoscopic rendering with a geometry shader I added
>> > support for the GL_ARB_viewport_array extention. I got stuck at
>> > implementing
>> > the SCISSOR_TEST array, as  I cannot see where I could extend the osg
>> > with
>> > an array replacing a boolean glMode. Any thoughts on that would be
>> > appreciated.
>> > Meantime I think the current code is usable (even without the ability to
>> > enable/disable the scissor test per viewport).
>> > Regards, Laurens.
>> >
>> >
>> >
>> > _______________________________________________
>> > osg-submissions mailing list
>> > [email protected]
>> >
>> > http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
>> >
>> _______________________________________________
>> osg-submissions mailing list
>> [email protected]
>>
>> http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
>
>
>
> _______________________________________________
> osg-submissions mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
>
_______________________________________________
osg-submissions mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org

Reply via email to