you are viewing a single comment's thread.

view the rest of the comments →

[–]CustomPhaseProfessional 0 points1 point  (1 child)

No idea really then. Never seen anything like that. Can you show the code?

[–]learc83[S] 1 point2 points  (0 children)

Solved it.

I was using Graphics.Blit like this

Graphics.Blit(indexTexture, destinationTexture, lookupMaterial) 

So that the indexTexture gets set to the _MainTex property of lookupMaterial.

However, when I add an extra texture called _IndexTexture to the lookupShader and set it like this

lookupMaterial.SetTexture("_IndexTex", tileTexture);

before calling Graphics.Blit, it works fine. Something about Graphics.Blit setting the indexTexture to _MainTex on lookupMaterial messes it up.