Page 1 of 1

Too Many Texture Nodes?

PostPosted: Sun Jun 17, 2018 9:22 pm
by JBT27
I have two sets of sampler nodes, each containing 7 sampler nodes and three lerps. I'm mixing various grass and rock maps to break up tiling on a 4km x 4km terrain mesh. However, I got this error:

Shader error in 'TopoConistonMaster': maximum ps_5_0 sampler register index (16) exceeded at line 73 (on d3d11)

If I disconnect a couple or so samplers, the error goes away. So I'm assuming I have exceeded some Unity limit.

Is there a limit to the number of samplers I can use in a tree? I thought I could build a tree like I can in an offline rendering 3D app, but perhaps not here.

Thanks.

Re: Too Many Texture Nodes?

PostPosted: Wed Jun 20, 2018 1:55 pm
by JBT27
Is 16 sampler nodes the limit? I can't find anything on the wiki about this.

Thanks.

Re: Too Many Texture Nodes?

PostPosted: Thu Jun 21, 2018 1:05 am
by Strkl
The same issue appears in unreal when doing to much texture sampling on material. To fix this you need to switch the UV sampling mode of the Textures to "Shared : Wrap", if there is an option like this in ASE, it should work !

Re: Too Many Texture Nodes?

PostPosted: Thu Jun 21, 2018 9:51 am
by JBT27
Thank you. I'll take a look and do some experimenting. Not sure why Amplify haven't responded to my question when they have answered later questions. Very frustrating. But thanks again - I'll see if that's a possibility. I hope so.

Re: Too Many Texture Nodes?

PostPosted: Mon Jun 25, 2018 4:36 pm
by Amplify_Borba
Hello, sorry for not getting back to you earlier, the ASE team was preparing for the Unite Berlin event at the time of your post and, as a result, we weren't able to provide the timely support that you'd expect from us.

Regarding the error you're getting, I can confirm that you are limited to a fixed amount of textures in DX11, and even though it states that you can use up to 16 samplers, the max number you can really use is lower than that and may vary according to your project. This is because a Unity Surface Shader may internally use some samplers for itself( e.g. if you are using light maps ).

There's only two ways around this limitation, you either reduce the amount of textures by packing some of them together or by creating a texture atlas. You can pack a bunch of them together as a texture array, which will let you use just one texture asset, the caveat being that all texture import settings between the textures that compose that array must be the same. For instance, if you are packing all 16 textures in there they all must be of the same size, or if one of them is a normal map in linear space they all must be normal maps in linear space.

We also offer a simple tool to allow you to create your own texture arrays. You can find it at Window>Amplify Shader Editor>Texture Array Creator.

Please let me know if this helps, and if you have any follow up questions, thanks!

Re: Too Many Texture Nodes?

PostPosted: Wed Jun 27, 2018 9:20 pm
by JBT27
Thanks for your reply - yes, very useful response. The texture array sounds like the answer, so I'll take a look at that - thanks very much.

Re: Too Many Texture Nodes?

PostPosted: Thu Jun 28, 2018 9:58 am
by Amplify_Borba
No problem, glad I was able to help!

Have you had the chance to rate and review Amplify Shader Editor? It would be awesome if you could share your experience with the Unity community, the Unity Asset Store thrives on user interaction and direct feedback.
Every bit helps, your feedback is extremely valuable to us!

Feel free to get back in touch if you have further issues or questions, thanks!