- Home /
How can I show my SetPixels() texture changes without having to zoom my orthographic camera?
Hello! This is my first question here on Unity Answers. I hope you can bear with me. :)
I'm working on flood fills on Unity, and while I'm already able to fill shapes on my Texture2D, I can only see the changes when I zoom in with my orthographic camera. When I zoom out, it goes back to looking like the original image. What is also weird is that this happens in both my editor and my game scene, as well as when I build it on Android.
I've also tried using images with different sizes, and it still behaves the same way.
This is what it looks like after filling a shape using SetPixels() when zoomed in. The red circle is originally white. Notice that the editor is not showing the change. The image's size is 1920x1080.
This is how it then looks like when you zoom out a bit. The game scene now doesn't show the change as well. I've also included the properties of the texture in the screenshot.
What can possibly be causing this? What can I do to prevent this? Am I missing something? Thank you for your time. :)
Answer by Leidenfrosty · Dec 26, 2018 at 08:09 PM
Found the answers! It's a bit silly, really. I had the updateMipmaps parameter on my texture2D.Apply set to false! Setting it to true did the trick!
user mmlr at stackoverflow elaborated on it a bit more for me. :) https://stackoverflow.com/questions/53936288/how-can-i-show-my-setpixels-texture-changes-without-having-to-zoom-my-orthogra/53936554#53936554
Your answer
Follow this Question
Related Questions
Painting stencil on a surface. 6 Answers
Setting pixels on a texture? 2 Answers
getPixel/setPixels or stencil eraser brush 2 Answers
Setpixels leads to a blank texture? 1 Answer
Baking decals into a texture 3 Answers