Allegro.cc - Online Community

Allegro.cc Forums » Programming Questions » [OL] GeForce FX 5600XT

Credits go to Fladimir da Gorf, Mr. Big, and Richard Phipps for helping out!
This thread is locked; no one can reply to it. rss feed Print
 1   2 
[OL] GeForce FX 5600XT
CursedTyrant
Member #7,080
April 2006
avatar

That sort of thing did not happen on my Radeon 9550. It does on this particular gfx card tough. Any ideas why and how can I fix it (tough I probably can't and I'll have to harass Flad to take a look at it)? I know it's been asked dozens of times, but I don't recall it ever being fixed.

And yes, I'm using the latest snapshot.

{"name":"590216","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/3\/1\/310539626e66f098e8e384e3dc626376.jpg","w":791,"h":589,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/3\/1\/310539626e66f098e8e384e3dc626376"}590216

---------
Signature.
----
[My Website] | [My YouTube Channel]

Richard Phipps
Member #1,632
November 2001
avatar

Are you using blending? Does this occur if using an ADDITIVE_BLEND mode?

CursedTyrant
Member #7,080
April 2006
avatar

Yes, I'm using blending, but not on this screenshot (shadows are disabled, so no blending is actually done). It occurs anyway tough, shadows on or off.

---------
Signature.
----
[My Website] | [My YouTube Channel]

Richard Phipps
Member #1,632
November 2001
avatar

If you look at those lines with a paint program you will see that they are not perfectly black, but instead about half brightness. That suggests that it's a blending issue with the two triangles. Can you turn on additive blending for those floor tiles and check if that helps?

Fladimir da Gorf
Member #1,565
October 2001
avatar

You could try turning off the anti-aliasing.

OpenLayer has reached a random SVN version number ;) | Online manual | Installation video!| MSVC projects now possible with cmake | Now alvailable as a Dev-C++ Devpack! (Thanks to Kotori)

Mr. Big
Member #6,196
September 2005

Try calling 'glDisable(GL_POLYGON_SMOOTH)'.
It does this sort of thing on my card too and is of no use for rectangles anyway.

CursedTyrant
Member #7,080
April 2006
avatar

Yeah, it fixed it, but with the shadows and lights on, everything else looks rather BAD. :P I didn't have any problems on my Radeon 9550 tough, is there any way to fix it without rewriting the code? I don't want to spend another week trying to figure out a good blender combination :P

EDIT: I'll try.

EDIT2: Ah, thanks a lot, glDisable(GL_POLYGON_SMOOTH) fixed everything. Thanks again.

---------
Signature.
----
[My Website] | [My YouTube Channel]

Richard Phipps
Member #1,632
November 2001
avatar

Would glDisable(GL_POLYGON_SMOOTH) have any negative effects (apart from removing anti-aliasing on untextured polygons when you might want it?)

I.e. should this be added to the OpenLayer setup code? :)

Fladimir da Gorf
Member #1,565
October 2001
avatar

Well, it makes the polygon edges not to appear anti-aliased.

OpenLayer has reached a random SVN version number ;) | Online manual | Installation video!| MSVC projects now possible with cmake | Now alvailable as a Dev-C++ Devpack! (Thanks to Kotori)

Richard Phipps
Member #1,632
November 2001
avatar

What I am concerned with is that this problem will affect all OpenLayer programs that use blitting operations on a GeForce FX 5600XT.

So, would it be better to disable the smoothing to avoid the problem on this card?

CursedTyrant
Member #7,080
April 2006
avatar

I think turning it off by default would be ok, as long as it's clearly stated somewhere (for those of us who are not so proficient at OpenGL) that you can use something like that to smooth the polygons. After all, I didn't even know such an option existed before today :P

It would also benefit people with gfx cards like mine, because I don't think many people using OpenLayer turn that particular option off.

OTOH, my Snake clone runs perfectly fine on this video card, tough it might be becase I use one large bitmap for the background and additive blending (which fixes the problem as well) for the snake and bonuses.

---------
Signature.
----
[My Website] | [My YouTube Channel]

Bob
Free Market Evangelist
September 2000
avatar

Quote:

glDisable(GL_POLYGON_SMOOTH) fixed everything. Thanks again.

Polygon smoothing is disabled by default. You had to explicitly turn it on... so just don't do that :)

Polygon smoothing is just the wrong option for antialiasing. It just doesn't work. It's great if what you want is smoothing though, but you do need to keep in mind that your edges will "bleed" into adjacent polygons when you do that.

--
- Bob
[ -- All my signature links are 404 -- ]

Epsi
Member #5,731
April 2005
avatar

I had this problem too with a GeForce Go 6200.

With the polygon smoothing off you jts have to keep in mind that your Shapes will be aliased (eg. Circles).
That's why I only use Bitmaps in my game an no shapes.

___________________________________

piccolo: "soon all new 2d alegro games will be better. after i finsh my MMRPG. my game will serve as a code reference. so you can understand and grab code from."
piccolo: "just wait until my invetion comes out its going to take the wii to the next leave of game play. it will run sony and microsoft out of busness if i dont let them use it aswell."

Bob
Free Market Evangelist
September 2000
avatar

Quote:

With the polygon smoothing off you jts have to keep in mind that your Shapes will be aliased (eg. Circles).

Or you can turn on multisampling, which does actually work for edge anti-aliasing.

--
- Bob
[ -- All my signature links are 404 -- ]

CursedTyrant
Member #7,080
April 2006
avatar

SetupProgram(MOUSE | KEYBOARD | TIMER);
else { SetupProgram(MOUSE | KEYBOARD); }
SetupScreen(sW, sH, sF, desktop_color_depth());

srand(time(0));

Game = true;

I don't see how any of these lines "explicitly turn on" GL_POLYGON_SMOOTH. ;)

---------
Signature.
----
[My Website] | [My YouTube Channel]

Epsi
Member #5,731
April 2005
avatar

You don't see it because OL enable it by default (it's the antialiasing function).

The polygon smoothing line is located in Settings.cpp of the OL lib.
Just comment it and you will be fine.

void Settings::
SetAntialiasing( bool turnedOn ) {
   useAntiAlias = turnedOn;
   if( useAntiAlias ) {
      glEnable( GL_LINE_SMOOTH );
      glEnable( GL_POINT_SMOOTH );
      // comment this because of a GeForce bug
      //glEnable( GL_POLYGON_SMOOTH );
   }
   else {
      glDisable( GL_LINE_SMOOTH );
      glDisable( GL_POINT_SMOOTH );
      glDisable( GL_POLYGON_SMOOTH );
   }
}

Rebuild the lib afterwards.

___________________________________

piccolo: "soon all new 2d alegro games will be better. after i finsh my MMRPG. my game will serve as a code reference. so you can understand and grab code from."
piccolo: "just wait until my invetion comes out its going to take the wii to the next leave of game play. it will run sony and microsoft out of busness if i dont let them use it aswell."

Bob
Free Market Evangelist
September 2000
avatar

Quote:

// comment this because of a GeForce bug

I take offense. This is not a GeForce bug. GeForce is 100% OpenGL compliant here.

--
- Bob
[ -- All my signature links are 404 -- ]

Richard Phipps
Member #1,632
November 2001
avatar

Bob, how come this effect is not visible on other GeForce cards?

CursedTyrant
Member #7,080
April 2006
avatar

Quote:

You don't see it because OL enable it by default (it's the antialiasing function).

I was referring to this:

Quote:

Polygon smoothing is disabled by default. You had to explicitly turn it on... so just don't do that :)

:P

---------
Signature.
----
[My Website] | [My YouTube Channel]

Epsi
Member #5,731
April 2005
avatar

Quote:

I was referring to this

Yes and I was explaining why you have not activated it yourself, it's just that OL does it for you behind the scene :)

Bob, no offense. Maybe it's the way it's supposed to look with that OpenGL feature, but from an end user point of view it just looks wrong.

___________________________________

piccolo: "soon all new 2d alegro games will be better. after i finsh my MMRPG. my game will serve as a code reference. so you can understand and grab code from."
piccolo: "just wait until my invetion comes out its going to take the wii to the next leave of game play. it will run sony and microsoft out of busness if i dont let them use it aswell."

Thomas Fjellstrom
Member #476
June 2000
avatar

Quote:

Maybe it's the way it's supposed to look with that OpenGL feature, but from an end user point of view it just looks wrong.

That was his point.

--
Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro TODO]
"If you can't think of a better solution, don't try to make a better solution." -- weapon_S
"The less evidence we have for what we believe is certain, the more violently we defend beliefs against those who don't agree" -- https://twitter.com/neiltyson/status/592870205409353730

Bob
Free Market Evangelist
September 2000
avatar

Quote:

Bob, how come this effect is not visible on other GeForce cards?

It is. Really, try it. Polygon smoothing + blending / alpha testing = teh loss.

Polygon smoothing basically draws lines with attenuated alpha around the edges of the polygon, on the outside of it. That looks great if you never use blending, have one polygon by itself over some background, or are drawing only lines.

Otherwise, you see a "seam" between polygons, which is really one polygon bleeding and overlapping onto the next. That's because connected smoothed polygons don't tightly fit (by design); they overlap.

--
- Bob
[ -- All my signature links are 404 -- ]

HappyMonster @Home
Member #1,607
October 2001

I see. Thanks for explaining it clearly. :)

kdevil
Member #1,075
March 2001
avatar

I was also seeing this issue, on a GeForce 7900GT, and commenting out glEnable(GL_POLYGON_SMOOTH) worked. That line should be removed from OpenLayer entirely, otherwise OL games are going to look horrible on a lot cards. Besides, on other cards I don't see any real difference after removing that line.

-----
"I am the Black Mage! I casts the spells that makes the peoples fall down!"

Fladimir da Gorf
Member #1,565
October 2001
avatar

I guess you're right. After all the polygon smoothing isn't that important at all.

OpenLayer has reached a random SVN version number ;) | Online manual | Installation video!| MSVC projects now possible with cmake | Now alvailable as a Dev-C++ Devpack! (Thanks to Kotori)

 1   2 


Go to: