[fixed]Texture Resolution & Max. Polygons
[fixed]Texture Resolution & Max. Polygons
Hey everybody
Since I'm pretty new to Irrlicht, I have 2 technical questions which I couldn't find anywhere.
1.) What's the maximum resolution for a texture? I tried 20000x10000px but it crashed instantly It doesn't depend on my Gfx-card, does it? (HD 4770)
2.) What's the max. polycount I can use for a single entity?
e.g. with addSphereSceneNode(50.0f, 1024)
thanks in advance
Since I'm pretty new to Irrlicht, I have 2 technical questions which I couldn't find anywhere.
1.) What's the maximum resolution for a texture? I tried 20000x10000px but it crashed instantly It doesn't depend on my Gfx-card, does it? (HD 4770)
2.) What's the max. polycount I can use for a single entity?
e.g. with addSphereSceneNode(50.0f, 1024)
thanks in advance
-
- Competition winner
- Posts: 1123
- Joined: Sun Jun 10, 2007 11:14 pm
ah ok, so seems like 8192x8192px is max for my card.
hm...
addSphereSceneNode(50.0f, 65536)
will not compile and gives some memory error.
besides, I made a weird observation:
addSphereSceneNode(50.0f, 1024) works just fine, whereas higher polycounts (> 4000) don't improve the sphere but turn it into a lowpoly-sphere again (looks like 16); and even higher values transform it into a cylinder with a cone on top
what's that about?
hm...
addSphereSceneNode(50.0f, 65536)
will not compile and gives some memory error.
besides, I made a weird observation:
addSphereSceneNode(50.0f, 1024) works just fine, whereas higher polycounts (> 4000) don't improve the sphere but turn it into a lowpoly-sphere again (looks like 16); and even higher values transform it into a cylinder with a cone on top
what's that about?
You can query the video driver to see what the maximum texture size is. Making very large textures is often just a waste of texture memory.Bate wrote:ah ok, so seems like 8192x8192px is max for my card.
Are you sure that won't compile? If it doesn't compile, it would be impossible for you to get a runtime memory error. If it is really a compile error, it might be useful for you to post the error message so that the rest of us can tell what is really going on, or file a bug with the compiler vendor.Bate wrote: addSphereSceneNode(50.0f, 65536)
will not compile and gives some memory error.
Have a look at the code for addSphereSceneNode() and createsphereMesh(). The polyCount parameter isn't the total poly count. Since the total number of indices available is 65536 for 16-bit index buffers, the sphere creation code has written to avoid creating spheres absurdly high vertex counts. The author decided it was best to limit the number of vertices instead of failing.Bate wrote:addSphereSceneNode(50.0f, 1024) works just fine, whereas higher polycounts (> 4000) don't improve the sphere but turn it into a lowpoly-sphere again (looks like 16); and even higher values transform it into a cylinder with a cone on top :D
It's mostly about you not looking at the source and assuming that you know what it does. Granted, the documentation isn't perfectly clear on this subject, but the source code _never_ lies.Bate wrote:what's that about?
32-bit indices do not defy numerical properties. If you have a 32-bit index buffer, the most verticies would be limited to 4,294,967,296.Lonesome Ducky wrote:Because of 16 bit indices, you can have a max of 65536 vertices, but if you get a patch for 32 bit indices you can have almost limitless.
Travis
-
- Competition winner
- Posts: 1123
- Joined: Sun Jun 10, 2007 11:14 pm
Of course not, but if there are 3 indices per triangle that's 1431655765 triangles. This is more than you could ever practically need for an in-game model in this day and age. It could very well change in the future, but it'll most likely be a while before in-game models reach that many trianglesvitek wrote:32-bit indices do not defy numerical properties. If you have a 32-bit index buffer, the most verticies would be limited to 4,294,967,296.Lonesome Ducky wrote:Because of 16 bit indices, you can have a max of 65536 vertices, but if you get a patch for 32 bit indices you can have almost limitless.
Travis
Alright, thanks guys. This clarifies a lot.
By the way, the reason why I don't look at the Irrlicht source is that I probably wouldn't really understand it. So for a start, I try to focus on Tutorials, Forum threads and the API which in fact, isn't entirely obvious to me at times.
Yes, it compiles but then crashes before the first rendering.
Unbehandelte Ausnahme bei 0x10081f26 in Test.exe:
0xC0000005: Zugriffsverletzung beim Schreiben an Position 0x00000000.
means:
Unhandled Exception at 0x10081f26 in Test.exe:
0xC0000005: Access Violation by writing at Position 0x00000000.
By the way, the reason why I don't look at the Irrlicht source is that I probably wouldn't really understand it. So for a start, I try to focus on Tutorials, Forum threads and the API which in fact, isn't entirely obvious to me at times.
Yes, it compiles but then crashes before the first rendering.
Code: Select all
ISceneNode* world = smgr->addSphereSceneNode(50.0f, 65536);
world->setMaterialTexture(0, driver->getTexture("data/world.jpg"));
world->setMaterialFlag(EMF_LIGHTING, false);
0xC0000005: Zugriffsverletzung beim Schreiben an Position 0x00000000.
means:
Unhandled Exception at 0x10081f26 in Test.exe:
0xC0000005: Access Violation by writing at Position 0x00000000.