Exemplo n.º 1
0
    // Use this for initialization
    void Start()
    {
        AsyncTextureReader.InitDebugLogs();

        Pixels = new byte[DebugTexture.width * DebugTexture.height * 4];


        Debug.Log("Request Status: " + AsyncTextureReader.RequestTextureData(DebugTexture));
        Debug.Log("Retrieve Status: " + AsyncTextureReader.RetrieveTextureData(DebugTexture, Pixels));
    }
Exemplo n.º 2
0
    // Use this for initialization
    void Start()
    {
        _buffer = new ComputeBuffer(4, sizeof(float));
        _buffer.SetData(new float[] { 1, 2, 3, 4 });

        AsyncTextureReader.InitDebugLogs();

        Pixels = new byte[DebugTexture.width * DebugTexture.height * 4];

        Debug.LogFormat("Frame: {0}; Request Status: {1}", Time.frameCount, AsyncTextureReader.RequestTextureData(DebugTexture));
        Debug.LogFormat("Frame: {0}; Retrieve Status: {1}", Time.frameCount, AsyncTextureReader.RetrieveTextureData(DebugTexture, Pixels));

#if UNITY_5_5_OR_NEWER
        AsyncTextureReader.RequestBufferData(_buffer);
#endif
    }