Graphics.DrawTexture with tiled material

So I’m using Graphics.DrawTexture to draw a texture on screen. And I tile it inside the given Rect by simply setting the tiling on the material which is passed to the DrawTexture function.
And so it is tiling.
But as soon as I’m using non power of two textures, it will clamp for the remaining pixel to closest power of two, before next tile.

Look at this image. This is a strange mix of having something clamping, and something tiled. And as you can see, the rendering of the image will clamp until it reaches 1024*1024 (width/height), and then the next tile will render.
Why is this? IS there a workaround? I would hate to only being able to work with power of two textures.
The orange frame and the numbers are overlays done by me, and is only to show how it tiles.

GUI.DrawTexture and a material? Are you sure?

Did you try to set the ScaleMode to ScaleAndCrop?

I’ve seen such “stretching” artifacts when dealing with GUIStyles and wrong border setting.

No, I wrote Graphics.DrawTexture :wink: Anyways, thanks for input, it actually look like some GUIStyle border issue, even though I have no idea if Graphics.DrawTexture could even use a style. I’ll look into it.

Oppss… Sorry! Forget everything I said :slight_smile: