public void RenderBelow(IGameContext gameContext, IRenderContext renderContext)
            {
                renderContext.GraphicsDevice.Clear(Color.Green);

#if !MANUAL_TEST
                if (_frame >= _combinations.Count)
                {
                    return;
                }
#endif

                if (renderContext.IsCurrentRenderPass <I2DBatchedRenderPass>())
                {
                    _renderUtilities.RenderTexture(renderContext, Vector2.Zero, _texture);

                    var combination = _combinations[_frame % _combinations.Count];

                    if (combination.Item1)
                    {
                        renderContext.AppendTransientRenderPass(_invertPostProcess);
                    }

                    if (combination.Item2)
                    {
                        renderContext.AppendTransientRenderPass(_blurPostProcess);
                    }

                    if (combination.Item3)
                    {
                        renderContext.AppendTransientRenderPass(_customPostProcess);
                    }

                    renderContext.AppendTransientRenderPass(_captureInlinePostProcess);
                }
            }
Exemple #2
0
            public void RenderBelow(IGameContext gameContext, IRenderContext renderContext)
            {
                _isValidRun = _texture.IsReady;

                if (_texture.State == AssetReferenceState.Unavailable)
                {
                    throw new AggregateException(_texture.LoadingException);
                }

                if (_customPostProcess.Effect.State == AssetReferenceState.Unavailable)
                {
                    throw new AggregateException(_customPostProcess.Effect.LoadingException);
                }

                if (!_texture.IsReady || !_customPostProcess.Effect.IsReady)
                {
                    return;
                }

                renderContext.GraphicsDevice.Clear(Microsoft.Xna.Framework.Color.Green);

#if !MANUAL_TEST
                if (_frame >= _combinations.Count)
                {
                    return;
                }
#endif

                if (renderContext.IsCurrentRenderPass <I2DBatchedRenderPass>())
                {
                    _renderUtilities.RenderTexture(renderContext, Vector2.Zero, _texture);

                    var combination = _combinations[_frame % _combinations.Count];

                    if (combination.Invert)
                    {
                        renderContext.AppendTransientRenderPass(_invertPostProcess);
                    }

                    if (combination.Blur)
                    {
                        renderContext.AppendTransientRenderPass(_blurPostProcess);
                    }

                    if (combination.MakeRed)
                    {
                        renderContext.AppendTransientRenderPass(_customPostProcess);
                    }

                    renderContext.AppendTransientRenderPass(_captureInlinePostProcess);
                }
            }
        public void Render(IGameContext gameContext, IRenderContext renderContext)
        {
            if (renderContext.IsFirstRenderPass())
            {
                renderContext.AppendTransientRenderPass(_inspectorRenderPass);
            }

            if (renderContext.IsCurrentRenderPass <I3DRenderPass>())
            {
                _castingRay = gameContext.MouseRay;
                _inspectorRenderPass.CaptureMatricesFromCurrentRenderPass(renderContext);
            }

            if (renderContext.IsCurrentRenderPass <InspectorRenderPass>() && _physicsEngine != null)
            {
                RigidBody rigidBody = null;
                object    owner     = null;
                Vector3   normal    = default(Vector3);
                float     distance  = 0;
                if (_physicsEngine.Raycast(_castingRay, EliminateObjectsTooClose, ref rigidBody, ref owner, ref normal, ref distance))
                {
                    _rigidBodyRef.SetTarget(rigidBody);
                }
                else
                {
                    _rigidBodyRef.SetTarget(null);
                }

                if (_rigidBodyRef.TryGetTarget(out rigidBody) && rigidBody != null)
                {
                    rigidBody.EnableDebugDraw = true;
                    rigidBody.DebugDraw(new InspectorDebugDraw(renderContext, _debugRenderer));
                }
            }
        }
Exemple #4
0
 public override void Render(IGameContext gameContext, IRenderContext renderContext)
 {
     if (renderContext.IsFirstRenderPass())
     {
         renderContext.AppendTransientRenderPass(_renderPass);
     }
 }
 public override void Render(IGameContext gameContext, IRenderContext renderContext)
 {
     if (renderContext.IsFirstRenderPass())
     {
         renderContext.AppendTransientRenderPass(_renderPass);
     }
 }