Re: FBO problem

Rhadamés Carmona <[email protected]> Wed, 30 Jul 2008 18:15:27 -0800
Newsgroups gmane.games.devel.opengl
Organization Fat City Network Services, San Diego, California
Message-ID <[email protected]>
This is a multi-part message in MIME format.


------=_NextPart_000_001D_01C8F286.C6CE2FC0
Content-Type: text/plain; charset="iso-8859-15"
Content-Transfer-Encoding: quoted-printable

Hello Guys

Now works. The trick was to use GL=5FRGBA32F=5FARB instead of GL=5FRGBA32F=5FNV


Regards

Rhadam=E9s

----- Original Message ----- 
To: =22Multiple recipients of list OPENGL-GAMEDEV-L=22 <OPENGL-GAMEDEV-L@fatcit=
y.com>
Sent: Wednesday, July 30, 2008 5:50 AM


> Hej,
> 
> have you actually used shaders=3F Float FBOs only work with shaders. Also 
> note that your texture coordinates are different for GL=5FTEXTURE=5FRECTANGLE=
 
> in contrast to GL=5FTEXTURE=5F2D, but it seems you only use texture rectangle=
 
> anyways.
> 
>> I am playing a little bit with FBO. By the way, I am rendering a little =
red
>> quad in the middle of the FBO. It works perfect while I use
>> 
>> glTexImage2D(GL=5FTEXTURE=5FRECTANGLE=5FNV, 0, 4, w, h, 0, GL=5FRGBA,
>> GL=5FUNSIGNED=5FBYTE, NULL);
>> 
>> yeah...a 8 bits FBO. I can change GL=5FUNSIGNED=5FBYTE by GL=5FFLOAT, and I al=
ways
>> get a 8 bits FBO... (well known behaviour).
>> 
>> But, If I just change that command by
>> 
>> glTexImage2D(GL=5FTEXTURE=5FRECTANGLE=5FNV, 0, GL=5FFLOAT=5FRGBA16=5FNV, w, h,
>> 0,GL=5FRGBA, GL=5FUNSIGNED=5FSHORT, NULL);
>> 
>> or even by
>> 
>> glTexImage2D(GL=5FTEXTURE=5FRECTANGLE=5FNV, 0, GL=5FFLOAT=5FRGBA32=5FNV, w, h,
>> 0,GL=5FRGBA, GL=5FFLOAT, NULL);
>> 
>> then, I get a full screen red image (even if I comment the glBegin(QUADS=
) -
>> glEnd() block to render the quad). The entire FBO gets the color of my
>> glColor3ub(255,0,0).
>> 
>> I have test every OpenGL code line with glGetError(), and there is not a=
ny
>> error. I also installed latest glew and drivers for my 8800 NVidia graph=
ics
>> board.
>> 
>> I hope some of you could have a suggestion about what I am doing wrong.
>> 
>> Thanks a lot!
>> Rhadam=E9s
>> 
>> 
>> #include =22glew.h=22
>> #include <gl/glut.h>
>> #include <stdio.h>
>> #include <stdlib.h>
>> #include <iostream>
>> 
>> #define GL=5FTEXTURE=5FRECTANGLE GL=5FTEXTURE=5FRECTANGLE=5FNV
>> 
>> int height=3D0, width=3D0;
>> GLuint g=5Ffb=3D0;
>> GLuint g=5Ftex=3D0;
>> GLuint g=5Fdepth=3D0;
>> 
>> using namespace std;
>> 
>> 
>> void Abort(char *msg)
>> {
>> printf(msg);
>> exit(1);
>> }
>> 
>> 
>> 
>> void CheckErrorsGL(const char* location=3DNULL, ostream& ostr=3D std::cerr )
>> {
>> GLuint errnum;
>> const char *errstr;
>> int counter =3D 0;
>> while (errnum =3D glGetError())
>> {
>> errstr =3D reinterpret=5Fcast<const char *>(gluErrorString(errnum));
>> if(errstr)
>> {
>> ostr << errstr;
>> }
>> else
>> {
>> ostr << =22Error =22 << errnum;
>> }
>> 
>> if(location)
>> ostr << =22 at =22 << location; 
>> ostr << endl;
>> counter++;
>> }
>> if (counter)
>> Abort(=22Application cannot continue!\n=22);
>> 
>> return;
>> }
>> 
>> void TestOpenGLError()
>> {
>> CheckErrorsGL(NULL);
>> }
>> 
>> 
>> void Draw()
>> {
>> // working with main object (the application)
>> if (!width || !height)
>> return;
>> 
>> glClearColor(0,0,0,0);
>> glClear(GL=5FDEPTH=5FBUFFER=5FBIT | GL=5FCOLOR=5FBUFFER=5FBIT);
>> 
>> 
>> glBindFramebufferEXT(GL=5FFRAMEBUFFER=5FEXT, g=5Ffb); TestOpenGLError();
>> glDrawBuffer( GL=5FCOLOR=5FATTACHMENT0=5FEXT ); TestOpenGLError();
>> glViewport(0,0,width, height); TestOpenGLError();
>> glClearColor(0,0,0,0); TestOpenGLError();
>> glClear(GL=5FCOLOR=5FBUFFER=5FBIT); TestOpenGLError();
>> 
>> 
>> float size =3D 100.0f;
>> 
>> glColor3f(1,0,0.5f);
>> glBegin(GL=5FQUADS);
>> glVertex2f(width*0.5f - size, height*0.5f - size);
>> glVertex2f(width*0.5f - size, height*0.5f + size);
>> glVertex2f(width*0.5f + size, height*0.5f + size);
>> glVertex2f(width*0.5f + size, height*0.5f - size);
>> glEnd();
>> //glColor3ub(0,0,0);
>> 
>> 
>> 
>> 
>> glBindFramebufferEXT(GL=5FFRAMEBUFFER=5FEXT, 0);
>> glDrawBuffer( GL=5FBACK );
>> glViewport(0,0,width, height); TestOpenGLError();
>> glFinish();
>> glEnable(GL=5FTEXTURE=5FRECTANGLE);
>> glBindTexture(GL=5FTEXTURE=5FRECTANGLE, g=5Ftex); TestOpenGLError();
>> glEnable(GL=5FTEXTURE=5FRECTANGLE); TestOpenGLError();
>> 
>> 
>> glBegin(GL=5FQUADS);
>> glTexCoord2f(0.0f, 0.0f);
>> glVertex2f(0.0f, 0.0f);
>> glTexCoord2f(0.0f, height);
>> glVertex2f(0.0f, height);
>> glTexCoord2f(width, height);
>> glVertex2f(width, height);
>> glTexCoord2f(width, 0.0f);
>> glVertex2f(width, 0.0f);
>> glEnd();
>> 
>> glDisable(GL=5FTEXTURE=5FRECTANGLE); TestOpenGLError();
>> // back to 3D mode
>> 
>> 
>> glFinish();
>> glutSwapBuffers();
>> }
>> 
>> void Init()
>> {
>> GLenum err =3D glewInit();
>> if (GLEW=5FOK !=3D err)
>> // Problem: glewInit failed, something is seriously wrong.
>> Abort(=22init error\n=22);
>> 
>> 
>> TestOpenGLError();
>> glGenFramebuffersEXT(1, &g=5Ffb); ; TestOpenGLError();
>> glBindTexture(GL=5FTEXTURE=5F2D, 0); TestOpenGLError();
>> glBindTexture(GL=5FTEXTURE=5FRECTANGLE, 0); TestOpenGLError();
>> glBindFramebufferEXT(GL=5FFRAMEBUFFER=5FEXT, g=5Ffb); TestOpenGLError();
>> 
>> // create the texture for the color
>> glGenTextures(1, &g=5Ftex); &nbs p; TestOpenGLError();
>> glBindTexture(GL=5FTEXTURE=5FRECTANGLE, g=5Ftex); TestOpenGLError();
>> 
>> glTexParameteri (GL=5FTEXTURE=5FRECTANGLE, GL=5FTEXTURE=5FWRAP=5FS, GL=5FCLAMP);
>> glTexParameteri (GL=5FTEXTURE=5FRECTANGLE, GL=5FTEXTURE=5FWRAP=5FT, GL=5FCLAMP);
>> glTexParameteri (GL=5FTEXTURE=5FRECTANGLE, GL=5FTEXTURE=5FMAG=5FFILTER, GL=5FNEAREST=
);
>> glTexParameteri (GL=5FTEXTURE=5FRECTANGLE, GL=5FTEXTURE=5FMIN=5FFILTER, GL=5FNEAREST=
); TestOpenGLError(); &nbs p;
>> 
>> //glTexImage2D(GL=5FTEXTURE=5FRECTANGLE, 0, 4, width, height, 0, GL=5FRGBA, GL=
=5FUNSIGNED=5FBYTE, NULL); //works
>> //glTexImage2D(GL=5FTEXTURE=5FRECTANGLE, 0, GL=5FRGBA16, width, height, 0,GL=5FR=
GBA, GL=5FUNSIGNED=5FSHORT, NULL); //works
>> //glTexImage2D(GL=5FTEXTURE=5FRECTANGLE, 0, GL=5FFLOAT=5FRGBA32=5FNV, w, h, 0,GL=5FR=
GBA, GL=5FFLOAT, NULL); //does not work
>> glTexImage2D(GL=5FTEXTURE=5FRECTANGLE, 0, GL=5FFLOAT=5FRGBA16=5FNV, width, height,=
 0,GL=5FRGBA, GL=5FUNSIGNED=5FSHORT, NULL);
>> 
>> TestOpenGLError();
>> glFramebufferTexture2DEXT(GL=5FFRAMEBUFFER=5FEXT,GL=5FCOLOR=5FATTACHMENT0=5FEXT,GL=
=5FTEX TURE=5FRECTANGLE,g=5Ftex, 0);
>> if (glCheckFramebufferStatusEXT(GL=5FFRAMEBUFFER=5FEXT) !=3D GL=5FFRAMEBUFFER=5FCO=
MPLETE=5FEXT)
>> Abort(=22Error adding color to FBO\n=22);
>> TestOpenGLError();
>> 
>> glMatrixMode(GL=5FPROJECTION);
>> glLoadIdentity();
>> glOrtho(0,width,0,height,-1,100.0f);
>> glMatrixMode(GL=5FTEXTURE);
>> glLoadIdentity();
>> glMatrixMode(GL=5FMODELVIEW);
>> glLoadIdentity();
>> glTranslatef(0,0,-5);
>> }
>> 
>> void Reshape(int w, int h)
>> {
>> width =3D w;
>> height=3D h;
>> glViewport(0,0,width,height);
>> Init();
>> }
>> 
>> 
>> void main(int argc, char **argv)
>> {
>> glutInit(&argc, argv);
>> glutInitDisplayString(=22double blue>=3D8 red>=3D8 alpha>=3D8 green>=3D8 depth=3D32=22=
);// rgba>=3D8 depth>=3D24=22);
>> glutInitWindowSize(640,480);
>> glutInitWindowPosition(0,0);
>> glutCreateWindow(=22test=22);
>> glutSetWindowTitle(=22test=22);
>> 
>> 
>> glutIdleFunc(Draw);
>> glutDisplayFunc(Draw);
>> glutReshapeFunc(Reshape);
>> 
>> glutShowWindow();
>> glutMainLoop();
>> 
>> }
>> ----- FAQ and OpenGL Resources at: http://www.geocities.com/SiliconValle=
y/Hills/9956/OpenGL -- Author: [email protected]
>> INET: [email protected] Fat City Hosting, San Diego, California -- http:/=
/www.fatcity.com
>> --------------------------------------------------------------------- To=
 REMOVE yourself from this mailing list, send an
>> E-Mail message to: [email protected] (note EXACT spelling of 'ListGur=
u') and in the message BODY, include a line
>> containing: UNSUB OPENGL-GAMEDEV-L (or the name of mailing list you want=
 to be removed from). You may also send the HELP
>> command for other information (like subscribing).
>>
> 
> Servus,
>   Gernot
> 
> GPU. 3D Vision. Europe. Future. Now.
> Drop by: www.mpi-sb.mpg.de/~gziegler - www.geofront.eu
>

-- 
Estoy usando la versi=F3n gratuita de SPAMfighter para usuarios privados.
Ha eliminado 29139 correos spam hasta la fecha.
Los usuarios de pago no tienen este mensaje en sus correos.
Obtenga SPAMfighter gratis aqu=ED: http://www.spamfighter.com/les

------=_NextPart_000_001D_01C8F286.C6CE2FC0
Content-Type: text/html; charset="iso-8859-15"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC =22-//W3C//DTD HTML 4.0 Transitional//EN=22>
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D=22text/html; charset=3Diso-8859-15=22>
<META content=3D=22MSHTML 6.00.6000.16674=22 name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY>
<DIV><FONT face=3DArial size=3D2>Hello Guys</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Now works. The trick was to use GL=5FRGBA32F=5FARB=
 
instead of </FONT><FONT face=3DArial size=3D2>GL=5FRGBA32F=5FNV</FONT>
<P><FONT face=3DArial size=3D2></FONT>&nbsp;</P>
<P><FONT face=3DArial size=3D2>Regards</FONT></P>
<P><FONT face=3DArial size=3D2>Rhadam=E9s</FONT></P></DIV>
<DIV><FONT face=3DArial size=3D2>----- Original Message ----- </FONT>
<DIV><FONT face=3DArial size=3D2>From: =22Gernot Ziegler=22 &lt;</FONT><A 
href=3D=22mailto:[email protected]=22><FONT face=3DArial 
size=3D2>[email protected]</FONT></A><FONT face=3DArial size=3D2>&gt;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>To: =22Multiple recipients of list OPENGL-GAMEDE=
V-L=22 
&lt;</FONT><A href=3D=22mailto:[email protected]=22><FONT face=3DArial 
size=3D2>[email protected]</FONT></A><FONT face=3DArial 
size=3D2>&gt;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Sent: Wednesday, July 30, 2008 5:50 AM</FONT><=
/DIV>
<DIV><FONT face=3DArial size=3D2>Subject: Re: FBO problem</FONT></DIV></DIV>
<DIV><FONT face=3DArial><BR><FONT size=3D2></FONT></FONT></DIV><FONT face=3DArial=
 
size=3D2>&gt; Hej,<BR>&gt; <BR>&gt; have you actually used shaders=3F Float FBO=
s 
only work with shaders. Also <BR>&gt; note that your texture coordinates ar=
e 
different for GL=5FTEXTURE=5FRECTANGLE <BR>&gt; in contrast to GL=5FTEXTURE=5F2D, b=
ut it 
seems you only use texture rectangle <BR>&gt; anyways.<BR>&gt; <BR>&gt;&gt;=
 I am 
playing a little bit with FBO. By the way, I am rendering a little 
red<BR>&gt;&gt; quad in the middle of the FBO. It works perfect while I 
use<BR>&gt;&gt; <BR>&gt;&gt; glTexImage2D(GL=5FTEXTURE=5FRECTANGLE=5FNV, 0, 4, w,=
 h, 
0, GL=5FRGBA,<BR>&gt;&gt; GL=5FUNSIGNED=5FBYTE, NULL);<BR>&gt;&gt; <BR>&gt;&gt; 
yeah...a 8 bits FBO. I can change GL=5FUNSIGNED=5FBYTE by GL=5FFLOAT, and I 
always<BR>&gt;&gt; get a 8 bits FBO... (well known behaviour).<BR>&gt;&gt; 
<BR>&gt;&gt; But, If I just change that command by<BR>&gt;&gt; <BR>&gt;&gt;=
 
glTexImage2D(GL=5FTEXTURE=5FRECTANGLE=5FNV, 0, GL=5FFLOAT=5FRGBA16=5FNV, w, h,<BR>&gt;&=
gt; 
0,GL=5FRGBA, GL=5FUNSIGNED=5FSHORT, NULL);<BR>&gt;&gt; <BR>&gt;&gt; or even 
by<BR>&gt;&gt; <BR>&gt;&gt; glTexImage2D(GL=5FTEXTURE=5FRECTANGLE=5FNV, 0, 
GL=5FFLOAT=5FRGBA32=5FNV, w, h,<BR>&gt;&gt; 0,GL=5FRGBA, GL=5FFLOAT, NULL);<BR>&gt;&g=
t; 
<BR>&gt;&gt; then, I get a full screen red image (even if I comment the 
glBegin(QUADS) -<BR>&gt;&gt; glEnd() block to render the quad). The entire =
FBO 
gets the color of my<BR>&gt;&gt; glColor3ub(255,0,0).<BR>&gt;&gt; <BR>&gt;&=
gt; I 
have test every OpenGL code line with glGetError(), and there is not 
any<BR>&gt;&gt; error. I also installed latest glew and drivers for my 8800=
 
NVidia graphics<BR>&gt;&gt; board.<BR>&gt;&gt; <BR>&gt;&gt; I hope some of =
you 
could have a suggestion about what I am doing wrong.<BR>&gt;&gt; <BR>&gt;&g=
t; 
Thanks a lot!<BR>&gt;&gt; Rhadam=E9s<BR>&gt;&gt; <BR>&gt;&gt; <BR>&gt;&gt; 
#include =22glew.h=22<BR>&gt;&gt; #include &lt;gl/glut.h&gt;<BR>&gt;&gt; #inclu=
de 
&lt;stdio.h&gt;<BR>&gt;&gt; #include &lt;stdlib.h&gt;<BR>&gt;&gt; #include 
&lt;iostream&gt;<BR>&gt;&gt; <BR>&gt;&gt; #define GL=5FTEXTURE=5FRECTANGLE 
GL=5FTEXTURE=5FRECTANGLE=5FNV<BR>&gt;&gt; <BR>&gt;&gt; int height=3D0, 
width=3D0;<BR>&gt;&gt; GLuint g=5Ffb=3D0;<BR>&gt;&gt; GLuint g=5Ftex=3D0;<BR>&gt;&gt;=
 
GLuint g=5Fdepth=3D0;<BR>&gt;&gt; <BR>&gt;&gt; using namespace std;<BR>&gt;&gt;=
 
<BR>&gt;&gt; <BR>&gt;&gt; void Abort(char *msg)<BR>&gt;&gt; {<BR>&gt;&gt; 
printf(msg);<BR>&gt;&gt; exit(1);<BR>&gt;&gt; }<BR>&gt;&gt; <BR>&gt;&gt; 
<BR>&gt;&gt; <BR>&gt;&gt; void CheckErrorsGL(const char* location=3DNULL, 
ostream&amp; ostr=3D std::cerr )<BR>&gt;&gt; {<BR>&gt;&gt; GLuint 
errnum;<BR>&gt;&gt; const char *errstr;<BR>&gt;&gt; int counter =3D 0;<BR>&gt=
;&gt; 
while (errnum =3D glGetError())<BR>&gt;&gt; {<BR>&gt;&gt; errstr =3D 
reinterpret=5Fcast&lt;const char *&gt;(gluErrorString(errnum));<BR>&gt;&gt; 
if(errstr)<BR>&gt;&gt; {<BR>&gt;&gt; ostr &lt;&lt; errstr;<BR>&gt;&gt; 
}<BR>&gt;&gt; else<BR>&gt;&gt; {<BR>&gt;&gt; ostr &lt;&lt; =22Error =22 &lt;&lt=
; 
errnum;<BR>&gt;&gt; }<BR>&gt;&gt; <BR>&gt;&gt; if(location)<BR>&gt;&gt; ost=
r 
&lt;&lt; =22 at =22 &lt;&lt; location; <BR>&gt;&gt; ostr &lt;&lt; endl;<BR>&gt;=
&gt; 
counter++;<BR>&gt;&gt; }<BR>&gt;&gt; if (counter)<BR>&gt;&gt; Abort(=22Applic=
ation 
cannot continue!\n=22);<BR>&gt;&gt; <BR>&gt;&gt; return;<BR>&gt;&gt; }<BR>&gt=
;&gt; 
<BR>&gt;&gt; void TestOpenGLError()<BR>&gt;&gt; {<BR>&gt;&gt; 
CheckErrorsGL(NULL);<BR>&gt;&gt; }<BR>&gt;&gt; <BR>&gt;&gt; <BR>&gt;&gt; vo=
id 
Draw()<BR>&gt;&gt; {<BR>&gt;&gt; // working with main object (the 
application)<BR>&gt;&gt; if (!width || !height)<BR>&gt;&gt; return;<BR>&gt;=
&gt; 
<BR>&gt;&gt; glClearColor(0,0,0,0);<BR>&gt;&gt; glClear(GL=5FDEPTH=5FBUFFER=5FBIT=
 | 
GL=5FCOLOR=5FBUFFER=5FBIT);<BR>&gt;&gt; <BR>&gt;&gt; <BR>&gt;&gt; 
glBindFramebufferEXT(GL=5FFRAMEBUFFER=5FEXT, g=5Ffb); TestOpenGLError();<BR>&gt;&=
gt; 
glDrawBuffer( GL=5FCOLOR=5FATTACHMENT0=5FEXT ); TestOpenGLError();<BR>&gt;&gt; 
glViewport(0,0,width, height); TestOpenGLError();<BR>&gt;&gt; 
glClearColor(0,0,0,0); TestOpenGLError();<BR>&gt;&gt; 
glClear(GL=5FCOLOR=5FBUFFER=5FBIT); TestOpenGLError();<BR>&gt;&gt; <BR>&gt;&gt; 
<BR>&gt;&gt; float size =3D 100.0f;<BR>&gt;&gt; <BR>&gt;&gt; 
glColor3f(1,0,0.5f);<BR>&gt;&gt; glBegin(GL=5FQUADS);<BR>&gt;&gt; 
glVertex2f(width*0.5f - size, height*0.5f - size);<BR>&gt;&gt; 
glVertex2f(width*0.5f - size, height*0.5f + size);<BR>&gt;&gt; 
glVertex2f(width*0.5f + size, height*0.5f + size);<BR>&gt;&gt; 
glVertex2f(width*0.5f + size, height*0.5f - size);<BR>&gt;&gt; 
glEnd();<BR>&gt;&gt; //glColor3ub(0,0,0);<BR>&gt;&gt; <BR>&gt;&gt; <BR>&gt;=
&gt; 
<BR>&gt;&gt; <BR>&gt;&gt; glBindFramebufferEXT(GL=5FFRAMEBUFFER=5FEXT, 
0);<BR>&gt;&gt; glDrawBuffer( GL=5FBACK );<BR>&gt;&gt; glViewport(0,0,width, 
height); TestOpenGLError();<BR>&gt;&gt; glFinish();<BR>&gt;&gt; 
glEnable(GL=5FTEXTURE=5FRECTANGLE);<BR>&gt;&gt; glBindTexture(GL=5FTEXTURE=5FRECTAN=
GLE, 
g=5Ftex); TestOpenGLError();<BR>&gt;&gt; glEnable(GL=5FTEXTURE=5FRECTANGLE); 
TestOpenGLError();<BR>&gt;&gt; <BR>&gt;&gt; <BR>&gt;&gt; 
glBegin(GL=5FQUADS);<BR>&gt;&gt; glTexCoord2f(0.0f, 0.0f);<BR>&gt;&gt; 
glVertex2f(0.0f, 0.0f);<BR>&gt;&gt; glTexCoord2f(0.0f, height);<BR>&gt;&gt;=
 
glVertex2f(0.0f, height);<BR>&gt;&gt; glTexCoord2f(width, height);<BR>&gt;&=
gt; 
glVertex2f(width, height);<BR>&gt;&gt; glTexCoord2f(width, 0.0f);<BR>&gt;&g=
t; 
glVertex2f(width, 0.0f);<BR>&gt;&gt; glEnd();<BR>&gt;&gt; <BR>&gt;&gt; 
glDisable(GL=5FTEXTURE=5FRECTANGLE); TestOpenGLError();<BR>&gt;&gt; // back to =
3D 
mode<BR>&gt;&gt; <BR>&gt;&gt; <BR>&gt;&gt; glFinish();<BR>&gt;&gt; 
glutSwapBuffers();<BR>&gt;&gt; }<BR>&gt;&gt; <BR>&gt;&gt; void 
Init()<BR>&gt;&gt; {<BR>&gt;&gt; GLenum err =3D glewInit();<BR>&gt;&gt; if 
(GLEW=5FOK !=3D err)<BR>&gt;&gt; // Problem: glewInit failed, something is seri=
ously 
wrong.<BR>&gt;&gt; Abort(=22init error\n=22);<BR>&gt;&gt; <BR>&gt;&gt; <BR>&gt;=
&gt; 
TestOpenGLError();<BR>&gt;&gt; glGenFramebuffersEXT(1, &amp;g=5Ffb); ; 
TestOpenGLError();<BR>&gt;&gt; glBindTexture(GL=5FTEXTURE=5F2D, 0); 
TestOpenGLError();<BR>&gt;&gt; glBindTexture(GL=5FTEXTURE=5FRECTANGLE, 0); 
TestOpenGLError();<BR>&gt;&gt; glBindFramebufferEXT(GL=5FFRAMEBUFFER=5FEXT, g=5Ff=
b); 
TestOpenGLError();<BR>&gt;&gt; <BR>&gt;&gt; // create the texture for the 
color<BR>&gt;&gt; glGenTextures(1, &amp;g=5Ftex); &amp;nbs p; 
TestOpenGLError();<BR>&gt;&gt; glBindTexture(GL=5FTEXTURE=5FRECTANGLE, g=5Ftex); 
TestOpenGLError();<BR>&gt;&gt; <BR>&gt;&gt; glTexParameteri 
(GL=5FTEXTURE=5FRECTANGLE, GL=5FTEXTURE=5FWRAP=5FS, GL=5FCLAMP);<BR>&gt;&gt; glTexParam=
eteri 
(GL=5FTEXTURE=5FRECTANGLE, GL=5FTEXTURE=5FWRAP=5FT, GL=5FCLAMP);<BR>&gt;&gt; glTexParam=
eteri 
(GL=5FTEXTURE=5FRECTANGLE, GL=5FTEXTURE=5FMAG=5FFILTER, GL=5FNEAREST);<BR>&gt;&gt; 
glTexParameteri (GL=5FTEXTURE=5FRECTANGLE, GL=5FTEXTURE=5FMIN=5FFILTER, GL=5FNEAREST); 
TestOpenGLError(); &amp;nbs p;<BR>&gt;&gt; <BR>&gt;&gt; 
//glTexImage2D(GL=5FTEXTURE=5FRECTANGLE, 0, 4, width, height, 0, GL=5FRGBA, 
GL=5FUNSIGNED=5FBYTE, NULL); //works<BR>&gt;&gt; 
//glTexImage2D(GL=5FTEXTURE=5FRECTANGLE, 0, GL=5FRGBA16, width, height, 0,GL=5FRGBA=
, 
GL=5FUNSIGNED=5FSHORT, NULL); //works<BR>&gt;&gt; 
//glTexImage2D(GL=5FTEXTURE=5FRECTANGLE, 0, GL=5FFLOAT=5FRGBA32=5FNV, w, h, 0,GL=5FRGBA=
, 
GL=5FFLOAT, NULL); //does not work<BR>&gt;&gt; glTexImage2D(GL=5FTEXTURE=5FRECTAN=
GLE, 
0, GL=5FFLOAT=5FRGBA16=5FNV, width, height, 0,GL=5FRGBA, GL=5FUNSIGNED=5FSHORT, 
NULL);<BR>&gt;&gt; <BR>&gt;&gt; TestOpenGLError();<BR>&gt;&gt; 
glFramebufferTexture2DEXT(GL=5FFRAMEBUFFER=5FEXT,GL=5FCOLOR=5FATTACHMENT0=5FEXT,GL=5FTE=
X 
TURE=5FRECTANGLE,g=5Ftex, 0);<BR>&gt;&gt; if 
(glCheckFramebufferStatusEXT(GL=5FFRAMEBUFFER=5FEXT) !=3D 
GL=5FFRAMEBUFFER=5FCOMPLETE=5FEXT)<BR>&gt;&gt; Abort(=22Error adding color to 
FBO\n=22);<BR>&gt;&gt; TestOpenGLError();<BR>&gt;&gt; <BR>&gt;&gt; 
glMatrixMode(GL=5FPROJECTION);<BR>&gt;&gt; glLoadIdentity();<BR>&gt;&gt; 
glOrtho(0,width,0,height,-1,100.0f);<BR>&gt;&gt; 
glMatrixMode(GL=5FTEXTURE);<BR>&gt;&gt; glLoadIdentity();<BR>&gt;&gt; 
glMatrixMode(GL=5FMODELVIEW);<BR>&gt;&gt; glLoadIdentity();<BR>&gt;&gt; 
glTranslatef(0,0,-5);<BR>&gt;&gt; }<BR>&gt;&gt; <BR>&gt;&gt; void Reshape(i=
nt w, 
int h)<BR>&gt;&gt; {<BR>&gt;&gt; width =3D w;<BR>&gt;&gt; height=3D h;<BR>&gt;&=
gt; 
glViewport(0,0,width,height);<BR>&gt;&gt; Init();<BR>&gt;&gt; }<BR>&gt;&gt;=
 
<BR>&gt;&gt; <BR>&gt;&gt; void main(int argc, char **argv)<BR>&gt;&gt; 
{<BR>&gt;&gt; glutInit(&amp;argc, argv);<BR>&gt;&gt; 
glutInitDisplayString(=22double blue&gt;=3D8 red&gt;=3D8 alpha&gt;=3D8 green&gt;=3D8 
depth=3D32=22);// rgba&gt;=3D8 depth&gt;=3D24=22);<BR>&gt;&gt; 
glutInitWindowSize(640,480);<BR>&gt;&gt; 
glutInitWindowPosition(0,0);<BR>&gt;&gt; glutCreateWindow(=22test=22);<BR>&gt;&=
gt; 
glutSetWindowTitle(=22test=22);<BR>&gt;&gt; <BR>&gt;&gt; <BR>&gt;&gt; 
glutIdleFunc(Draw);<BR>&gt;&gt; glutDisplayFunc(Draw);<BR>&gt;&gt; 
glutReshapeFunc(Reshape);<BR>&gt;&gt; <BR>&gt;&gt; glutShowWindow();<BR>&gt=
;&gt; 
glutMainLoop();<BR>&gt;&gt; <BR>&gt;&gt; }<BR>&gt;&gt; ----- FAQ and OpenGL=
 
Resources at: </FONT><A 
href=3D=22http://www.geocities.com/SiliconValley/Hills/9956/OpenGL=22><FONT face=3D=
Arial 
size=3D2>http://www.geocities.com/SiliconValley/Hills/9956/OpenGL</FONT></A><=
FONT 
face=3DArial size=3D2> -- Author: </FONT><A href=3D=22mailto:[email protected]=22><FON=
T 
face=3DArial size=3D2>[email protected]</FONT></A><BR><FONT face=3DArial 
size=3D2>&gt;&gt; INET: </FONT><A href=3D=22mailto:[email protected]=22><FONT face=3DA=
rial 
size=3D2>[email protected]</FONT></A><FONT face=3DArial size=3D2> Fat City Hosting=
, San 
Diego, California -- </FONT><A href=3D=22http://www.fatcity.com=22><FONT face=3DAri=
al 
size=3D2>http://www.fatcity.com</FONT></A><BR><FONT face=3DArial size=3D2>&gt;&gt=
; 
--------------------------------------------------------------------- To RE=
MOVE 
yourself from this mailing list, send an<BR>&gt;&gt; E-Mail message to: 
</FONT><A href=3D=22mailto:[email protected]=22><FONT face=3DArial 
size=3D2>[email protected]</FONT></A><FONT face=3DArial size=3D2> (note EXACT 
spelling of 'ListGuru') and in the message BODY, include a line<BR>&gt;&gt;=
 
containing: UNSUB OPENGL-GAMEDEV-L (or the name of mailing list you want to=
 be 
removed from). You may also send the HELP<BR>&gt;&gt; command for other 
information (like subscribing).<BR>&gt;&gt;<BR>&gt; <BR>&gt; 
Servus,<BR>&gt;&nbsp;&nbsp; Gernot<BR>&gt; <BR>&gt; GPU. 3D Vision. Europe.=
 
Future. Now.<BR>&gt; Drop by: </FONT><A 
href=3D=22http://www.mpi-sb.mpg.de/~gziegler=22><FONT face=3DArial 
size=3D2>www.mpi-sb.mpg.de/~gziegler</FONT></A><FONT face=3DArial size=3D2> - 
</FONT><A href=3D=22http://www.geofront.eu=22><FONT face=3DArial 
size=3D2>www.geofront.eu</FONT></A><BR><FONT face=3DArial 
size=3D2>&gt;</FONT><!-- SPAMfighter Signature --><br><hr>Estoy utilizando la=
 versi=F3n gratuita de SPAMfighter para usuarios privados.<br />Ha eliminado =
29139 correos spam hasta la fecha.<br />Los abonados no tienen este mensaje=
 en sus correos.<br />=A1Pruebe <a href=3D=22http://www.spamfighter.com/les=22>SPAM=
fighter</a> gratis ya!<br /></BODY></HTML>


------=_NextPart_000_001D_01C8F286.C6CE2FC0--

----- 
FAQ and OpenGL Resources at:
  http://www.geocities.com/SiliconValley/Hills/9956/OpenGL

-- 
Author: =?iso-8859-15?Q?Rhadam=E9s_Carmona?=
  INET: [email protected]

Fat City Hosting, San Diego, California -- http://www.fatcity.com
---------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: [email protected] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB OPENGL-GAMEDEV-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).