I’m trying to figure out how I can draw part of an FBO on the screen.
Using the draw(x,y,w,h) draws the entire fbo into the specified rectangle, but how can I just draw half of the FBO in one place and the other half in an other place?
Thanks, that seems to work - kind of.
This gives the result in the first screenshot, when I change fbo.allocate to fbo.allocate(ofGetWidth(), ofGetHeight(), GL_RGB) I get the result of the second screenshot. ( as one can guess I have an ofSpherePrimitive and an ofFbo in the .h file named sphere and fbo respectively).
I don’t understand the relation between the two, especially the right-bottom corner; that and the absence of color.
It’s really just a test to try and figure out the concept of drawing to an fbo and showing just a part.
I have another program into which I want to implement this because I need to render a scene twice, with different clip planes, and have one halve of the screen show halve with one set of parameters and the other halve with other settings.
It’s a bit hard to explain but basically I need two different ‘slices’ of some geometry (the slices being done with clip planes) rendered on the same screen. In pseudocode:
fbo1.begin();
set clipplanes a;
draw stuff;
fbo1.end();
fbo2.begin();
set clipplanes b;
draw stuff;
fbo2.end();
draw fbo1 to left halve of screen
draw fbo2 to right halve of screen