Re: OpenGL changes
Bram Biesbrouck <[email protected]> Sun, 07 May 2006 04:49:24 -0800
| Newsgroups | gmane.games.devel.opengl |
|---|---|
| Organization | Fat City Network Services, San Diego, California |
| Message-ID | <[email protected]> |
Hi Kent,
I followed your advise and found the weirdest bug.
I created a really simple .obj file (just one square), let my parser read the
file and print out several vertex-values. Here's what happened:
The file contains (among others):
v -1.000000 1.000000 0.000000
This is the code that reads in the vertices:
GLfloat x, y, z;
fscanf(file, "%f %f %f", &x, &y, &z);
Now, when I try to print out the values:
printf("Read vertex: %f %f %f \n", x, y, z);
This is the output:
Read vertex: -1,000000 0,000000 -0,000029
Clearly (apparently), there's something wrong with the fscanf-routine. I know
this is not OpenGL-related, but I really don't know what could have caused
this. If anyone does, please help me out. As I said before, it worked
perfectly on Ubuntu breezy. This only thing I did was upgrading to Dapper.
Could this be a bug in libc, or did the upgrade failed to reconfigure the
library in a way?
Bram
Op Sunday 7 mei 2006 06:09, schreef Kent Quirk:
> Bram Biesbrouck wrote:
> >The thing is this: I render OpenGL-commentboxes (textballoons, etc), that
> > are defined in a Wavefront .obj file. The renderings in Ubuntu Breezy
> > were very good (using Nvidia's proprietary driver), but in Dapper, they
> > are all messed up. It looks like the vertices are rendered at random (or
> > sometimes not at all). The strange thing is that, for example, Blender
> > doesn't seem to have any problems, so I must be doing something wrong.
> >
> >Does anyone know of any important OpenGL-changes in this release? I know
> > it's all a bit vague, but I have no clue where to begin my debugging
> > quest. All help/suggestions are welcome.
>
> It's been my experience that incompatibilities across drivers are
> occasionally (unfortunately not rarely) the fault of the driver, but
> more often the fault of the developer assuming something about OpenGL
> state that cannot, in fact, be safely assumed.
>
> Your description of the problem doesn't leave a lot to go on. If you
> have a web page you can post both good and bad screenshots on (for
> comparison) someone might be able to look at it and give you some hints.
>
> OpenGL debugging is often a case of forcing certain things in your
> rendering loop. Make it so you can flat-shade everything, for example --
> then you can more easily see vertex bugs. Try testing every coordinate
> you're rendering to make sure it's in the expected range, and log
> anything that isn't. Calculate a face normal and dot it with your camera
> vector, and log it if it's wildly out of range. Basically, give yourself
> some switches to turn on and off various parts of the rendering pipeline
> so you can debug it.
>
> Kent
>
> -----
> FAQ and OpenGL Resources at:
> http://www.geocities.com/SiliconValley/Hills/9956/OpenGL
-----
FAQ and OpenGL Resources at:
http://www.geocities.com/SiliconValley/Hills/9956/OpenGL
--
Author: Bram Biesbrouck
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).