I’m trying to modify the terrain material to support six textures (+the weight texture, so seven textures in total), but there seems to be an Urho limit of five textures and I can’t find a way around it.
I found this thread topic663.html with some hints, but haven’t found a solution.
Material:
<material>
<technique name="Techniques/TerrainBlend.xml" />
<texture unit="0" name="Textures/TerrainWeights2.png" />
<texture unit="1" name="Textures/r.png" />
<texture unit="2" name="Textures/y.png" />
<texture unit="3" name="Textures/g.png" />
<texture unit="4" name="Textures/c.png" />
<texture unit="5" name="Textures/b.png" />
<texture unit="6" name="Textures/m.png" />
<parameter name="MatSpecColor" value="0.5 0.5 0.5 16" />
<parameter name="DetailTiling" value="16 16" />
</material>
GLSL:
...
uniform sampler2D sWeightMap0;
uniform sampler2D sDetailMap1;
uniform sampler2D sDetailMap2;
uniform sampler2D sDetailMap3;
uniform sampler2D sDetailMap4;
uniform sampler2D sDetailMap5;
uniform sampler2D sDetailMap6;
//sampler2D sDetailMap5 : register(S5); // found this syntax in that thread, but it doesn't work at all
//sampler2D sDetailMap6 : register(S6);
...
I tried modifying the numbers of the texture units (in shader and material), but that gave weird viewport effects, distance based white-black twitching and numbers >=10 seem to be interpreted as 1.
I also tried changing the TextureUnit::MAX_MATERIAL_TEXTURE_UNITS and MAX_TEXTURE_UNITS inside GraphicsDefs.h, but that had no effect at all (even with rebuilding Urho).
I’m using Urho 1.32 with OpenGL on Windows 7.
Do I need to use special numbers or a different syntax somewhere?