private void Awake() { cam = GetComponent <Camera>(); cam.enabled = false; cam.orthographic = true; cam.aspect = 1; renderingCommand = new NativeList <CameraState>(10, Allocator.Persistent); idfs = new RenderTargetIdentifier[3]; RenderPipeline.AddRunnableObject(GetInstanceID(), this); }
private void OnEnable() { heightTempTex = new RenderTexture(MTerrain.HEIGHT_RESOLUTION * 4, MTerrain.HEIGHT_RESOLUTION * 4, 16, MTerrain.HEIGHT_FORMAT, 3); heightTempTex.useMipMap = true; heightTempTex.autoGenerateMips = false; heightTempTex.filterMode = FilterMode.Point; heightTempTex.antiAliasing = 1; heightTempTex.Create(); cam = GetComponent <Camera>(); cam.enabled = false; cam.orthographic = true; cam.aspect = 1; renderingCommand = new NativeList <CameraState>(10, Allocator.Persistent); idfs = new RenderTargetIdentifier[3]; RenderPipeline.AddRunnableObject(GetInstanceID(), this); }