- Home /
Question by
link1375 · Dec 16, 2017 at 06:18 PM ·
texturetexture2dpixelcolor change
How to create an own Texture i.e. how to dye pixels?
I tried two Methods. First I created a new Texture2D(width, height)
and started to setPixel(x,y, color)
but instead of coloring each pixel in the the desired color the all the pixels from the whole texture have the same color even if I dye just one pixel. So I created a blank png (transparen i.e. alpha channel = 0) and set the texture of the`RawImage` to this png. In the settings I set the png as readable/writeable. In the code I did the same like above and tried to redye single pixels but again the whole texture had the same color in the end. My purpose: create a Texture where only the pixels I want to colorize get colorized and the other pixels are transparent (so alpha channel = 0). Have you any ides to implement this?
Comment