Jump to content
Eternal Lands Official Forums
Sign in to follow this  
Leeloo

Radeon flashing

Recommended Posts

Not sure where this goes, but I guess programming is where I'll find the people who can help the most...

 

After upgrading X.org 6.8.1 -> 6.8.2 I have lots of flashing with DRI r200 (radeon) drivers - but only in some places. The pool in the *CO* map is one of these places, and the magic school meeting hall is another, but not in every place. But at #beam me up and on map 8 there is no flashing at all. If I disable hardware TCL (thus using software instead), I get no flashing at all, but half the framerate.

 

The flashing looks like about half the textures are fully lit, and the other half looks normal, but on the next frame, it's the opposite half of the textures that are fully lit.

 

According to goole, TCL is transform, clipping and lightning. So, it occured to me, this may have something to do with the lights... Do we have too many lights in those places? Could it be that where other cards just render half the lights on all textures, radeons instead render all the lights on half the textures?

 

EL is the only game I have that has this problem, and after I discovered that it only happens in some places, I have hope that it may help figure out what the problem is.

 

The card is a Radeon 9250.

Edited by Leeloo

Share this post


Link to post
Share on other sites

Played around with the map editor a bit. It seems it happens when ever there is a cave map with water (like the pool) visible on screen. It doesn't occur in outdoor maps like Isla Prima.

 

Making the pool grass stopped the flashing, and so did moving the camera away from the pool. And opening different cave maps showed the same thing - whenever there's cave water on the screen, the textures don't get lighted correctly.

 

What's different between cave water and outside water? Something that makes a difference between flashing textures and a perfect looking game, when using a Radeon card?

Share this post


Link to post
Share on other sites

The only difference is that they use a different texture.... Both water types are reflective and has a texture effect. You didn't fool around with your textures by any chance?

Share this post


Link to post
Share on other sites

I don't think so... Wait, now Isla Prima flashes too - I logged in in the exact same place where I tested before. The only thing that changed as far as I can tell is that it's dark now. Seems it's not the cave status of the water that causes the flashing, but the combination of darkness and water.

 

Or maybe it's the multiple lights afterall, they only come on at night. Seems I have some more testing to do.

 

Edit: Opened the mapeditor with the default blank map. Made some water at the edge. Changed the clock until it started to get dark. No flashing. Added one single light. Flashing :D Ok, the lights combined with water seems to be the problem.

Edited by Leeloo

Share this post


Link to post
Share on other sites

I have a Radeon 9600 with latest ATI drivers and I only know one place where I have a flickering problem. It's the fireplace in southern MM, close to the Naralik entry [183,56]. There are destroyed houses and interior parts around that fire place. The desk that is lying on the ground flickers.

 

I'm going to post screenshots, as soon as my ftp server is online again.

Share this post


Link to post
Share on other sites

I have a Radeon 9600 on my new laptop. And have installed Mepis on it, so I'd give it a try except that I can't get any hardware acceleration whatesoever... (only Mesa).

Share this post


Link to post
Share on other sites

Seems I didn't wrote what I thought I wrote, no wonder I didn't get the expected replies :lol:

 

What does EL do different than other games when it comes to lighting? EL is the only one I have the problem with, all the other GL-based programs and games I tried work fine. I tried comparing the lights code with Armagetron, which use the some functions, but with different values for e.g. diffuse, but I didn't have any luck solving it.

 

Yes, I'm trying to solve the problem myself, but I don't know anything about OpenGL programming, so I need lots of help :D

Share this post


Link to post
Share on other sites

I am sure this is a problem with the drivers for Linux.

On windows works fine on all the video cards with OpenGL support (except for some SiS and S3 cards that have various unrelated problems) and it works fine with Nvidia cards for Linux.

I don't know how your drivers are set up, but does it use MESA?

Share this post


Link to post
Share on other sites
I have a Radeon 9600 with latest ATI drivers and I only know one place where I have a flickering problem. It's the fireplace in southern MM, close to the Naralik entry [183,56]. There are destroyed houses and interior parts around that fire place. The desk that is lying on the ground flickers.

This seems a map bug to me, not card or rendering problem. I have the same flickering with this desk using a geforce3. Imho it's a problem with the heightmap.

Share this post


Link to post
Share on other sites
I am sure this is a problem with the drivers for Linux.

On windows works fine on all the video cards with OpenGL support (except for some SiS and S3 cards that have various unrelated problems) and it works fine with Nvidia cards for Linux.

I don't know how your drivers are set up, but does it use MESA?

I know it's a driver problem (Or possibly a hardware problem, since other people have reported the same problem with the ATI binary drivers). But the point is it only happens in EL, not in other games, so EL must be doing something different. If we can figure out the difference, it should be possible to fix (or workaround if you prefer that word) the problem in the EL code.

Share this post


Link to post
Share on other sites

I can't help since I don't have a Radeon to test it, but the best thing you can do IMO is go to draw_scene.c in function draw_scene(), and especially after the line 232, and start commenting things out. Since you say the problem shows when there's water, try to comment out first the code that handles reflections. That way you will be able to find out which function causes the problem.

Share this post


Link to post
Share on other sites
I can't help since I don't have a Radeon to test it, but the best thing you can do IMO is go to draw_scene.c in function draw_scene(), and especially after the line 232, and start commenting things out. Since you say the problem shows when there's water, try to comment out first the code that handles reflections. That way you will be able to find out which function causes the problem.

Unless you're really out of touch with CVS, please take gamewin.c and comment things out in display_game_handler() instead of in draw_scene.c.

Share this post


Link to post
Share on other sites

It seems (at least on IP in darkness) that draw_sky_background is where the problem lies. Commenting out glBegin(GL_QUADS) and the matching (I assume) glEnd() makes it stop flashing.

 

What does GL_QUADS do? Just tell OpenGL that it should expect 4 vertexes instead of 3? And in that case, can I just remove those two lines and send 6 vertexes instead (to make two triangles)?

 

As mentioned before, I know nothing about OpenGL :D

Share this post


Link to post
Share on other sites

Yes, that's what it does. You can try to send two triangles, but I don't really think this would help (we are usign quads for other functions, such as the HUD, fonts, etc.) and they don't cause any problems, right?

Share this post


Link to post
Share on other sites

I tried two triangles, and the flashing almost went away. Before, I had constant flashing, each frame would have the opposite textures lighted wrong, that doesn't happen now. But once in a while (a few times per minute), a single frame will flash, but at my current framerate I'm not able to see if it's even the same kind of flashing.

 

So, it's a big improvement :)

 

I guess I'll have to do the same thing later with the cave function (right now I'm more or less in bed with a cold).

 

Interesting that OpenGL just sends vertexes without defining which are supposed to fit together... I had expected some kind of triangle function that would take three vertexes. Just sending vertexes makes it easy to remove one vertex and have everything screwed up because it just picks a the first vertex of the next triangle.

Share this post


Link to post
Share on other sites

Tried replacing GL_QUADS with GL_TRIANGLES, and the flashing is back. It's only when the glBegin() and glEnd() lines are removed that it doesn't flash.

Share this post


Link to post
Share on other sites
Interesting that OpenGL just sends vertexes without defining which are supposed to fit together... I had expected some kind of triangle function that would take three vertexes. Just sending vertexes makes it easy to remove one vertex and have everything screwed up because it just picks a the first vertex of the next triangle.

Umm, you DO define what you are sending. That's why you use glBegin(GL_QUADS)/glEnd()

Share this post


Link to post
Share on other sites
Tried replacing GL_QUADS with GL_TRIANGLES, and the flashing is back. It's only when the glBegin() and glEnd() lines are removed that it doesn't flash.

I don't know a thing about openGL, but does it draw something when you remove those lines?Does it flash when you use the same color for all four vertices?

Share this post


Link to post
Share on other sites

AFAIK the glBegin() statement only sets the internal state machine of OpenGL to accept vertices, that form a primitive. The interpretation of any of the vertices declared between glBegin and glEnd is up to the parameter of glBegin().

 

This is from the red book command index (might also be available in the man-pages of glBegin/glEnd resp.)

 

hth

 

-----

glBegin, glEnd - delimit the vertices of a primitive or a group of like primitives

 

void glBegin( GLenum mode )

PARAMETERS

mode: Specifies the primitive or primitives that will be created from vertices presented between glBegin and the subsequent glEnd. Ten symbolic constants are accepted: GL_POINTS, GL_LINES, GL_LINE_STRIP, GL_LINE_LOOP, GL_TRIANGLES, GL_TRIANGLE_STRIP, GL_TRIANGLE_FAN, GL_QUADS, GL_QUAD_STRIP, and GL_POLYGON.

 

void glEnd( void )

 

DESCRIPTION

glBegin and glEnd delimit the vertices that define a primitive or a group of like primitives. glBegin accepts a single argument that specifies which of ten ways the vertices are interpreted. Taking n as an integer count starting at one, and N as the total number of vertices specified, the interpretations are as follows:

 

GL_POINTS

Treats each vertex as a single point. Vertex n defines point n. N points are drawn.

 

GL_LINES

Treates each pair of vertices as an independent line segment. Vertices 2n-1 and 2n define line n. N/2 lines are drawn.

 

GL_LINE_STRIP

Draws a connected group of line segments from the first vertex to the last. Vertices n and n+1 define line n. N-1 lines drawn.

 

GL_LINE_LOOP

Draws a connected group of line segments from the first vertex to the last, then back to the first. Vertices n and n+1 define line n. The last line, however, is defined by vertices N and 1. N lines are drawn.

 

GL_TRIANGLES

Treates each triplet of vertices as an independent triangle. Vertices 3n-2, 3n-1, and 3n define triangle n. N/3 triangles are drawn.

 

GL_TRIANGLE_STRIP

Draws a connected group of triangles. One triangle is defined for each vertex presented after the first two vertices. For odd n, vertices n, n+1, and n+2 define triangle n. For even n, vertices n+1, n, and n+2 define triangle n. N-2 triangles are drawn.

 

GL_TRIANGLE_FAN

Draws a connected group of triangles. One triangle is defined for each vertex presented after the first two vertices. Vertices 1, n+1, and n+2 define triangle n. N-2 triangles are drawn.

 

GL_QUADS

Treats each group of four vertices as an independent quadrilateral. Vertices 4n-3, 4n-2, 4n-1, and 4n define quadrilateral n. N/4 quadrilaterals are drawn.

 

GL_QUAD_STRIP

Draws a connected group of quadrilaterals. One quadrilateral is defined for each pair of vertices presented after the first pair. Vertices 2n-1, 2n, 2n+2, and 2n+1 define quadrilateral n. N/2-1 quadrilaterals are drawn. Note that the order in which vertices are used to construct a quadrilateral from strip data is different from that used with independent data.

 

GL_POLYGON

Draws a single, convex polygon. Vertices 1 through N define this polygon.

 

Only a subset of GL commands can be used between glBegin and glEnd. The commands are glVertex, glColor, glIndex, glNormal, glTexCoord, glEvalCoord, glEvalPoint, glMaterial, and glEdgeFlag. Also, it is acceptable to use glCallList or glCallLists to execute display lists that include only the preceding commands. If any other GL command is called between glBegin and glEnd, the error flag is set and the command is ignored.

 

Regardless of the value chosen for mode, there is no limit to the number of vertices that can be defined between glBegin and glEnd. Lines, triangles, quadrilaterals, and polygons that are incompletely specified are not drawn. Incomplete specification results when either too few vertices are provided to specify even a single primitive or when an incorrect multiple of vertices is specified. The incomplete primitive is ignored; the rest are drawn.

 

The minimum specification of vertices for each primitive is as follows: 1 for a point, 2 for a line, 3 for a triangle, 4 for a quadrilateral, and 3 for a polygon. Modes that require a certain multiple of vertices are GL_LINES (2), GL_TRIANGLES (3), GL_QUADS (4), and GL_QUAD_STRIP (2).

ERRORS

 

GL_INVALID_ENUM is generated if mode is set to an unaccepted value.

 

GL_INVALID_OPERATION is generated if a command other than glVertex, glColor, glIndex, glNormal, glTexCoord, glEvalCoord, glEvalPoint, glMaterial, glEdgeFlag, glCallList, or glCallLists is called between glBegin and the corresponding glEnd.

 

GL_INVALID_OPERATION is generated if glEnd is called before the corresponding glBegin is called, or if glBegin is called within a glBegin/glEnd sequence.

Share this post


Link to post
Share on other sites
Tried replacing GL_QUADS with GL_TRIANGLES, and the flashing is back. It's only when the glBegin() and glEnd() lines are removed that it doesn't flash.

I don't know a thing about openGL, but does it draw something when you remove those lines?Does it flash when you use the same color for all four vertices?

Not sure if it draws something or not, as it's the draw_sky_background that gives the problem, and seeing the sky is not that easy... I guess I should be able to see it in the water, but I'm not sure if there is any difference. But at least it's better than flickering until the problem gets solved.

 

Tried making all four corners the same color, but that didn't help either. However, I just noticed that as long as the camera is turning it doesn't flicker, only when it stays in the same position. I don't think that happened yesterday though. But how would a bug in the drivers know if the camera is moving or not? The drivers only see still images. The only thing that knows that is EL, could it be a bug in EL afterall, one that only happens with DRI drivers? Something like the old "pressing tab in a place with no map makes a random texture disappear" bug that only happened on Linux?

Edited by Leeloo

Share this post


Link to post
Share on other sites

Yeah, I noticed the same thing. This flickering is especially visible in the night - on SKF it makes playing almost impossible. I had to downgrade to 6.8.1, which solved this problem. But this is only workaround - I agree with Leloo and Malaclypse - it's rather a game bug than a driver problem.

Share this post


Link to post
Share on other sites

I would think that if the problem is solved by going back to 6.8.1, that that is a hint that it is a driver problem. Anyway, I've googled my ass off, and I can't find similar reports, so maybe it is something in EL. The thing is that I really don't know what it could be (though admittedly I don't know much about the graphics code). It's not that it's writing in some other glBegin/glEnd block, since all of them are closed. It's not that the vertices are in some weird order. Actually, I think it has nothing to do with draw[_dungeon]_sky_background itself.

Share this post


Link to post
Share on other sites

ATI is notorious for their drivers problems. AFAIK, Doom3 didn't even work with them, until ATI moved their ass and fixed some problems.

You might want to report the problem to ATI.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×