Dynamic Textures Under 256x256
I am creating my own lighting engine of sorts and I am at the point where I am building the textures. I've run into an issue with the textures getting corrupted if the resolution of the texture is lower than 256x256.
It looks like this:
This is supposed to be all black.
Here's the code where I create the actual texture. This part seems to work fine, and gives me a solid white texture. I call
This code works totally fine if the image is at least 256x256, but anything less than that and it gets all garbled like the picture.
Here it is with a 256x256 resolution (this is with a light applied, so it's not just an all black image. The first one is supposed to be all black, but is garbled):
What am I missing?
One thing I've noticed is the top half of the image seems to work most of the time, but the bottom half is all messed up. It's like all of the data is shifted up to the top. It's still not working properly in the top, but it looks more correct than the bottom.
Follow this question
Once you sign in you will be able to subscribe for any updates here