| Poster | : idirtyjeans | | Posts | : 2 | | Country | : Bangladesh | | City | : Dhaka |
| | | | Posted by idirtyjeans on 30/08/2008 at 22:06:40
| | Hello Riemer
When I ran your code I got this exception: "This device does not support 32-bit indices. Use IndexElementSize.SixteenBits or a type that has a size of two bytes."
What would be the solution to this problem by changing only the code - not my hardware? Please let me know.
Niaz
:) | |
|
|
| |
| |
| Poster | : kigunda | | Posts | : 7 | | Country | : Kenya | | City | : Nairobi |
| | | | Posted by kigunda on 31/08/2008 at 17:46:02
| | I found the same problem, i saw a post about that - you most likely have an intel gpu.
In what series and at what point of that code does it occur?
if its at the index buffer of the 4th series then change the values of index buffer to short like this
short[] terrainIndices = new short[(WIDTH - 1) * (HEIGHT - 1) * 6];
for (int x = 0; x < WIDTH - 1; x++)
{
for (int y = 0; y < HEIGHT - 1; y++)
{
terrainIndices[(x + y * (WIDTH - 1)) * 6] = (short)((x + 1) + (y + 1) * WIDTH);
terrainIndices[(x + y * (WIDTH - 1)) * 6 + 1] = (short)((x + 1) + y * WIDTH);
terrainIndices[(x + y * (WIDTH - 1)) * 6 + 2] = (short)(x + y * WIDTH);
terrainIndices[(x + y * (WIDTH - 1)) * 6 + 3] = (short)((x + 1) + (y + 1) * WIDTH);
terrainIndices[(x + y * (WIDTH - 1)) * 6 + 4] = (short)(x + y * WIDTH);
terrainIndices[(x + y * (WIDTH - 1)) * 6 + 5] = (short)(x + (y + 1) * WIDTH);
}
}
terrainIndexBuffer = new IndexBuffer(device, typeof(short), (WIDTH - 1) * (HEIGHT - 1) * 6, ResourceUsage.WriteOnly, ResourceManagementMode.Automatic);
terrainIndexBuffer.SetData(terrainIndices);
|
Its 2 a.m. here and i am tired so expect typos
| |
|
|
| |
| |
| Poster | : BlueAnorak | | Posts | : 1 | | Country | : United Kingdom | | City | : Herts |
| | | | Posted by BlueAnorak on 13/09/2008 at 19:17:42
| | Changing the line where the error occurs to the following should cure the problem:-
myIndexBuffer = new IndexBuffer(device, typeof(short), indices.Length, BufferUsage.WriteOnly);
| |
|
|
| |
| |
| Poster | : Anonymous | | Posts | : | | Country | : | | City | : |
| | | | Posted by Anonymous on 17/02/2010 at 12:25:48
| | I've been looking for a workaround because I too am also getting this error, and I tried the method where you change it to short, as shown below:
| myIndexBuffer = new IndexBuffer(device, typeof(int), indices.Length, BufferUsage.WriteOnly); |
But doing so gives me a new error:
Invalid Operation Exception:
The array is not the correct size for the amount of data requested. |
For the following code:
| myIndexBuffer.SetData(indices); |
As I stated, I've tried many workaroudns, including the methods shown above, only to run into even more errors. Any and all help would be much appreciated. | |
|
|
| |
| |
| Poster | : Anonymous | | Posts | : | | Country | : | | City | : |
| | | | Posted by Anonymous on 03/04/2010 at 21:36:19
| | Hi there i just found this topic, May i ask if there's a way to make the terrain wider for the device that does not support 32-bit index?
Thanks ;D | |
|
|
| |
| |
| Poster | : Anonymous | | Posts | : | | Country | : | | City | : |
| | | | Posted by Anonymous on 31/03/2011 at 05:54:39
| | | 8Z9zj3 <a href="http://nbrvigrmsjzn.com/">nbrvigrmsjzn</a>, [url=http://teftuykdqvuy.com/]teftuykdqvuy[/url], [link=http://zouphurnhrwn.com/]zouphurnhrwn[/link], http://aruxfncalvoo.com/ | |
|
|
| |
| |
| Poster | : Anonymous | | Posts | : | | Country | : | | City | : |
| | | | Posted by Anonymous on 09/01/2012 at 15:39:00
| | correct code for 16 bit indices in XNA 4.0:
| myIndexBuffer = new IndexBuffer(device, IndexElementSize.SixteenBits, indices.Length, BufferUsage.WriteOnly); |
| |
|
|
| |
| |
| Poster | : Scotticus | | Posts | : 1 | | Country | : USA | | City | : Narragansett, RI |
| | | | Posted by Scotticus on 12/01/2012 at 08:39:19
| | I would like to update the Series #2 Tutorial (Basic Terrain) in XNA 4.0 for the Reach setting.
I have made the changes of converting the Index Buffer to 16-Bit mode, then converting many pieces of data to "short" instead of integer.
One thought was to break the terrain into four sections and drawing them out individually.
I have been looking into Riemer's Quadtree tutorial from chapter 2 in his XNA book. Anyone know if that is going in the right direction or maybe point me in the right direction?
I am thinking there are many "Reach" users out there with Intel GPU-based laptops out there, so I would like to find a solution that may help with all the tutorials.
Thanks! | |
|
|