Hi Stefano,

ok I added it to the cvs for the antialiasing you can do something like 
this:

int vppw = vp->getPixelRight() - vp->getPixelLeft();
int vpph = vp->getPixelTop() - vp->getPixelBottom();

beginEditCP(_offsetdeco);
     _offsetdeco->setFullSize(vppw, vpph);
     _offsetdeco->setDecoratee(cam);
endEditCP(_offsetdeco);

glClear(GL_ACCUM_BUFFER_BIT);

unsigned int size = samples.size();
for(unsigned int i=0;i<size;++i)
{
     beginEditCP(_offsetdeco);
         _offsetdeco->setOffset(samples[i].x(), samples[i].y());
     endEditCP(_offsetdeco);

     // render scene

     glAccum(GL_ACCUM, 1.0f / float(size));
     glAccum(GL_RETURN, float(size) / float(i + 1));
}
glAccum(GL_RETURN, 1.0f);

Andreas


> Hi Andreas,
>  thanks for the superfast reply :) Adding OffsetCameraDecorator to the cvs 
> would
> be a great idea!
> 
> Thanks again,
> Stefano
> 
> Scrive Andreas Zieringer <[EMAIL PROTECTED]>:
> 
> 
>>Hi Stefano,
>>
>>yes you are right using the TileCameraDecorator for the jittering is not
>>a perfect solution. I wrote my own OffsetCameraDecorator for this
>>purpose if you like I can add it to the OpenSG cvs.
>>
>>Andreas
>>
>>
>>>Hi there!
>>>I wanted to archive a jitter antialias effect using TileCameraDecorator..
>>
>>it
>>
>>>works quite fine, except for a little unwanted behaviour I'll describe you
>>
>>in a
>>
>>>bit. This is a little excerpt of my code.. quite self-explanatory I hope.
>>>
>>>for (int i=0; i<m_bAntialiasingPasses; i++) {
>>>  float dx = JITTER[i].x() / m_pFBO->getPixelWidth();
>>>  float dy = JITTER[i].y() / m_pFBO->getPixelHeight();
>>>
>>>  beginEditCP(m_pTileDecorator);
>>>    m_pTileDecorator->setSize(dx, dy, 1+dx, 1+dy);
>>>  endEditCP(m_pTileDecorator);
>>>
>>>  render();
>>>}
>>>
>>>Unfortunately I'm getting a stronger effect on the edges of the window than
>>
>>in
>>
>>>the center. After looking at the OSGTileCameraDecorator I think I found the
>>>reason:
>>>
>>>TileCameraDecorator::getProjection( [...] ) {
>>>
>>>  [...]
>>>
>>>    Real32 left   = getLeft(),
>>>           right  = getRight(),
>>>           top    = getTop(),
>>>           bottom = getBottom();
>>>
>>>    if(left < 0)
>>>        left = -left / width;
>>>
>>>    if(right < 0)
>>>        right = -right / width;
>>>
>>>    if(top < 0)
>>>        top = -top / height;
>>>
>>>    if(bottom < 0)
>>>        bottom = -bottom / height;
>>>
>>>    // scale the wanted part from the projection matrix
>>>    Real32  xs = 1.f / (right - left),
>>>            ys = 1.f / (top - bottom);
>>>
>>>   [...]
>>>}
>>>
>>>So if my JITTER[i] is a negative value, what I'm getting with the
>>>TileCameraDecorator is a zoom instead of a simple translation, thus a
>>
>>different
>>
>>>aliasing compared to the one with a positive JITTER[i]. So, here are the
>>>questions :)
>>>- What's that code for? If you don't want negative values, I assume that
>>
>>you
>>
>>>wouldn't like too big values neither.
>>>- How could I achieve the wanted result?
>>>
>>>Thanks for your help!
>>>
>>>
>>>----------------------------------------------------------------
>>>This message was sent using IMP, the Internet Messaging Program.
>>>
>>>-------------------------------------------------------------------------
>>>This SF.net email is sponsored by: Microsoft
>>>Defy all challenges. Microsoft(R) Visual Studio 2005.
>>>http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
>>>_______________________________________________
>>>Opensg-users mailing list
>>>[email protected]
>>>https://lists.sourceforge.net/lists/listinfo/opensg-users
>>>
>>
>>
>>--
>>VREC
>>Robert-Bosch-Straße 7
>>D-64293 Darmstadt
>>Tel. 06151-4921035
>>
>>-------------------------------------------------------------------------
>>This SF.net email is sponsored by: Microsoft
>>Defy all challenges. Microsoft(R) Visual Studio 2005.
>>http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
>>_______________________________________________
>>Opensg-users mailing list
>>[email protected]
>>https://lists.sourceforge.net/lists/listinfo/opensg-users
>>
>>
> 
> 
> 
> 
> 
> ----------------------------------------------------------------
> This message was sent using IMP, the Internet Messaging Program.
> 
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2005.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> Opensg-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/opensg-users
> 


-- 
VREC
Robert-Bosch-Straße 7
D-64293 Darmstadt
Tel. 06151-4921035

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to