Generated texture is black unless fiddled with
Hey, sorry for the title, I never know how to describe the situation in a short way.
In my game, I'm generating procedural textures for planets and stars. So... it works. It works really well, except for one thing.
This is what it looks like:
Nice, isn't it... Apart from few black spots. Well, this happens when I regenerate it (just exit and hit play again, it chooses random seed each run):
So I thought: "Hm... I must've messed up the code somehow.", so I checked everything, and realized everything was right...
I've found out, that if I double-click on the generated texture in the material, it will show some options in the inspector (aniso-level, wrap mode, and filter mode), and when I change ANYTHING there, the texture fills up. I've also tried saving the generated texture, and it saves it whole, with no black pixels.
Anybody experienced anything similar? Should I report this as a bug?
I'll probably crosspost to reddit as well, thanks :)
Answer by webik150 · Sep 23, 2015 at 05:17 PM
Oh whoeverisupthere! I'm so stupid.
I only forgot to add
myTexture.Apply();
to the code....
Wow...
I tried that and the Unity still thinks the texture is black. I am trying to read the pixel value from it, but they just keep co$$anonymous$$g up as completely black
Your answer
Follow this Question
Related Questions
2D Sprite.Create isn't working 0 Answers
Applying one sprite/texture across multiple gameobjects. (2D) 0 Answers
[SOLVED] Problems creating a Sprite through script 0 Answers
Memory Leaks when play pictures from local card using Sprite.Create 1 Answer
How to make headlight effects on a sprite? (Increasing emission of sprite material) 0 Answers