From: 임무 (yamoo++at++grmanet.sogang.ac.kr)
Date: 10/05/2001 02:53:45
Oh~ Sorry...
Additional promblem is come.
My program is loading many texture data in advance.
This loading code using "glGenTexture() and glTexImage()..." is called in channelSetup() function. (Maybe not DRAW process)
But My program is working very well my workstation. (in Single process)
My workstation is SGI Octane R12000, V8 Graphicboard , 384MM.
And I have tried to run this program(same perfectly) at CAVE system.
(This system is 5 pipe, 20(?) process)
But this program didn't work at CAVE system.
Following warning message printed at run time :
PF Warning/Usage: No hardware support for VSYNC, frame sync may vary.Assuming 60Hz.
PF Warning/Usage: pfGetVClock() not supported for this context.
In my opinion..this problem is come becase calling GL function in not DRAW process.
So, I have tried to call GL function DRAW process.
In advance loading texture data in main memory, and load texture by calling glTexGen, glTexImage in DRAW process.
Then program working . but bad performence...--;
Becasue, in DRAW process, I have load only needed texture.
If load total texture in first DRAW process(using flag), this is not working. Only first texture is displayed...--;
I want to load many texture data into texture memory in advance for good performence.
What I can do? How can I load texture into texture memory? Please answer my question.
Im, Moo Jin
----- Original Message -----
From: "Benedikt Kessler" <bjk++at++munich.sgi.com>
To: "ÀÓ¹«Áø" <yamoo++at++grmanet.sogang.ac.kr>
Cc: <info-performer++at++sgi.com>
Sent: Thursday, October 04, 2001 4:37 PM
Subject: Re: Texture Problem using Opengl in Performer
> Hi!
>
> I assume that you're running in sigle process mode; If not you will have
> crashes calling OpenGL calls in the APP or CULL processes as they do bat
> have a graphics context. So calling glGenTextures (or any other gl*
> call) will only be allowed in the DRAW process.
>
> By calling glGenTextures(1, texture) only the first element (index 0!!!)
> of the texture array is initialized; that means that you must call:
>
> glBindTexture(GL_TEXTURE_2D, texture[0]);
> ^^^ instead of 1!!!
>
> So both the sample code and your own code were wrong...
>
> You might also either call glTexParameteri(GL_TEXTURE_2D,
> GL_TEXTURE_MIN_FILTER, GL_LINEAR); or define all mipmap levels in your
> code! For the default GL_NEAREST_MIPMAP_LINEAR minification filter all
> mipmap levels must be defined (or no texturing is used).
>
>
> Bye! Benedikt
>
>
>
> > Hi..
> >
> > I am student of Sogang Univ. in Seoul, Korea, and my name is Im, Moo
> > Jin...
> >
> > I saw the following reply at Info-Performer Mailing List (2000.10)
> >
> > ------------------------------------------------------------------------------------
> >
> > Hi,
> >
> > did you use glGenTextures to generate the texture name? I did the same
> >
> > thing and it worked out well. Here is what I did (the main idea):
> >
> > Init time:
> > glGenTextures(1, texture)
> >
> > Post Draw time:
> > // copy frame buffer to texture
> > glBindTextureEXT(GL_TEXTURE_2D,texture[1]);
> > glCopyTexSubImage2DEXT(GL_TEXTURE_2D, 0, 0, 0, 0, 0, sizeX, sizeY);
> >
> > // draw textured quad with frame buffer texture
> > pfPushIdentMatrix();
> > pfEnable(PFEN_TEXTURE);
> > glEnable(GL_TEXTURE_2D);
> > glBindTextureEXT(GL_TEXTURE_2D,texture[1]);
> > glTexEnvi(GL_TEXTURE_ENV,GL_TEXTURE_ENV_MODE,GL_MODULATE);
> > glBegin(GL_QUADS);
> > glColor4f(1.0f,1.0f,1.0f,1.0f);
> > glTexCoord2f(0.0f,0.0f); glVertex2f(-1.0f,-1.0f);
> > glTexCoord2f(1.0f,0.0f); glVertex2f(1.007f,-1.0f);
> > glTexCoord2f(1.0f,1.0f); glVertex2f(1.007f,1.005f);
> > glTexCoord2f(0.0f,1.0f); glVertex2f(-1.0f,1.005f);
> > glEnd();
> >
> > regards, Sylvain
> >
> > ------------------------------------------------------------------------------------
> >
> > So. I programming refer to this code.
> >
> > I want programming simple 2d texture code using OpenGL.
> >
> > My code is :
> >
> > ------------------------------------------------------------------------------------
> >
> > In Main Function :
> >
> > /* This is from Opengl Programming Guide */
> > glGenTextures(1, texture);
> > for(i=0; i<checkImageHeight; i++) {
> >
> > for(j=0; j<checkImageWidth; j++) {
> > c = ((((i&0x8)==0)^((j&0x8))==0))*255;
> > checkImage[i][j][0] = (GLubyte) c;
> > checkImage[i][j][1] = (GLubyte) c;
> > checkImage[i][j][2] = (GLubyte) c;
> > checkImage[i][j][3] = (GLubyte) 255;
> > }
> > }
> > glBindTextureEXT(GL_TEXTURE_2D, texture[1]);
> > glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, checkImageWidth,
> > checkImageHeight, 0, GL_RGBA, GL_UNSIGNED_BYTE,
> > checkImage);
> >
> > In channelSetup Function :
> >
> > pfChanTravFunc(chan, PFTRAV_DRAW, drawHUD);
> >
> > In drawHUD Function :
> >
> > {
> >
> > pfClearChan(chan);
> > pfDraw();
> >
> > /* post draw */
> > pfPushIdentMatrix();
> > pfEnable(PFEN_TEXTURE);
> > glEnable(GL_TEXTURE_2D);
>
> no need to glEnable(GL_TEXTURE_2D); if pfEnable(PFEN_TEXTURE); is
> already used.
>
>
> > glBindTextureEXT(GL_TEXTURE_2D, texture[1]);
> > glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
> >
> > glBegin(GL_QUADS);
> > glColor4f(1.0, 1.0, 1.0, 1.0);
> > glTexCoord2f(0.0, 0.0); glVertex2f(-1.0f,-1.0f);
> > glTexCoord2f(1.0, 0.0); glVertex2f( 1.0f,-1.0f);
> > glTexCoord2f(1.0, 1.0); glVertex2f( 1.0f, 1.0f);
> > glTexCoord2f(0.0, 1.0); glVertex2f(-1.0f, 1.0f);
> > glEnd();
> > }
> >
> > ------------------------------------------------------------------------------------
> >
> > Please check my code..
> >
> > What is the problem...?
> >
> > Because this problem, I can't proceed my job.
> >
> > Please answer my question.
> >
> > Besides if possible, send me sample texture program code using Opengl.
> >
> >
> >
> > Im, Moo Jin
> >
> > p.s. Sorry, My terrible English..:-)
>
>
> --
> +---------------------------------+----------------------------------+
> |Benedikt J. Kessler | Silicon Graphics GmbH |
> |Professional Services | Am Hochacker 3 - Technopark |
> |SGI | 85630 Grasbrunn-Neukeferloh, FRG |
> | --- __o ,__o | |
> | ------_ \<,_ _-\_<, | Phone: (+49) 89 46108-366 or -0 |
> |----- (*)/ (*) (*)/'(*) | Fax: (+49) 89 46107-366 |
> +---------------------------------+----------------------------------+
> |E-Mail: bjk++at++sgi.com Web (private): http://reality.sgi.com/bjk |
> | Web: http://www.sgi.de/dienstleistungen/ |
> +--------------------------------------------------------------------+
This archive was generated by hypermail 2b29 : Fri Oct 05 2001 - 02:54:46 PDT