How can I turn off texture filtering on procedurally generated textures?

Hi everyone, I’m using the script below to generate a terrain texture onto a plane using perlin noise. The problem is, I’m going for a pixel art look and all of the pixels are smoothed into eachother, which looks especially bad if the image is small, for example 16x16. Is there a way to turn off texture filtering in code for the generated texture so that I can get sharp pixels?

using UnityEngine;
using System.Collections;

public class PerlinExample : MonoBehaviour {

	public int pixWidth;
	public int pixHeight;
	public float xOrg;
	public float yOrg;
	public float scale = 1.0f;
	private Texture2D noiseTex;
	private Color[]pix;
	
	void Start(){
		noiseTex = new Texture2D(pixWidth, pixHeight);
		pix = new Color[noiseTex.width * noiseTex.height];
		renderer.material.mainTexture = noiseTex;
		CalcNoise();
	}
	
	void CalcNoise(){
		float y = 0.0f;
		while (y < noiseTex.height){
			float x = 0.0f;
			while (x < noiseTex.width){
				float xCoord = xOrg + x / noiseTex.width * scale;
				float yCoord = yOrg + y / noiseTex.width * scale;
				float sample = Mathf.PerlinNoise(xCoord, yCoord);
				pix[(int)y * (int)noiseTex.width + (int)x] = new Color(sample, sample, sample);
				x++;
			}
			y++;
		}
		noiseTex.SetPixels(pix);
		noiseTex.Apply();
	}
}

noiseTex.filterMode = FilterMode.Point;