Ejemplo n.º 1
0
        public UIForiaMaterialPool(Material material)
        {
            this.small   = new Material(material);
            this.medium  = new Material(material);
            this.large   = new Material(material);
            this.huge    = new Material(material);
            this.massive = new Material(material);

            this.small.EnableKeyword("BATCH_SIZE_SMALL");
            this.medium.EnableKeyword("BATCH_SIZE_MEDIUM");
            this.large.EnableKeyword("BATCH_SIZE_LARGE");
            this.huge.EnableKeyword("BATCH_SIZE_HUGE");
            this.massive.EnableKeyword("BATCH_SIZE_MASSIVE");

            this.smallBlock   = new UIForiaPropertyBlock(small, RenderContext.k_ObjectCount_Small);
            this.mediumBlock  = new UIForiaPropertyBlock(medium, RenderContext.k_ObjectCount_Medium);
            this.largeBlock   = new UIForiaPropertyBlock(large, RenderContext.k_ObjectCount_Large);
            this.hugeBlock    = new UIForiaPropertyBlock(huge, RenderContext.k_ObjectCount_Huge);
            this.massiveBlock = new UIForiaPropertyBlock(massive, RenderContext.k_ObjectCount_Massive);

            FixedRenderState state = FixedRenderState.Default;

            MaterialUtil.SetupState(small, state);
            MaterialUtil.SetupState(medium, state);
            MaterialUtil.SetupState(large, state);
            MaterialUtil.SetupState(huge, state);
            MaterialUtil.SetupState(massive, state);
        }
Ejemplo n.º 2
0
 public Path2D()
 {
     // can i get rid of draw call list and use object data instead?
     this.geometry                = GeometryData.Create();
     this.drawCallList            = new StructList <SVGXDrawCall>(4);
     this.transforms              = new StructList <Matrix4x4>(4);
     this.objectDataList          = new StructList <ObjectData>(4);
     this.fillStyles              = null;
     this.strokeStyles            = null;
     this.currentMatrix           = Matrix4x4.identity;
     this.currentFillStyle        = SVGXFillStyle.Default;
     this.currentStrokeStyle      = SVGXStrokeStyle.Default;
     this.currentFixedRenderState = new FixedRenderState(BlendState.Default, DepthState.Default);
     transforms.Add(currentMatrix);
 }
Ejemplo n.º 3
0
 public new void Clear()
 {
     base.Clear();
     matrixChanged = false;
     drawCallList.QuickClear();
     fillStyles?.QuickClear();
     strokeStyles?.QuickClear();
     transforms.size     = 0;
     objectDataList.size = 0;
     geometry.Clear();
     currentMatrix           = Matrix4x4.identity;
     currentFillStyle        = SVGXFillStyle.Default;
     currentStrokeStyle      = SVGXStrokeStyle.Default;
     currentShapeRange       = default;
     currentFixedRenderState = new FixedRenderState(BlendState.Default, DepthState.Default);
     transforms.Add(currentMatrix);
     if (renderStateList != null)
     {
         renderStateList.size = 0;
     }
 }