Is there any way to increase this limit? I need this to support more textures for my triplanar mapping shader. Maybe there’s a workaround by splitting a shader into multiple stages?
Here’s the error:
This is a hardware limit. You could atlas some texture, or if they’re the same resolution / format, you could use a texture array, similarly to PlayCanvas Examples
In that example, you only use texture2D once but for my shader, it is used 3 times per map I want to use. Do you mean that the amount uniforms used for textures counts as sampled textures or does it have to do with how many times you used texture2D? I just want to be sure.
The limit is related to how many texture uniforms you use in the shader. There is no limit of how many times you can sample each of those. Many shaders have loops and sample a texture 100 of times.
Thanks for the info, will try that soon!
I tried implementing texture arrays but there was a problem with the texture array format. I assigned the texture format to the texture array format because my shader can have a variety of texture formats. The format I had a problem with was the basis ETC compressed textures which gave me this warning:
My code should be able to assign any kind of texture to the texture arrays without problem.
Project: PlayCanvas | HTML5 Game Engine
Script: triplanar-mapping.js