Hi,
How do you handle your huge terrains' textures? As i googled a little, irrlicht support up to 4 texture layers for each node. Is that correct? Because, for example in wow, terrains have a lot of different textures. Isn't that possible in irrlicht?
Terrain texture layer limit?
-
hybrid
- Admin
- Posts: 14143
- Joined: Wed Apr 19, 2006 9:20 pm
- Location: Oldenburg(Oldb), Germany
- Contact:
You can use as many textures as you want for a mesh, if you really need it you can put every face into its own meshbuffer and use a separate texture for it. The thing is, that there's a hard limit for textures used for one triangle . This technique, commonly referred to as multi-texturing, mixes the many textures together (or chooses among some of them) to color one triangle. The common limit for this on fixed function pipeline hardware (which is what Irrlicht uses for most materials) is 8, but many gfx card support even less. My nv6600, e.g., supports only 4.
You can alter the number of textures per triangle in Irrlicht versions up to 1.5.1 in the SMaterial.h file. Default is 4, but you can also put 8 there. This may lead to some problems, though, especially when using too many texture matrices. In Irrlicht 1.6, those problems will be resolved and you can safely choose any number from 1 to 8. If you need more than 8 textures per triangle, you will have to use shaders. Support for that many textures might require some more changes to Irrlicht, but maybe 8 will be enough for you.
You can alter the number of textures per triangle in Irrlicht versions up to 1.5.1 in the SMaterial.h file. Default is 4, but you can also put 8 there. This may lead to some problems, though, especially when using too many texture matrices. In Irrlicht 1.6, those problems will be resolved and you can safely choose any number from 1 to 8. If you need more than 8 textures per triangle, you will have to use shaders. Support for that many textures might require some more changes to Irrlicht, but maybe 8 will be enough for you.
-
hybrid
- Admin
- Posts: 14143
- Joined: Wed Apr 19, 2006 9:20 pm
- Location: Oldenburg(Oldb), Germany
- Contact:
Well, if you can separate your terrain mesh into parts which only use at most 4 textures, than this works right away. You just need to define the proper materials. If you cannot tell which of the 8 textures are used on which tri, you have to put all 8 textures into the matrial, which would require to change the number of allowed textures. But in most cases you will get around with the first solution, which also runs on smaller computers.
Strange. Under Windows and DX9 with SM3 a 6600 should support 16 textures (at least for programmable shaders)... Are your drivers (for whichever OS or 3D API you're using) reporting 4?hybrid wrote:My nv6600, e.g., supports only 4.
Irrlicht Demos: http://irrlicht.sourceforge.net/forum/viewtopic.php?f=6&t=45781
You might want to check out this thread where a patch for 16 textures is explained (scroll down quite much).
I'm using it for terrains and it is great.
I'm using it for terrains and it is great.
Last edited by Valmond on Thu Aug 13, 2009 8:31 am, edited 1 time in total.
GL_MAX_TEXTURE_UNITS_ARB = 4 - in fixed function pipelinesio2 wrote:Strange. Under Windows and DX9 with SM3 a 6600 should support 16 textures (at least for programmable shaders)... Are your drivers (for whichever OS or 3D API you're using) reporting 4?hybrid wrote:My nv6600, e.g., supports only 4.
GL_MAX_TEXTURE_IMAGE_UNITS_ARB = 16 - in shaders (SM2.0+)
So it's ok, 4 textures in fixed function are enought, so no differences for Windows/Linux/DirectX/OpenGL etc.
Library helping with network requests, tasks management, logger etc in desktop and mobile apps: https://github.com/GrupaPracuj/hermes