コード例 #1
0
    void CreateSdiInputTextures(int count, int texWidth, int texHeight)
    {
        // Remember: if input videoFormat == SdiVideoFormat.SD_487I_59_94, that is, texHeight == 243
        // the upper field has one line more than the lower field.
        // UpperField = 244; LowerField = 243

        for (int i = 0; i < count; ++i)
        {
            if (options.inputCaptureFields && texHeight == 243 && i % 2 == 0)
            {
                sdiTexture[i] = new RenderTexture(texWidth, texHeight + 1, 32, RenderTextureFormat.ARGBFloat);
            }
            else
            {
                sdiTexture[i] = new RenderTexture(texWidth, texHeight, 32, RenderTextureFormat.ARGBFloat);
            }
            sdiTexture[i].name         = name;
            sdiTexture[i].isPowerOfTwo = false;
            sdiTexture[i].useMipMap    = false;
            sdiTexture[i].filterMode   = FilterMode.Trilinear;
            sdiTexture[i].wrapMode     = TextureWrapMode.Clamp;
            sdiTexture[i].Create();

            UtyGLNvSdi.SdiInputSetTexturePtr(i, sdiTexture[i].GetNativeTexturePtr(), sdiTexture[i].width, sdiTexture[i].height);

            // attach to texture only the existent video inputs
            int multiplier = options.inputCaptureFields ? 2 : 1;
            if (i < UtyGLNvSdi.SdiInputVideoCount() * multiplier)
            {
                sdiMaterials[i].mainTexture = sdiTexture[i];
            }
        }
    }
コード例 #2
0
    void CreateTextures(int count, int texWidth, int texHeight)
    {
        for (int i = 0; i < count; ++i)
        {
            sdiTexture[i]              = new RenderTexture(texWidth, texHeight, 32, RenderTextureFormat.ARGB32);
            sdiTexture[i].name         = name;
            sdiTexture[i].isPowerOfTwo = false;
            sdiTexture[i].wrapMode     = TextureWrapMode.Clamp;
            sdiTexture[i].Create();

            UtyGLNvSdi.SdiInputSetTexturePtr(i, sdiTexture[i].GetNativeTexturePtr(), sdiTexture[i].width, sdiTexture[i].height);

            int multiplier = options.inputCaptureFields ? 2 : 1;
            if (i < UtyGLNvSdi.SdiInputVideoCount() * multiplier)
            {
                sdiMaterials[i].mainTexture = sdiTexture[i];
            }
        }
    }
コード例 #3
0
ファイル: GLNvSdiInHD.cs プロジェクト: diegomazala/NvSdi
    void SetupTextures()
    {
        for (int i = 0; i < sdiInputTexture.Length; ++i)
        {
            if (sdiInputTexture[i] == null)
            {
                continue;
            }

            if (!sdiInputTexture[i].IsCreated())
            {
                if (!sdiInputTexture[i].Create())
                {
                    Debug.LogError("Could not create sdi input texture");
                }
            }

            UtyGLNvSdi.SdiInputSetTexturePtr(i, sdiInputTexture[i].GetNativeTexturePtr(), sdiInputTexture[i].width, sdiInputTexture[i].height);
        }
    }