On 24/08/2018 06:40, Ranojay Sen wrote:
> Thank you All, for such quick response, SoOffscreenRenderer seems to
> be the closest possible option I am looking for, but is there a way I
> can have more control on rendering itself ? I mean like doing MSAA
> like these guys are doing
>
http://www.songho.ca/opengl/gl_fbo.html
>
> Thanks in advance, would really appreciate your help
>
> Regards
> Ranojay
>
If I'm notmistaken, Coin already uses FBO rendering when it's available.
MSAA is controled through SoRenderManager::setAntialiasing().
https://coin3d.bitbucket.io/Coin/classSoRenderManager.html#ad0d5aa9ecd0bc31f0a86fac0d7732a82
I'm not sure though whether SoRenderManager can be used with
SoOffscreenRenderer. But at least you can see how MSAA is done by
looking at the source of SoRenderManager, and maybe hack it into a
subclass of SoOffscreenRenderer, if that's the only way. You can look at
the source of SoQuarterWidget to see how SoRenderManager is meant to be
used.
https://bitbucket.org/Coin3D/quarter/src/4040ac7a14cf482c719dc38adae977dec0b6c1c2/src/Quarter/QuarterWidget.cpp?at=default&fileviewer=file-view-default
If you find a way to implement MSAA into SoOffscreenRenderer then you
are welcome to submit a pull request for inclusion in Coin.
Another way to achieve AA is to render to a higher resolution buffer,
then scale it down with for example imagemagic. I don't know whether
that would meet your performance requirements though...
Could you share for what purpose you want to render off screen? If it is
for reflection maps, then Coin can do that directly already.
Bastiaan.