Example #1
0
        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;
        }
Example #2
0
 public override void Execute(ShaderWindow window)
 {
     GL.Disable(Capability);
 }
Example #3
0
 public abstract void Execute(ShaderWindow window);
Example #4
0
 public override void Execute(ShaderWindow window)
 {
     window.Scissor = new RectangleF(X, Y, Width, Height);
 }
Example #5
0
 public override void Execute(ShaderWindow window)
 {
     GL.MemoryBarrier(Barriers);
 }
Example #6
0
 public override void Execute(ShaderWindow window)
 {
     GL.PolygonMode(Face, Mode);
 }
Example #7
0
 public override void Execute(ShaderWindow window)
 {
     GL.DepthFunc(Function);
 }
Example #8
0
 public override void Execute(ShaderWindow window)
 {
     GL.Hint(Target, Mode);
 }
Example #9
0
 public override void Execute(ShaderWindow window)
 {
     GL.PointSize(Size);
 }
Example #10
0
 public override void Execute(ShaderWindow window)
 {
     GL.LineWidth(Width);
 }
Example #11
0
 public override void Execute(ShaderWindow window)
 {
     GL.BlendFunc(SourceFactor, DestinationFactor);
 }
Example #12
0
 public override void Execute(ShaderWindow window)
 {
     GL.DepthMask(Enabled);
 }