gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

DS development > Fairly randomly disappearing surfaces

#144264 - NeX - Tue Oct 30, 2007 11:59 pm

When I have a lot of 3D going on, certain triangles and quads go walkabout. I'm fairly sure it's got little or nothing to do with the vertice limit, as if one of the missing surfaces appears, they all do. I'm rendering 1300-1400 textured triangles and quads a frame, a little excessive maybe, but there is no visible drop below 60fps. I'm not culling at the moment, but what could be causing about 70-100 surfaces to disappear at the same time? Surely it'd be varying amounts? Of those triangles, there are 8 164 triangle character models. I've not even added heads, and the character models are spartan to say the least. So, could an overflow of the vertices buffer be causing simultaneous disappearance?
_________________
Strummer or Drummer?.
Or maybe you would rather play with sand? Sandscape is for you in that case.

#144265 - Lick - Wed Oct 31, 2007 12:01 am

I think, the DS hardware doesn't tell you you're over the polycount by lowering the fps, but by making poly's disappear? (Not sure)
_________________
http://licklick.wordpress.com


Last edited by Lick on Wed Oct 31, 2007 12:04 am; edited 1 time in total

#144266 - NeX - Wed Oct 31, 2007 12:02 am

Yes, but as polys disappear, shouldn't it be gradual? (etc. one then two then three) And not about 100 at once? Oh, wait a sec, some characters might be passing the 8192,8192,8192 boundaries. Could that cause disappearance?
_________________
Strummer or Drummer?.
Or maybe you would rather play with sand? Sandscape is for you in that case.

#144269 - DiscoStew - Wed Oct 31, 2007 12:55 am

Just in case....

Code:
4000604h - RAM_COUNT - Polygon List & Vertex RAM Count Register (R)

  0-11   Number of Polygons currently stored in Polygon List RAM (0..2048)
  12-15  Not used
  16-28  Number of Vertices currently stored in Vertex RAM       (0..6144)
  13-15  Not used


Anyways, I'm not sure why 100 would disappear. What is being done when this disappearing act happens? Is it something being done by user input, or is it a random occurrence?
_________________
DS - It's all about DiscoStew

#144271 - nce - Wed Oct 31, 2007 12:58 am

I never tried to go over the boundaries, but if this happen I think that your model will not 'disappeared' but just be drawn somewhere else...

What can give you this result is also the clipping of your model with the view frustrum, while I read that the clipping could create new triangles along the clipping plane.

But your problem could be somewhere else, while 8 * 164 gives you 1312 poly and as there are characters ( meaning mainly closed object nearly convex ) and you probably activate the Back face cull that gives you more or less 800 maybe 900 visible triangles....

question is, your 70-100 surfaces that disappear are they all on the same character or they disappear on all characters in parallele ?

( some of the old threads were speaking about a limit of poly that the raster can draw on one scan line though, but I never heard anybody testing this )
_________________
-jerome-

#144278 - sajiimori - Wed Oct 31, 2007 2:18 am

Going over the poly limit will drop whole chunks of geometry at a time. I'm not sure why that is...

#144289 - DiscoStew - Wed Oct 31, 2007 4:35 am

If any polygons are in the edge of the view volume, they will get split, and form new vertices/polygons. If they are completely outside of it, they won't get added to the RAM list.

Also, I'm pretty sure that there is a limit to the number of polygons that can get rendered per scanline.
_________________
DS - It's all about DiscoStew

#144303 - zeruda - Wed Oct 31, 2007 9:48 am

You should check what your polygon levels are. Use the glGetInt functions after you've called your rendering code and then printf the polygon_count and vertex_count values. Although from what I tested the DS can handle 2048 textures triangles and any more are simply not drawn. It doesn't sound like this is the problem though since you seem to be within the limits anyway and of course a bunch of polygons are disappearing. Are you using display lists for this?

Code:

int polygon_count = 0;
int vertex_count = 0;

glGetInt(GL_GET_VERTEX_RAM_COUNT, &vertex_count);
glGetInt(GL_GET_POLYGON_RAM_COUNT, &polygon_count);

#144322 - M3d10n - Wed Oct 31, 2007 4:22 pm

Also check your far plane. By default far plane clipping is disabled and any poligons which touch it will be skipped, instead of being clipped against it.

#144324 - elhobbs - Wed Oct 31, 2007 4:34 pm

you can also take a look at RDLINES_COUNT on GBATEK. This should indicate if complex geometry is causing display glitches.

#144326 - Hyouko - Wed Oct 31, 2007 4:37 pm

I've been having troubles with this myself, particularly when trying to render quads at an angle to the camera. I read somewhere on here that there can be issues with quads not rendering if they're not flat enough; is that true, and could it be part of the problem? If so, could it be fixed by using triangles instead of quads?

edit: also. far plane clipping. is the far plane one of the parameters for gluPerspective? and how does one set it to clip rather than simply drop polygons?

#144328 - NeX - Wed Oct 31, 2007 5:09 pm

The hundred polies are the ground quad and three out of four sections of the last character's legs. I'm not using display lists, I can't find anything that doesn't require expensive modelling software (I use TurboCAD because it's cheap) and doesn't run on the DS itself, thereby requiring DLDI. Which is completely incompatible with my card. The models are simply loaded in as lists of signed bytes for positions, and rendered with one GL_TRIANGLE per character and then the direct vertex commands (the fixed point ones, they seem to like signed bytes). It's hacky but it seems to work. Ish.
_________________
Strummer or Drummer?.
Or maybe you would rather play with sand? Sandscape is for you in that case.

#144362 - M3d10n - Thu Nov 01, 2007 2:49 am

Hyouko wrote:
Is the far plane one of the parameters for gluPerspective?

Yes.

Hyouko wrote:
How does one set it to clip rather than simply drop polygons?


Enable bit 12 when setting the polygon attribute (glPolyFmt). There isn't a pretty name for it, but it's documented at GBATEK:
http://nocash.emubase.de/gbatek.htm#ds3dpolygonattributes

#144370 - HyperHacker - Thu Nov 01, 2007 5:21 am

NeX wrote:
The hundred polies are the ground quad and three out of four sections of the last character's legs.
Are there any polygons lower than or equal to these, in terms of Y coordinate, that don't disappear?
_________________
I'm a PSP hacker now, but I still <3 DS.

#144408 - NeX - Thu Nov 01, 2007 6:06 pm

That's a point. Everything on and after the last character below a certain level appears to have disappearing problems. It's ok though - I've dropped to four characters in high detail and four in low, and the disappearances have stopped.
_________________
Strummer or Drummer?.
Or maybe you would rather play with sand? Sandscape is for you in that case.

#144419 - NeX - Thu Nov 01, 2007 9:02 pm

No problems now I've got rid of non-existent triangles (with an area of 0,0,0) and dropped to 162 triangles per character.
_________________
Strummer or Drummer?.
Or maybe you would rather play with sand? Sandscape is for you in that case.