[of-dev] fbo's are upside down again!

Keith Pasko keith.pasko at gmail.com
Wed May 11 14:58:16 PDT 2011


vague thoughts/ramblings-
what about some sort of ofView object? as simple as GLuint vp[4], matrix4x4
mv, matrix4x4 proj? pointers to said beast could be shared amongst friends.
some variety of "setupScreenPerspective" f'n could fill said matrices by
reference if need be, and repeated setupScreenPerspective calls would be
eliminated (maybe that's causing confusion?) because you can set it up once
and just glMultMatrix as needed. maybe its just extracting some guts from
ofCamera into a lighter weight shareable object...?

On Wed, May 11, 2011 at 2:44 PM, Memo Akten <memo at memo.tv> wrote:

> yea I completely agree that ofFbo should not have gluPerspective, that is
> quite wrong at this point, but I think when that was
> written ofSetupScreenPerspective etc. didn't exist. Also ofFbo::begin() was
> quite an afterthought, I wasn't even keen to put that in :) and just wanted
> to keep it ofFbo::bind() (quite low level). But we put in ofFbo::begin() for
> the noobs and quick access. My vote would be for ofFbo::begin()
> using ofSetupScreenPerspective or whatever that function was (that ofCamera
> is using). So instead of ofFbo having an ofCamera - which is quite a heavy
> class - it would use some of the same internal functions that ofCamera uses,
> but without the overhead. That way the code to handle all the issues kyle
> was mentioning is only in one place, the ofSetupScreenPerspective functions.
> So we have layers of functionality, with the same code never written more
> than once. It's all about the layers, like an onion.
>
>
> On 11 May 2011 22:22, Theodore Watson <theo at theowatson.com> wrote:
>
>> Well currently fbo.begin() has  gluPerspective etc in it.
>>
>> I get your point about the offscreen renderer I think it just seems weird
>> to have ofSetupScreenPerspective ofCamera and ofFbo all with their own view
>> calls.
>>
>> It would be great if this code could exist in one place and be used by the
>> different classes that need to do set up a viewing matrix.
>>
>> On May 11, 2011, at 5:01 PM, Memo Akten < <memo at memo.tv>memo at memo.tv>
>> wrote:
>>
>> Theo, the modularist in me would argue against fbo having a camera. I
>> would see ofFbo as a wrapper for fbos, I don't really see how an fbo should
>> have a camera. You could have ofOffscreenRenderer which has an ofFbo and an
>> ofCamera, and perhaps even an ofShader (to do things like
>> myOffscreenRenderer.applyFilter(myfilter.glsl) - analogous to glgraphics in
>> processing.
>>
>> Why is it that you feel ofFbo needs a camera? Does it not work if you do
>> myfbo.bind(); myCamera.begin(); ?
>>
>> On 11 May 2011 21:40, Theodore Watson < <theo at openframeworks.cc>
>> theo at openframeworks.cc> wrote:
>>
>>> ps memo - what do you think about having ofFbo using an ofCamera
>>> internally instead of the gluPerspective stuff?
>>> Having control of the view within an fbo is important and currently the
>>> design makes it pretty hard to render from ofCamera's view into ofFbo.
>>>
>>> On May 11, 2011, at 4:30 PM, Memo Akten wrote:
>>>
>>> ok I give in :) I prefer explanatory names like ofGetScreenWidth(),
>>> ofGetWindowWidth(), ofGetViewportWidth(). autocomplete takes the pain away
>>> from all the typing anyway. If the majority want ofGetWidth() to return
>>> current viewport width then so be it - even though I would consider that to
>>> seriously break backwards compatibility :)
>>>
>>> On 11 May 2011 16:11, Joel Gethin Lewis < <me at joelgethinlewis.com><me at joelgethinlewis.com>
>>> me at joelgethinlewis.com> wrote:
>>>
>>>> +1 for making sense.
>>>>
>>>> J
>>>>
>>>> On 11 May 2011, at 14:59, Zachary Lieberman wrote:
>>>>
>>>>
>>>>
>>>> quickly, I strongly feel ofGetWidth() should return the width of the
>>>> current viewport (wether that's an fbo, the main window or something else).
>>>>   This is crucial, as so much code that is about positioning, historically
>>>> uses ofGetWidth() and ofGetHeight().
>>>>
>>>> - z
>>>>
>>>>
>>>>
>>>>
>>>> On Wed, May 11, 2011 at 9:54 AM, Theodore Watson <<theo at openframeworks.cc><theo at openframeworks.cc>
>>>> theo at openframeworks.cc> wrote:
>>>>
>>>>> I ran into this recently.
>>>>> Currently using an FBO with an ofCamera is really tricky, as both setup
>>>>> their own viewing matrix and viewport.
>>>>>
>>>>> Does it make sense to have ofFbo use an ofCamera internally?
>>>>> It could have one by default with the option to set from an external
>>>>> camera and/or ability to manipulate the Fbo's camera.
>>>>>
>>>>> Also now I finally understand the need for ofGetWidth returning the
>>>>> fbo.width when the fbo is bound :)
>>>>> Switching between ofGetWidth() to fbo.getWidth() is huge a pain.
>>>>>
>>>>> On May 6, 2011, at 10:02 AM, Theodore Watson wrote:
>>>>>
>>>>> I just have the issue of ofCamera being flipped by default.
>>>>> didn't see a solution so just did cam.setScale(1, -1, 1);
>>>>>
>>>>>
>>>>> internally cam.begin() is calling
>>>>>
>>>>> #ifndef TARGET_OPENGLES
>>>>> glOrtho(0, viewport.width, 0, viewport.height, nearClip, farClip);
>>>>> #endif
>>>>> } else {
>>>>>  gluPerspective(fov, viewport.width/viewport.height, nearClip,
>>>>> farClip);
>>>>> }
>>>>>
>>>>>
>>>>> currently its missing the code for doing y flipping.
>>>>> were we going to have it use ofSetupScreenPerspective / Ortho ?
>>>>>
>>>>> T
>>>>>
>>>>>   ----------------------------------------------
>>>>> Theo Watson
>>>>> <http://theowatson.com/> <http://theowatson.com>http://theowatson.com
>>>>>  <http://openframeworks.cc/> <http://openframeworks.cc>
>>>>> http://openframeworks.cc
>>>>>  ----------------------------------------------
>>>>>
>>>>> On May 6, 2011, at 5:45 AM, Memo Akten wrote:
>>>>>
>>>>> Hey, ok upon further investigation it's related to using ofCamera - or
>>>>> more specifically, ofEasyCam - inside an ofFbo. I'm relatively sure this
>>>>> used to work, but I'm not 100%. I'm also not 100% what is the best way to
>>>>> implement a fix which isn't a hack but a decent solution. Ill have a look at
>>>>> it, but if anyone has ideas please chip in.
>>>>>
>>>>> On 5 May 2011 20:12, arturo castro < <arturo at openframeworks.cc><arturo at openframeworks.cc>
>>>>> arturo at openframeworks.cc> wrote:
>>>>>
>>>>>> mmh, i'm testing the version in development and its working ok,
>>>>>> haven't
>>>>>> tested master but there's no new changes there.  what settings are you
>>>>>> using? perhaps something related with setup perspective again?
>>>>>>
>>>>>>
>>>>>> El jue, 05-05-2011 a las 13:00 +0100, Memo Akten escribió:
>>>>>> > Hey all, i've just realized that fbo's are appearing upside down
>>>>>> > again. I'm pretty sure I've already fixed this twice before. Has
>>>>>> > anyone noticed this? Or can shed some light onto what might have
>>>>>> > changed recently that has broken fbo's again?
>>>>>> >
>>>>>> > --
>>>>>> > Memo Akten
>>>>>> >
>>>>>> >
>>>>>> > <http://www.memo.tv/> <http://www.memo.tv>www.memo.tv
>>>>>> > <http://www.twitter.com/memotv> <http://www.twitter.com/memotv>
>>>>>> www.twitter.com/memotv
>>>>>> > <http://www.msavisuals.com/> <http://www.msavisuals.com>
>>>>>> www.msavisuals.com
>>>>>> >
>>>>>> >
>>>>>> >
>>>>>> >
>>>>>> >
>>>>>> >
>>>>>> >
>>>>>> >
>>>>>> > _______________________________________________
>>>>>> > of-dev mailing list
>>>>>> > <of-dev at dev.openframeworks.cc> <of-dev at dev.openframeworks.cc>
>>>>>> of-dev at dev.openframeworks.cc
>>>>>> >
>>>>>> <http://dev.openframeworks.cc/listinfo.cgi/of-dev-openframeworks.cc><http://dev.openframeworks.cc/listinfo.cgi/of-dev-openframeworks.cc>
>>>>>> http://dev.openframeworks.cc/listinfo.cgi/of-dev-openframeworks.cc
>>>>>>
>>>>>>
>>>>>> _______________________________________________
>>>>>> of-dev mailing list
>>>>>>  <of-dev at dev.openframeworks.cc> <of-dev at dev.openframeworks.cc>
>>>>>> of-dev at dev.openframeworks.cc
>>>>>>  <http://dev.openframeworks.cc/listinfo.cgi/of-dev-openframeworks.cc><http://dev.openframeworks.cc/listinfo.cgi/of-dev-openframeworks.cc>
>>>>>> http://dev.openframeworks.cc/listinfo.cgi/of-dev-openframeworks.cc
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Memo Akten
>>>>>
>>>>> <http://www.memo.tv/> <http://www.memo.tv>www.memo.tv
>>>>>  <http://www.twitter.com/memotv> <http://www.twitter.com/memotv>
>>>>> www.twitter.com/memotv
>>>>>  <http://www.msavisuals.com/> <http://www.msavisuals.com>
>>>>> www.msavisuals.com
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> of-dev mailing list
>>>>> <of-dev at dev.openframeworks.cc> <of-dev at dev.openframeworks.cc>
>>>>> of-dev at dev.openframeworks.cc
>>>>>  <http://dev.openframeworks.cc/listinfo.cgi/of-dev-openframeworks.cc><http://dev.openframeworks.cc/listinfo.cgi/of-dev-openframeworks.cc>
>>>>> http://dev.openframeworks.cc/listinfo.cgi/of-dev-openframeworks.cc
>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> of-dev mailing list
>>>>> <of-dev at dev.openframeworks.cc> <of-dev at dev.openframeworks.cc>
>>>>> of-dev at dev.openframeworks.cc
>>>>>  <http://dev.openframeworks.cc/listinfo.cgi/of-dev-openframeworks.cc><http://dev.openframeworks.cc/listinfo.cgi/of-dev-openframeworks.cc>
>>>>> http://dev.openframeworks.cc/listinfo.cgi/of-dev-openframeworks.cc
>>>>>
>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> of-dev mailing list
>>>>>  <of-dev at dev.openframeworks.cc> <of-dev at dev.openframeworks.cc>
>>>>> of-dev at dev.openframeworks.cc
>>>>>  <http://dev.openframeworks.cc/listinfo.cgi/of-dev-openframeworks.cc><http://dev.openframeworks.cc/listinfo.cgi/of-dev-openframeworks.cc>
>>>>> http://dev.openframeworks.cc/listinfo.cgi/of-dev-openframeworks.cc
>>>>>
>>>>>
>>>> _______________________________________________
>>>> of-dev mailing list
>>>> <of-dev at dev.openframeworks.cc> <of-dev at dev.openframeworks.cc>
>>>> of-dev at dev.openframeworks.cc
>>>>  <http://dev.openframeworks.cc/listinfo.cgi/of-dev-openframeworks.cc><http://dev.openframeworks.cc/listinfo.cgi/of-dev-openframeworks.cc>
>>>> http://dev.openframeworks.cc/listinfo.cgi/of-dev-openframeworks.cc
>>>>
>>>>
>>>>
>>>> Joel Gethin Lewis
>>>> <me at joelgethinlewis.com> <me at joelgethinlewis.com>me at joelgethinlewis.com
>>>> +44 7932 792 076
>>>>
>>>>
>>>> _______________________________________________
>>>> of-dev mailing list
>>>>  <of-dev at dev.openframeworks.cc> <of-dev at dev.openframeworks.cc>
>>>> of-dev at dev.openframeworks.cc
>>>>  <http://dev.openframeworks.cc/listinfo.cgi/of-dev-openframeworks.cc><http://dev.openframeworks.cc/listinfo.cgi/of-dev-openframeworks.cc>
>>>> http://dev.openframeworks.cc/listinfo.cgi/of-dev-openframeworks.cc
>>>>
>>>>
>>>
>>>
>>> --
>>> Memo Akten
>>>
>>> <http://www.memo.tv/> <http://www.memo.tv>www.memo.tv
>>>  <http://www.twitter.com/memotv> <http://www.twitter.com/memotv>
>>> www.twitter.com/memotv
>>>  <http://www.msavisuals.com/> <http://www.msavisuals.com>
>>> www.msavisuals.com
>>>
>>>
>>>
>>>
>>> _______________________________________________
>>> of-dev mailing list
>>> <of-dev at dev.openframeworks.cc> <of-dev at dev.openframeworks.cc>
>>> of-dev at dev.openframeworks.cc
>>>  <http://dev.openframeworks.cc/listinfo.cgi/of-dev-openframeworks.cc><http://dev.openframeworks.cc/listinfo.cgi/of-dev-openframeworks.cc>
>>> http://dev.openframeworks.cc/listinfo.cgi/of-dev-openframeworks.cc
>>>
>>>
>>>
>>> _______________________________________________
>>> of-dev mailing list
>>>  <of-dev at dev.openframeworks.cc> <of-dev at dev.openframeworks.cc>
>>> of-dev at dev.openframeworks.cc
>>>  <http://dev.openframeworks.cc/listinfo.cgi/of-dev-openframeworks.cc><http://dev.openframeworks.cc/listinfo.cgi/of-dev-openframeworks.cc>
>>> http://dev.openframeworks.cc/listinfo.cgi/of-dev-openframeworks.cc
>>>
>>>
>>
>>
>> --
>> Memo Akten
>>
>> <http://www.memo.tv> <http://www.memo.tv>www.memo.tv
>>  <http://www.twitter.com/memotv> <http://www.twitter.com/memotv>
>> www.twitter.com/memotv
>>  <http://www.msavisuals.com> <http://www.msavisuals.com>
>> www.msavisuals.com
>>
>>
>>
>>
>>  _______________________________________________
>> of-dev mailing list
>> <of-dev at dev.openframeworks.cc>of-dev at dev.openframeworks.cc
>>  <http://dev.openframeworks.cc/listinfo.cgi/of-dev-openframeworks.cc>
>> http://dev.openframeworks.cc/listinfo.cgi/of-dev-openframeworks.cc
>>
>>
>> _______________________________________________
>> of-dev mailing list
>> of-dev at dev.openframeworks.cc
>> http://dev.openframeworks.cc/listinfo.cgi/of-dev-openframeworks.cc
>>
>>
>
>
> --
> Memo Akten
>
> www.memo.tv
> www.twitter.com/memotv
> www.msavisuals.com
>
>
>
>
>
> _______________________________________________
> of-dev mailing list
> of-dev at dev.openframeworks.cc
> http://dev.openframeworks.cc/listinfo.cgi/of-dev-openframeworks.cc
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://dev.openframeworks.cc/pipermail/of-dev-openframeworks.cc/attachments/20110511/84e4c975/attachment.htm>


More information about the of-dev mailing list