…either not working or i didn’t get it right…
- Does this SetTexture really allow for multiple textures and keep gpu instancing working? It seems to good to be true?
UNITY_INSTANCING_BUFFER_START(Props)
UNITY_DEFINE_INSTANCED_PROP(sampler2D, _MainTex)
UNITY_INSTANCING_BUFFER_END(Props)
and:
fixed4 c = tex2D(UNITY_ACCESS_INSTANCED_PROP(Props, _MainTex), IN.uv_MainTex) * _Color;
this gives the following error:
sampler array index must be a literal expression
google wasn’t giving me much on this error
all in editor, windows 10, dx11 and inside a surface shader…
ps. works just fine with float4 colors etc.
EDIT: the answer seems to be Texture2DArray, and sending an index with it…
https://www.reddit.com/r/Unity3D/comments/6uueox/gpu_instancing_texture2darray/
reddit helped. I understand that unity is moving fast, but the documentation on most advanced topics is horrible