Esempio n. 1
0
        public ClipContext(UIForiaSettings settings)
        {
            this.clipDrawMaterial   = new Material(settings.sdfPathMaterial);
            this.clearMaterial      = new Material(settings.clearClipRegionsMaterial);
            this.clearCountMaterial = new Material(clearMaterial);

            this.clearMaterial.SetColor(s_Color, Color.white);
            this.clearCountMaterial.SetColor(s_Color, new Color(0, 0, 0, 0));

            this.countMaterial     = new Material(settings.clipCountMaterial);
            this.blitCountMaterial = new Material(settings.clipBlitMaterial);
            this.clipMaterialPool  = new ClipMaterialPool(clipDrawMaterial);
            this.positionList      = new StructList <Vector3>();
            this.texCoordList0     = new StructList <Vector4>();
            this.texCoordList1     = new StructList <Vector4>();
            this.triangleList      = new StructList <int>();
            this.batchesToRender   = new StructList <ClipBatch>();
            this.clippers          = new LightList <ClipData>();
            this.meshPool          = new MeshPool();
            // todo -- dont use screen dimensions
            this.clipTexture       = new RenderTexture(Screen.width, Screen.height, 24, RenderTextureFormat.ARGB32);
            this.countTexture      = new RenderTexture(Screen.width, Screen.height, 24, RenderTextureFormat.ARGB32);
            this.clipTexture.name  = "UIForia Clip Draw Texture";
            this.countTexture.name = "UIForia Clip Count Texture";
            BlendState blendState = BlendState.Default;

            blendState.sourceBlendMode = BlendMode.One;
            blendState.destBlendMode   = BlendMode.One;
            blendState.blendOp         = BlendOp.Min;
            DepthState depthState = DepthState.Default;

            depthState.compareFunction = CompareFunction.Equal;
            depthState.writeEnabled    = true;

            MaterialUtil.SetupState(clipDrawMaterial, new FixedRenderState(blendState, depthState));
        }
Esempio n. 2
0
 public bool Equals(BlendState other)
 {
     return(m_WriteMask == other.m_WriteMask && m_SourceColorBlendMode == other.m_SourceColorBlendMode && m_DestinationColorBlendMode == other.m_DestinationColorBlendMode && m_SourceAlphaBlendMode == other.m_SourceAlphaBlendMode && m_DestinationAlphaBlendMode == other.m_DestinationAlphaBlendMode && m_ColorBlendOperation == other.m_ColorBlendOperation && m_AlphaBlendOperation == other.m_AlphaBlendOperation && m_Padding == other.m_Padding && check0 == other.check0 && check1 == other.check1);
 }