XNA Creators Club Online
Page 1 of 1 (7 items)
Sort Posts: Previous Next

HeightMapCollision - not support 32-bit indices

Last post 04-24-2008 10:08 AM by Nick Gravelyn. 6 replies.
  • 01-30-2008 10:08 AM

    HeightMapCollision - not support 32-bit indices

    Hello, I've a problem with HeightMapCollision sample.
    When I run, the debugger give me the following message:

    "this device does not support 32-bit indices"

    What I can do for fix this problem ?

    Thankx
  • 01-30-2008 11:05 AM In reply to

    Re: HeightMapCollision - not support 32-bit indices

    I'm having a similar problem when trying to utilize functionality similar to HeightMapCollision.  In addition, my error states "Use IndexElementSize.SixteenBits or a type that has a size of two bytes."  The break is occuring on this line:

    this.model = Game.Content.Load<Model>(terrainDataLocation);

    ...where I am initializing my terrain object.  terrianDataLocation is just a string that is pointing to an image asset.  I've specified both a jpeg that I made and the terrain.bmp file that is included in HeightMapCollision.  Both give the same error.

    For some reason, HeightMapCollision runs for me, but all I see is black instead of the terrain texture.  From the way the ball moves, it would *appear* that the collision routine is functioning, but the render isn't happening.  It looks like the entire terrain model doesn't load (so it isn't just a texture problem).

    I'm running this on a non-gaming laptop, although it runs every other demo from the XNA site I've tried.  My program is working fine on my desktop (along with Heightmap), which has much better hardware.


    EDIT
    -----
    I've just discovered that the HeightMapCollision code I was running was from XNA 1.0 Refresh.  When I attempt to run the XNA 2.0 version, it gives the error (instead of the blackspace).  So apparently this is something that's changed in 2.0...



    I would really appreciate any input on how to solve this.  Here is some relevant dxdiag output:


    ---------------
    Display Devices
    ---------------
            Card name: Mobile Intel(R) 915GM/GMS,910GML Express Chipset Family
         Manufacturer: Intel Corporation
            Chip type: Mobile Intel(R) 915GM/GMS,910GML Express Chipset Controller
             DAC type: Internal
       Display Memory: 128.0 MB
         Current Mode: 1280 x 768 (32 bit) (60Hz)
              Monitor: Plug and Play Monitor
      Monitor Max Res: 1600,1200
          Driver Name: ialmrnt5.dll
       Driver Version: 6.14.0010.3943 (English)
          DDI Version: 9 (or higher)
          WHQL Logo'd: Yes
      WHQL Date Stamp: n/a
                  VDD: n/a
             Mini VDD: ialmnt5.sys
          Video Accel:
     Deinterlace Caps: n/a
             Registry: OK
         DDraw Status: Enabled
           D3D Status: Enabled
           AGP Status: Not Available
  • 01-30-2008 11:25 AM In reply to

    Re: HeightMapCollision - not support 32-bit indices

    maxpinato:
    Hello, I've a problem with HeightMapCollision sample.
    When I run, the debugger give me the following message:

    "this device does not support 32-bit indices"

    What I can do for fix this problem ?

    Thankx

    It means that the sample needs a graphics card that supports 32 bit index buffers and your does not.

    So you can eitehr rewrite the sample to use 16 bit index buffers (meaning a max of 65536 vertices in the mesh) or you can buy a new graphics card.



    The ZBuffer News and information for XNA

    Please read the forum FAQs - Bug reporting
  • 01-30-2008 12:07 PM In reply to

    Re: HeightMapCollision - not support 32-bit indices

    Sorry for the multiple replies.  It would appear the problem is in the for loops that generate the vertices.  At least on my machine, anyway...

    TerrainProcessor.cs:
                // Create the individual triangles that make up our terrain.
                for (int y = 0; y < heightfield.Height - 1; y++)
                {
                    for (int x = 0; x < heightfield.Width - 1; x++)
                    {
                        AddVertex(builder, texCoordId, heightfield.Width, x, y);
                        AddVertex(builder, texCoordId, heightfield.Width, x + 1, y);
                        AddVertex(builder, texCoordId, heightfield.Width, x + 1, y + 1);

                        AddVertex(builder, texCoordId, heightfield.Width, x, y);
                        AddVertex(builder, texCoordId, heightfield.Width, x + 1, y + 1);
                        AddVertex(builder, texCoordId, heightfield.Width, x, y + 1);
                    }
                }

    I found that I could fix this problem by, oddly enough, dividing the heightfield.Height and heightfield.Width variables by 1.01f .  Why this works...? I have no idea.  lol.  My best guess is that maybe it tries to create too many verts without the division???  I'm just getting off of a lunch break, so I don't have any more time to mess with it.  But I thought you would like to know that you can run the demo by simply changing the for loop to :


                // Create the individual triangles that make up our terrain.
                for (int y = 0; y < heightfield.Height / 1.01f - 1; y++)
                {
                    for (int x = 0; x < heightfield.Width / 1.01f - 1; x++)
                    {
                        AddVertex(builder, texCoordId, heightfield.Width, x, y);
                        AddVertex(builder, texCoordId, heightfield.Width, x + 1, y);
                        AddVertex(builder, texCoordId, heightfield.Width, x + 1, y + 1);

                        AddVertex(builder, texCoordId, heightfield.Width, x, y);
                        AddVertex(builder, texCoordId, heightfield.Width, x + 1, y + 1);
                        AddVertex(builder, texCoordId, heightfield.Width, x, y + 1);
                    }
                }

    It appears on my end that you don't even have to change the portion of the code that makes the collision areas...so I'm guessing the terrain generated is very close to the original.

    Hope this helps!



  • 01-31-2008 7:15 AM In reply to

    Re: HeightMapCollision - not support 32-bit indices

    Poffarbacco, it works !!!!!! Great iddqdFTW, thanks.
  • 04-24-2008 3:06 AM In reply to

    Re: HeightMapCollision - not support 32-bit indices

    or just resize bitmap in photoshop to smaller than 250x250=)

    but exception still will come if you put bigger bitmap than original =(

    any ideas how to fix that?
  • 04-24-2008 10:08 AM In reply to

    Re: HeightMapCollision - not support 32-bit indices

    dorumon:
    or just resize bitmap in photoshop to smaller than 250x250=) but exception still will come if you put bigger bitmap than original =( any ideas how to fix that?


    Like ZMan said: buy a new graphics card. If yours doesn't support 32-bit indices you really don't have much choice if you want to use a larger image.
Page 1 of 1 (7 items) Previous Next
var gDomain='m.webtrends.com'; var gDcsId='dcschd84w10000w4lw9hcqmsz_8n3x'; var gTrackEvents=1; var gFpc='WT_FPC'; /*<\/scr"+"ipt>");} /*]]>*/
DCSIMG