interesting rendering problem...

Started by
47 comments, last by cpu 21 years, 8 months ago
Hi all! I'm currently working on a game that is basically a 2D-type space shooter, but it has 3D-models and effects. Some of the very basic OpenGL initialization code is from the NeHe codebase. The rendering problem shows up on my friend's gf4 ti4200 card, but not on my good-old Geforce1 DDR (both WinXP). If you look at the ship model (rendered using display list) from far away, you'll notice nothing, but as you zoom in, some polygons start to fade to grey and back to 'normal lighting'. It's very hard to notice in an image, but compare these two pictures: This is how it should look like. Here you can see some dark spots that should not be present. There is also a color anomaly on the asteroids in this jpg. Thanks for any help... If anyone needs the program to test it, I'll post an URL for downloading. bye, cpu [edited by - cpu on July 19, 2002 10:26:11 AM] [edited by - cpu on July 19, 2002 10:26:27 AM] [edited by - cpu on July 19, 2002 10:27:44 AM]
Advertisement
would you mind highlighting the problems... they arn''t very obvious.
quote:Original post by RipTorn
would you mind highlighting the problems... they arn''t very obvious.


Right. I''ll make some modifications to the pictures. The problem is that even I had to ask where the bad pixels are...
There is a dark spot behind the cockpit where it should not be. That''s all I can tell you... and the asteroids have a bad color. I''ll post a new message when the pics are ready.
Here are the ''highlighted'' pictures:
Good
Bad
Asteroid

Thanks for any help... you know, a program is hard to debug if you can''t reproduce the problem.
For the soaceship, my first guess was that it was an effect of the texture being streteched differently as the zoom changed. Have you tried to change the filtering? Are you using mipmaps?

The asteroids looks more like it is an issue with lighting. Are lighting enabled? It seems a bit as if the highlighted ''slice'' is made of a single textured face, which is being lit by a diffuse or specular source, and just happends to be at an angle to the lightsource to give that extra highlighting effect.

But of course, I''m only guessing...
quote:Original post by nicba
For the soaceship, my first guess was that it was an effect of the texture being streteched differently as the zoom changed. Have you tried to change the filtering? Are you using mipmaps?

I''m using bilinear filtering at the moment. I''ll try mipmaps... but then why is this never happening on my card (using same res, color depth)?
quote:
The asteroids looks more like it is an issue with lighting. Are lighting enabled? It seems a bit as if the highlighted ''slice'' is made of a single textured face, which is being lit by a diffuse or specular source, and just happends to be at an angle to the lightsource to give that extra highlighting effect.

But of course, I''m only guessing...

That''s definately not a single face. The asteroid is currently made up of 960 triangles. Spaceship is over 3000. When I change the zoom level, the polygons get weird on all objects at certain distances. Even the moons can get screwed up, but my friend could not reproduce such a situation, because I limited the maximum zoom.
Lighting IS enabled, as you can see the moon is brighter on one side, as is the ship and the asteroids. I guess it''s a lighting issue because - if I remember correctly - there was a much worse thing on a Voodoo3 card (polys disappearing), but enabling the default light using glEnable(GL_LIGHT0) fixed this. Anyway, with the gf4 ti4200 it does not help anymore.

The code that sets up the lighting:

  GLfloat LightAmbient[]={ 0.5f, 0.5f, 0.5f, 1.0f };GLfloat LightDiffuse[]={ 1.0f, 1.0f, 1.0f, 1.0f };GLfloat LightPosition[]={ 100.0f, 50.0f, 25.0f, 0.1f };glLightfv(GL_LIGHT1, GL_AMBIENT, LightAmbient);glLightfv(GL_LIGHT1, GL_DIFFUSE, LightDiffuse);glLightfv(GL_LIGHT1, GL_POSITION,LightPosition);glEnable(GL_LIGHT1);  


Correct me please if this isn''t correct, I''m not really acquainted with lighting yet.
Hey I had that problem once, to fix it I had to add ''PFD_STEREO_DONTCARE'' to dwFlags of my pixel format descriptor...

like this
pfdUsed.dwFlags			=	PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL | PFD_DOUBLEBUFFER | PFD_STEREO_DONTCARE; 


hope this helps


_____________________

_____________________
quote:Original post by Yoshy
Hey I had that problem once, to fix it I had to add ''PFD_STEREO_DONTCARE'' to dwFlags of my pixel format descriptor...

like this
pfdUsed.dwFlags			=	PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL | PFD_DOUBLEBUFFER | PFD_STEREO_DONTCARE;  


hope this helps


Thanks a lot. I''ll tell you if it worked when the guy with the gf4ti4200 comes home
However, I''m open for any other suggestion...
Hi all,

Unfortunately, that PFD_STEREO_DONTCARE flag didn't work.

Some new pictures are available to examine the thing more closely:
1
2
3


[edited by - cpu on July 28, 2002 3:27:05 PM]
You know, this may or may not be helpful to you as you seem to be a bit of a perfectionist, but these ''color anomalies'' you speak of are not a big deal.. I didn''t even know what you were talking about in the original pictures.

So one small surface is a bit brighter at a certain angle and zoom. It''s no big deal! And for anyone playing the game, they won''t know that it wasn''t supposed to be there.

Put it this way: It sure as hell doesn''t look bad. Those screenshots are pretty nice, and I wouldn''t give a second thought about something so minor as what you''re complaining about.

This topic is closed to new replies.

Advertisement