예제 #1
0
    protected void SetOneMaterial(Material mat, int index, int sum, Rect rc, PanoManager.EPANOTEXTUREMODE texMode, PanoManager.PanoTextureForOneDevice texDevice)
    {
        ATrace.Log(string.Format("SetOneMaterial: index:{0} sum:{1} rc:{2}", index, sum, rc.ToString()));
        PanoManager.PanoTextureForOneDevice dv = texDevice;

        if (texMode == PanoManager.EPANOTEXTUREMODE.EPM_YUV)
        {
            if (dv._TextureArr.Length > 0)
            {
                SetOneMaterialOneParam(mat, index, sum, rc, dv._TextureArr[0], "_MainTex");
            }
            if (dv._TextureArr.Length > 1)
            {
                SetOneMaterialOneParam(mat, index, sum, rc, dv._TextureArr[1], "_MainTexU");
            }
            if (dv._TextureArr.Length > 2)
            {
                SetOneMaterialOneParam(mat, index, sum, rc, dv._TextureArr[2], "_MainTexV");
            }
        }
        else if (texMode == PanoManager.EPANOTEXTUREMODE.EMP_RGB)
        {
            if (dv._TextureArr.Length > 0)
            {
                SetOneMaterialOneParam(mat, index, sum, rc, dv._TextureArr[0]);
            }
        }
        else if (texMode == PanoManager.EPANOTEXTUREMODE.EPM_SurfaceToTexture)
        {
            if (dv._TextureArr.Length > 0)
            {
                SetOneMaterialOneParam(mat, index, sum, rc, dv._TextureArr[0]);
            }
        }
    }
예제 #2
0
    public override void ResetTexture()
    {
        Texture rtex = PanoManager.Instance.GetRenderTexture();

        PanoManager.PanoTextureForOneDevice dv = PanoManager.Instance.GetPanoTextureDeviceArr(0);
        Texture[] texarr = dv._TextureArr;

        _HalfSphereMesh.sharedMaterial.SetTexture("_MainTex", rtex);

        if (texarr.Length > 0)
        {
            //Shader shader = PanoManager.Instance.GetCurrentShader();

            Material mat = new Material(_PlaneMesh.sharedMaterial.shader);
            _PlaneMesh.sharedMaterial      = mat;
            _PlaneMeshClone.sharedMaterial = mat;

            PanoManager.EPANOTEXTUREMODE texmode = PanoManager.Instance.GetTextureMode();

            SetPlaneMeshMaterial(texmode, texarr, mat);
        }
    }