I’m pretty new to shaders, so this is probably a simple fix. I have a wind shader on a tree that takes _MainTex from the sprite renderers sprite.
When I change the sprite in code, the sprite changes correctly but the wind completely stops blowing, and then I change it back to the original sprite in code and it works immediately. They are both the same dimensions and off the same sprite sheet with the same settings.
I would assume since the shader uses _MainTex that it would work fine but it doesn’t seem to. I also have tried taking the sprites out of a sprite atlas and the problem still persists. Any help appreciated. Thank you!
I wrote it with the underscore. Fortunately I found the issue. The shader is heavily y value dependent, and when changing the sprite to one UNDER the original sprite on the spritesheet, it went under my shader cutoff. A workaround I did was just rearranging the spritesheet to have all the sequencing sprites be the same y value.
Kind of strange, and I’m sure there’s a simpler workaround but it worked. I guess the UV or sample texture adheres to the original spritesheet coordinates even though I changes the sprite?