render to frame buffer objects

48 views
Skip to first unread message

Ranojay Sen

unread,
Aug 23, 2018, 6:21:16 AM8/23/18
to coin3d-...@googlegroups.com
Dear All,

Any pointers on how to render the scenegraph to FBO/RTT will be much appreciated. 

I have been looking into SoFrameBufferObject and SoGLRenderAction class, as the potential tools for the purpose but did not find any suitable code examples to do the same.

If any body can give us a simple snippet to render the graph in a buffer and ultimately too a texture, would be really helpful

for any further questions regarding the problem please reach out to me any time

Regards
Ranojay

Bastiaan Veelo

unread,
Aug 23, 2018, 4:20:23 PM8/23/18
to coin3d-...@googlegroups.com

Giampiero Gabbiani

unread,
Aug 23, 2018, 4:41:23 PM8/23/18
to coin3d-discuss
Hi Ranojay,

see also the chapter 9 of "The Inventor Mentor" example 9.1 (print to postscript).

The example source is at


Regards
Giampiero

Ranojay Sen

unread,
Aug 24, 2018, 12:40:58 AM8/24/18
to coin3d-...@googlegroups.com
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

Thanks in advance, would really appreciate your help

Regards
Ranojay

--
You received this message because you are subscribed to the Google Groups "coin3d-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to coin3d-discus...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Giampiero Gabbiani

unread,
Aug 24, 2018, 2:51:39 AM8/24/18
to coin3d-discuss
Theoretically the Open Inventor APIs allow a closer OpenGL interaction (see Chapter 17 of 'The Inventor Mentor' and example 17.2 https://bitbucket.org/Coin3D/ivexamples/src/default/Mentor/17.2.GLCallback.cpp.in) but it is an advanced usage that honestly I never explored ...

Regards
Giampiero

Bastiaan Veelo

unread,
Aug 24, 2018, 4:16:34 AM8/24/18
to coin3d-...@googlegroups.com
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.

Bastiaan Veelo

unread,
Aug 24, 2018, 4:33:08 AM8/24/18
to coin3d-...@googlegroups.com
On 24/08/2018 10:16, Bastiaan Veelo wrote:
> If it is for reflection maps, then Coin can do that directly already.

Oops I may have got that wrong -- not entirely sure.

Ranojay Sen

unread,
Aug 24, 2018, 5:24:48 AM8/24/18
to coin3d-...@googlegroups.com
Thanks a lot for your help. Let me go through the links that you sent then I will have a better Idea,

In essence what I need mostly is to render the scenegraphs to an FBO and do some tricks  there to make the images look better, just like the example I showed before done with pure OpenGL in the previous mails

In any case thanks a lot for your help, I may get back to you after looking on the links that you already provided if I find what I am looking for

Regards
Ranojay 

Reply all
Reply to author
Forward
0 new messages