public ShadowsDirectional(int mapSize, IEnumerable <float> splits, float clipDistance = 100f) { MapSize = mapSize; _viewport = new Viewport(0, 0, MapSize, MapSize, 0, 1.0f); SetSplits(splits, clipDistance); }
public void OnSize(int width, int height, float fovY, float farZ) { _renderTargetWidth = width; _renderTargetHeight = height; _ambientMapViewport = new Viewport(0, 0, width / 2.0f, height / 2.0f, 0, 1); BuildFrustumFarCorners(fovY, farZ); BuildTextureViews(); }
public void OnSize(int width, int height, float fovY, float farZ) { _renderTargetWidth = width; _renderTargetHeight = height; _ambientMapViewport = new Viewport(0, 0, width / 2.0f, height / 2.0f, 0, 1); BuildFrustumFarCorners(fovY, farZ); BuildTextureViews(); }
public static DXViewport ConvertToViewport(Viewport3D vp) { DXViewport viewport = new DXViewport(); viewport.X = vp.Left; viewport.Y = vp.Top; viewport.Width = vp.Width; viewport.Height = vp.Height; return viewport; }
public QuaternionCam() { ZoomLevel = 0; nearClip = 0.1f; farClip = 100.0f; mProjection = Matrix.PerspectiveFovLH((float) Math.PI/4, Game.Context.Settings.AspectRatio, nearClip, farClip); mOrthoProjection = Matrix.OrthoLH(Game.Context.Settings.ScreenWidth, Game.Context.Settings.ScreenHeight, nearClip, farClip); Viewport = new SlimDX.Direct3D11.Viewport(0, 0, Game.Context.Settings.ScreenWidth, Game.Context.Settings.ScreenHeight, nearClip, farClip); }
public static DXViewport ConvertToViewport(Viewport3D vp) { DXViewport viewport = new DXViewport(); viewport.X = vp.Left; viewport.Y = vp.Top; viewport.Width = vp.Width; viewport.Height = vp.Height; return(viewport); }
public void SetMapSize(DeviceContextHolder holder, int value) { if (Equals(value, MapSize)) { return; } MapSize = value; _viewport = new Viewport(0, 0, MapSize, MapSize, 0, 1.0f); foreach (var split in Splits) { split.Buffer.Resize(holder, MapSize, MapSize, null); } }
public void GetTargets(out SlimDX.Direct3D11.DepthStencilView depthStencilView, out SlimDX.Direct3D11.RenderTargetView renderTargetView, out SlimDX.Direct3D11.Viewport viewport) { depthStencilView = _depthStencilView; renderTargetView = _renderTargetView; viewport = _viewport; }
public ShadowsDirectional(int mapSize) { _mapSize = mapSize; Splits = new [] { // new Split(5f), new Split(15f), new Split(50f), new Split(200f) }; for (var i = 1; i < Splits.Length; i++) { Splits[i].Camera.SmallerCamera = Splits[i - 1].Camera; } _viewport = new Viewport(0, 0, _mapSize, _mapSize, 0, 1.0f); }