Texture arrays are supported in HLSL under DX10, but as Irrlicht is currently at DX9, what is the best way to support multiple textures for Irrlicht shaders?
For example, say 3D meshs have from 1 to 32 textures, and we want to fade the textures usind a single shader, is there a method to index to any required shader just by passing the total number of textures and using a loop in the shader?
HLSL Texture Array Support
Re: HLSL Texture Array Support
For now, Irrlicht doesn't support texture arrays. There is a patch to enable them under OpenGL though, and seems that no one is willing/able to create a DX11 driver.
The best way in Irrlicht, for now, is to have a texture atlas.
The best way in Irrlicht, for now, is to have a texture atlas.
"There is nothing truly useless, it always serves as a bad example". Arthur A. Schmitt
Re: HLSL Texture Array Support
not heard about a texture atlas, how does it work, any code samples?
Re: HLSL Texture Array Support
A texture atlas is to have all the textures in a single big texture, so you sample from portions of the texture, instead of the whole map; the drawback is that you have to take care of the boundaries of the textures and the mipmap levels
tex2Dlod may help you here, it samples directly from a specific mipmap level, just prevent it from reaching the first mipmap level in which your textures in the atlas will start to blend.
Say for instance that you have an atlas of 4096x4096 pixels which stores 64 512x512 textures. These will start to blend with each other when the mip level reaches the smallest level a 512x512 texture support, which is 11, beyond that, the textures will blend with each other, breaking the effect.
It is much more elaborate than a simple texture array, but it gives the same results, and reaches a wider range of hardware
tex2Dlod may help you here, it samples directly from a specific mipmap level, just prevent it from reaching the first mipmap level in which your textures in the atlas will start to blend.
Say for instance that you have an atlas of 4096x4096 pixels which stores 64 512x512 textures. These will start to blend with each other when the mip level reaches the smallest level a 512x512 texture support, which is 11, beyond that, the textures will blend with each other, breaking the effect.
It is much more elaborate than a simple texture array, but it gives the same results, and reaches a wider range of hardware
"There is nothing truly useless, it always serves as a bad example". Arthur A. Schmitt
Re: HLSL Texture Array Support
sadly thats no good for me, the textures are always unknown separate files.
with hlsl there is the register accessing, but i guess as i have 32 textures, I´ll just have to define 32 of them individually.
be great to get at least DX10 supported for Irr
with hlsl there is the register accessing, but i guess as i have 32 textures, I´ll just have to define 32 of them individually.
be great to get at least DX10 supported for Irr
Re: HLSL Texture Array Support
You can find a DX111 driver here:
http://irrlicht.sourceforge.net/forum/v ... =6&t=38510
We'll officially add Texture Arrays for Irrlicht in v2.0.
http://irrlicht.sourceforge.net/forum/v ... =6&t=38510
We'll officially add Texture Arrays for Irrlicht in v2.0.
Library helping with network requests, tasks management, logger etc in desktop and mobile apps: https://github.com/GrupaPracuj/hermes
Re: HLSL Texture Array Support
the dx10/11 is really functional and people trying it and giving us feed back would actualy help us find bug and feature that should work but don't faster at this point
but ya for dx9 the only way are texture atlasses
i had the same issue where the possible texture to be combined might not be the same from one time to the other so i wrote a shader that can take 16 texture and combine them to one texture and because i then render each mipmap level and run my own mipmap algo i have no texture bleeding
but ya for dx9 the only way are texture atlasses
i had the same issue where the possible texture to be combined might not be the same from one time to the other so i wrote a shader that can take 16 texture and combine them to one texture and because i then render each mipmap level and run my own mipmap algo i have no texture bleeding
Re: HLSL Texture Array Support
It's really bad form for realtime use to have models with a ton of maps. I know it's common with modelers, they must have a map for this and a map for that, but that just won't fly for realtime.
Oh, oh, shiny! I must have an opacity map, falloff map, freshnel map, pure poop map, pink reflections map, pink reflections skip map, world map, map of the local food store, and the fully detailed map for Diablo 3.
Rant over.
Oh, oh, shiny! I must have an opacity map, falloff map, freshnel map, pure poop map, pink reflections map, pink reflections skip map, world map, map of the local food store, and the fully detailed map for Diablo 3.
Rant over.