Too many Textures in terrain material?

Hi,

I got the material editor error “X4510: maximum ps_5_0 sampler register index (16) exeeded”

So it seems like i have to many Textures in my material, but I need that many Textures. I there a way to go around this problem, like tweeking a Setting or somthing?

Thanks so far

-Siebencorgie

Yes, SM5 only supports 16 texture samples (http://msdn.microsoft.com/en-us/library/windows/desktop/hh447212(v=vs.85).aspx).
You can’t use all 16 either as some of them (I don’t remember how many) are used by lightmaps.

There are a few different things you can do to circumvent this issue though.

First thing you can do is to make some of your textures black and white and put them each into it’s own RGB+A channel in your texture sheet. So for example grass goes into the R channel, Sand into G, Rocks into B and gravel into A.
Then you just blend them with a color using multiply or what ever you prefer to give them color.
Now this doesn’t work with all textures very well as some might require more than one color but it works fairly well on ones that have more or less one color.

If you have a texture with let’s say gray rocks and brown sand around them you could mask out the sand into it’s own channel and the rocks in one then apply colors and lerp(Linear interpolate) them together in the material editor, that way you at least bring it down from 3 to 2 channels, freeing up one for use with another texture.

You can also remove the blue channel in normal maps and then use the Derive Normal Z function node to produce a similar result and save a channel so that you can fit two normal maps into the same sheet.

You can also use a monochromatic height map to produce normal maps using the height to normal function.
It doesn’t always produce a good result but often it does and this saves 2 channels for you. In some cases I’ve even been able to use the monochromatic diffuse from the base texture to produce a good looking result with this node.

Back in UDK we used to make texture atlases but without Text2Dgrad we can’t do that so we are even more limited until something changes. Epic is working on raising the limit form 16 to 32 which would make thing a lot easier but we can’t know when/if it will be implemented.

I just explained everything briefly, let me know if you have any questions and I’ll gladly help.

Thanks alot

at the moment i have 4 terrain layers which all have a Macro and a Detail textur, which are connected trough a Lerp so the 4 layers.Together they give me a Fully Painted landscape. That meens i have a lot of Textures.
I think Ill Blend the Lerp-Alpha textures in to one and use for Macro and Detail the Same Texture in diffrent sizes. That would save more than 50%^^

So thanks alot, I didnt knew most of this Tricks to save channels.

siebencorgie

How do you do this: First thing you can do is to make some of your textures black and white and put them each into it’s own RGB+A channel in your texture sheet. So for example grass goes into the R channel, Sand into G, Rocks into B and gravel into A. Then you just blend them with a color using multiply or what ever you prefer to give them color. Now this doesn’t work with all textures very well as some might require more than one color but it works fairly well on ones that have more or less one color.

Sorry, beginner here…

Image editing software. This is a different question and should be in its own thread.