Hi Aurelien.
On 22 July 2013 15:03, Aurelien Albert <[email protected]> wrote:
> I have some problem to implement it : (lines 986-989 in RenderStage.cpp)
>
>
> Code:
>
> // Bind the resolve framebuffer to blit into.
> _fbo->apply(state, FrameBufferObject::READ_FRAMEBUFFER);
> _resolveFbo->apply(state, FrameBufferObject::DRAW_FRAMEBUFFER);
>
>
> Is there anyway to have two differents calls to "haveAppliedAttribute" for
> READ target and for DRAW target ?
Curious problem...
The only thing I can think of right now is to piggy back off the the
TypeMemberPair currently used to handle lights and clipplanes:
class State { ..
/** Attribute has been applied externally,
* and therefore this attribute type has been dirtied
* and will need to be re-applied on next osg::State.apply(..).
* note, if you have an osg::StateAttribute which you have applied
externally
* then use the have_applied(attribute) method as this will cause
the osg::State to
* track the current state more accurately and enable lazy state
updating such
* that only changed state will be applied.*/
void haveAppliedAttribute(StateAttribute::Type type, unsigned int
member=0);
}
And on the StateAtttribute side:
class StateAttribute { ...
/** Return the Type identifier of the attribute's class type.*/
virtual Type getType() const = 0;
/** Return the member identifier within the attribute's class type.
Used for light number/clip plane number etc.*/
virtual unsigned int getMember() const { return 0; }
/** Return the TypeMemberPair that uniquely identifies this type
member.*/
inline TypeMemberPair getTypeMemberPair() const { return
TypeMemberPair(getType(),getMember()); }
}
Could the member for a FBO use the Member as the READ/DRAW?
Robert.
_______________________________________________
osg-submissions mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org