Hello!
I am trying to multiply two textures together and output the result on to a plane for testing purposes. The textures are read/write enabled. The issue is that although I receive no errors in the console the output texture is always blank. I have tried to just get the pixels from one of the input textures and then set them to the output without altering them in any way but I still end up with the same error.
Code posted below;
using UnityEngine;
using System.Collections;
public class TextureBlend : MonoBehaviour {
public Texture2D noise1;
public Texture2D noise2;
public GameObject target_Object;
Color[] _noise_Array1;
Color[] _noise_Array2;
Color[] _output_Array;
Texture2D output_Texture;
// Use this for initialization
void Start () {
output_Texture = new Texture2D (256, 256);
_noise_Array1 = noise1.GetPixels();
_noise_Array2 = noise2.GetPixels();
for (int i = 0; i < (256*256); i++) {
_noise_Array1 <em>*= _noise_Array2*;*</em>
* }*
* _output_Array = _noise_Array1;*
* output_Texture.SetPixels (_output_Array);
target_Object.renderer.material.mainTexture = output_Texture;*
* }*
}
Any ideas?