Increase max textures from 8.

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
The_Glitch
Competition winner
Posts: 523
Joined: Tue Jan 15, 2013 6:36 pm

Increase max textures from 8.

Post by The_Glitch »

I'm using direct3d9 driver and I have a shader which use's some textures for details and other things but I'm only limited to 8 I tried changing it in the irrlicht config file from 8 to say 9 and recompiled which would be fine for my purposes but irrlicht ignores the last texture after 8. Have I done anything wrong?
hendu
Posts: 2600
Joined: Sat Dec 18, 2010 12:53 pm

Re: Increase max textures from 8.

Post by hendu »

Perhaps DX9 or your card (in DX9 mode) does not support more than 8 textures?
The_Glitch
Competition winner
Posts: 523
Joined: Tue Jan 15, 2013 6:36 pm

Re: Increase max textures from 8.

Post by The_Glitch »

Makes sense.
thanhle
Posts: 325
Joined: Wed Jun 12, 2013 8:09 am

Re: Increase max textures from 8.

Post by thanhle »

Why don't you combine all textures onto one. Then you can have many.

Regards
Ovan
Posts: 70
Joined: Thu Dec 18, 2008 12:41 am
Contact:

Re: Increase max textures from 8.

Post by Ovan »

you have <<_IRR_MATERIAL_MAX_TEXTURES_ 8>> defined in IrrCompileConfg.h
you must change E_TRANSFORMATION_STATE enumeration to add more texture matrix
else the engine iterator over an out-of-bound array of "irr::core::matrix4" if I remember (in 1.8)

http://irrlicht.sourceforge.net/forum/v ... =2&t=46838
since I use a mix of glsl and sampler2DArray (better performance, "less" transformation matrix)
The_Glitch
Competition winner
Posts: 523
Joined: Tue Jan 15, 2013 6:36 pm

Re: Increase max textures from 8.

Post by The_Glitch »

One solution I'm gonna try is vertex colors so I can remove the use of one texture being used as a mask. That should b sufficient enough for me.
Granyte
Posts: 850
Joined: Tue Jan 25, 2011 11:07 pm
Contact:

Re: Increase max textures from 8.

Post by Granyte »

In CD3D9Driver.cpp

the line 439 is

Code: Select all

    MaxTextureUnits = core::min_((u32)Caps.MaxSimultaneousTextures, MATERIAL_MAX_TEXTURES);
 
when it should be

Code: Select all

 MaxTextureUnits = MATERIAL_MAX_TEXTURES;
line 457

Code: Select all

    DriverAttributes->setAttribute("MaxSupportedTextures", (s32)Caps.MaxSimultaneousTextures);
    
should be

Code: Select all

DriverAttributes->setAttribute("MaxSupportedTextures", (s32)MATERIAL_MAX_TEXTURES);
 
The caps viewer only report the fixed pipeline capability and not the shader one so those limits are invalid


Apparently all my attempts to get this bug fixed have failed to this day
Nadro
Posts: 1648
Joined: Sun Feb 19, 2006 9:08 am
Location: Warsaw, Poland

Re: Increase max textures from 8.

Post by Nadro »

Hi,

I already sent a fix for this issue on SVN. At now it's possible to set up to 16 textures in D3D9 (I think that we should set 8/16 textures by default for v1.9).

Cheers,
Library helping with network requests, tasks management, logger etc in desktop and mobile apps: https://github.com/GrupaPracuj/hermes
Mel
Competition winner
Posts: 2292
Joined: Wed May 07, 2008 11:40 am
Location: Granada, Spain

Re: Increase max textures from 8.

Post by Mel »

Nice to hear we are finally getting 16 textures available for the materials :D
"There is nothing truly useless, it always serves as a bad example". Arthur A. Schmitt
The_Glitch
Competition winner
Posts: 523
Joined: Tue Jan 15, 2013 6:36 pm

Re: Increase max textures from 8.

Post by The_Glitch »

Does this work for ShaderPipeline or just the trunk that has cubemap support?
Nadro
Posts: 1648
Joined: Sun Feb 19, 2006 9:08 am
Location: Warsaw, Poland

Re: Increase max textures from 8.

Post by Nadro »

Only trunk. Shader-pipeline is deprecated, I'll prepare new FVF branch soon, designed for D3D12/Vulkan requirments.
Library helping with network requests, tasks management, logger etc in desktop and mobile apps: https://github.com/GrupaPracuj/hermes
The_Glitch
Competition winner
Posts: 523
Joined: Tue Jan 15, 2013 6:36 pm

Re: Increase max textures from 8.

Post by The_Glitch »

I only use ShaderPipeline for Hardware Skinning and custom vertex format, is this any reason to stick with it as it seems a lot of things have changed.
Nadro
Posts: 1648
Joined: Sun Feb 19, 2006 9:08 am
Location: Warsaw, Poland

Re: Increase max textures from 8.

Post by Nadro »

You shouldn't use shader-pipeline anymore and switch to trunk. When I'll release the new FVF branch most of your stuff from trunk will be working in that branch too (of course a stuff related to vertices handling will need slightly modifications).
Library helping with network requests, tasks management, logger etc in desktop and mobile apps: https://github.com/GrupaPracuj/hermes
Granyte
Posts: 850
Joined: Tue Jan 25, 2011 11:07 pm
Contact:

Re: Increase max textures from 8.

Post by Granyte »

Nadro some of us are stuck on the shader-pipeline branch because ou projects depends heavily on it's feature
The_Glitch
Competition winner
Posts: 523
Joined: Tue Jan 15, 2013 6:36 pm

Re: Increase max textures from 8.

Post by The_Glitch »

I agree with Granyte I worked out all the issues with Hardware skinning and my various shaders and when I gave the trunk a try I wasn't able to use HWS anymore, the other things I don't really mind. I really wanted to use cubemaps.
Post Reply