I baked a texture with code. I then baked the same texture in blender.
The problem is, the image is upside down when I baked with code. This is how I am saving the output after baking a texture with cycles. Any clue where I went wrong?
Thanks in advance.
int channels = 4; ImageSpec spec(buffer_params.width, buffer_params.height, channels, TypeDesc::FLOAT); out->open(file_path, spec); // out->write_image(TypeDesc::FLOAT, pixels); out->write_image(TypeDesc::FLOAT, pixels, AutoStride, AutoStride, AutoStride);