Texture2D.setpixels drawing transparent pixels?

I’m trying to make a drawing program using SetPixels but whenever it sets a pixel it is setting it to be transparent. Anyone know what I’m doing wrong?

tex.SetPixel(position.x,position.y,new Color32(3,5,3,255));

5824081--617236--upload_2020-5-9_12-4-46.png

It is possible your pixels are being set just fine, but your actual display is not 1-to-1 mapped, so you are getting bilinear filtering of the pixels before display, i.e., a black and white pixel are being blended to show on the screen.

Make sure you set the filter mode on your draw texture to Point, and ensure the target display area can show ALL the pixels (i.e, 100x50 is displayed in 100x50 area of the screen).

To test my first theory, you could use the encode to a PNG and save it to disk, pull it up in your favorite 2D texture viewer:

1 Like

I tested it and youre right
.5824702--617350--SavedScreen.png


Thank you for the reply

hey I’m having some trouble rendereing the image onto a raw image component on a canvas. I’ve messed around with the tile and scale settings and still the entire texture isnt rendering.
Any advice ?