internal SceneCamera(Assimp.Camera camera, ShaderWindow window, SceneNode node) { getProjectionMatrix = () => { var aspectRatio = camera.AspectRatio; if (aspectRatio == 0) { var viewport = window.Viewport; aspectRatio = (viewport.Width * window.Width) / (viewport.Height * window.Height); } // convert 1/2 horizontal FOV to full vertical FOV var fovy = 2 * Math.Atan(Math.Tan(camera.FieldOfview) / aspectRatio); return(Matrix4.CreatePerspectiveFieldOfView( (float)fovy, aspectRatio, camera.ClipPlaneNear, camera.ClipPlaneFar)); }; Name = camera.Name; Node = node; }
public override void Execute(ShaderWindow window) { GL.Disable(Capability); }
public abstract void Execute(ShaderWindow window);
public override void Execute(ShaderWindow window) { window.Scissor = new RectangleF(X, Y, Width, Height); }
public override void Execute(ShaderWindow window) { GL.MemoryBarrier(Barriers); }
public override void Execute(ShaderWindow window) { GL.PolygonMode(Face, Mode); }
public override void Execute(ShaderWindow window) { GL.DepthFunc(Function); }
public override void Execute(ShaderWindow window) { GL.Hint(Target, Mode); }
public override void Execute(ShaderWindow window) { GL.PointSize(Size); }
public override void Execute(ShaderWindow window) { GL.LineWidth(Width); }
public override void Execute(ShaderWindow window) { GL.BlendFunc(SourceFactor, DestinationFactor); }
public override void Execute(ShaderWindow window) { GL.DepthMask(Enabled); }