OpenRA.Graphics.RgbaColorRenderer.SetViewportParams C# (CSharp) Method

SetViewportParams() public method

public SetViewportParams ( Size screen, float depthScale, float depthOffset, float zoom, int2 scroll ) : void
screen System.Drawing.Size
depthScale float
depthOffset float
zoom float
scroll int2
return void
        public void SetViewportParams(Size screen, float depthScale, float depthOffset, float zoom, int2 scroll)
        {
            shader.SetVec("Scroll", scroll.X, scroll.Y, scroll.Y);
            shader.SetVec("r1",
                zoom * 2f / screen.Width,
                -zoom * 2f / screen.Height,
                -depthScale * zoom / screen.Height);
            shader.SetVec("r2", -1, 1, 1 - depthOffset);
        }