public bool RenderTransition(IFrameBuffer from, IFrameBuffer to)
        {
            if (_tween.Task.IsCompleted)
            {
                return(false);
            }
            _visitTween();
            var oldShader = AGSGame.Shader;

            _screenVectors.Render(to.Texture);
            var shader = GLShader.FromText(_graphics.GetStandardVertexShader(), FRAGMENT_SHADER, _graphics).Compile();

            if (shader == null)
            {
                return(false);
            }
            shader.Bind();
            if (!shader.SetVariable("time", _time))
            {
                shader.Unbind();
                return(false);
            }
            _screenVectors.Render(from.Texture);

            if (oldShader != null)
            {
                oldShader.Bind();
            }
            else
            {
                shader.Unbind();
            }

            return(true);
        }
Beispiel #2
0
 public void Start()
 {
     _previousShader       = getActiveShader();
     _taskCompletionSource = new TaskCompletionSource <object> (null);
     _shakeShader          = GLShader.FromText(VERTEX_SHADER_SHAKE,
                                               _graphics.GetStandardFragmentShader(), _graphics);
     AGSGame.Game.Events.OnBeforeRender.Subscribe(onBeforeRender);
     setActiveShader(_shakeShader);
 }