PDA

View Full Version : Render onto a texture and then show it.



brambilla
01-23-2009, 10:11 AM
My application draw some objects {like hundreds other ones ].
Now I wish to draw exactly the same scene on a "texture" (from a different point of view -but this is not the point-) and then show this texture on the top-left part of my viewport, but i.e. in 200x200 pixels.
Is this very difficult ????
Does someone know where to find a very, very.... easy example for this ???

Regards.
Giovanni

wedge
01-23-2009, 11:43 AM
Best you use FRAME-BUFFER-OBJEKTS (FBO's)
With this you can render into a FBO insted the Framebuffer. And then use this FBO as Texture. Very cool ;).

If you understand FBO very easy too use.
edit:
tutorials:
http://www.gamedev.net/reference/articles/article2331.asp
http://www.gamedev.net/reference/articles/article2333.asp

brambilla
01-23-2009, 12:59 PM
Excellent.
Thanks

brambilla
01-23-2009, 11:25 PM
My compiler report and error at these lines ..


glGenFramebuffersEXT(1, @fbo);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fbo);

ZbuffeR
01-24-2009, 01:25 AM
You have to dynamically initialize new entry points beyond GL 1.1 :
http://opengl.org/wiki/Getting_started#OpenGL_2.0.2B_and_extensions
Libraries exists to simplify this a lot :
http://opengl.org/wiki/Related_toolkits_and_APIs#Extension_libraries