Ejemplo n.º 1
0
        internal void AddDepthPass(MyShadowmapQuery shadowmapQuery)
        {
            var worldToProjection = shadowmapQuery.ProjectionInfo.WorldToProjection;
            int frustumMask       = AddFrustum(ref worldToProjection);

            MyDepthPass pass = MyObjectPoolManager.Allocate <MyDepthPass>();

            pass.DebugName      = MyVisibilityCuller.ToString(shadowmapQuery.QueryType);
            pass.ProcessingMask = frustumMask;
            pass.ViewProjection = shadowmapQuery.ProjectionInfo.CurrentLocalToProjection;
            pass.Viewport       = shadowmapQuery.Viewport;
            pass.FrustumIndex   = shadowmapQuery.Index;

            pass.Dsv = shadowmapQuery.DepthBuffer;
            bool isCascade = shadowmapQuery.QueryType == MyFrustumEnum.ShadowCascade;

            pass.IsCascade         = isCascade;
            pass.DefaultRasterizer = isCascade
                ? MyRasterizerStateManager.CascadesRasterizerStateOld
                : MyRasterizerStateManager.ShadowRasterizerState;

            pass.PerFrame();

            RenderingPasses[Size - 1] = pass;
        }
Ejemplo n.º 2
0
        internal void AddDepthPass(ref MatrixD worldToProjection, Matrix viewProjectionLocal, MyViewport viewport, DepthStencilView depthTarget, bool isCascade, string debugName)
        {
            int frustumMask = AddFrustum(ref worldToProjection);

            MyDepthPass pass = MyObjectPoolManager.Allocate <MyDepthPass>();

            pass.DebugName      = debugName;
            pass.ProcessingMask = frustumMask;
            pass.ViewProjection = viewProjectionLocal;
            pass.Viewport       = viewport;

            pass.DSV = depthTarget;
            pass.DefaultRasterizer = isCascade ? MyRender11.m_cascadesRasterizerState : MyRender11.m_shadowRasterizerState;

            pass.PerFrame();

            RenderingPasses[Size - 1] = pass;
        }
Ejemplo n.º 3
0
        internal static void AddShadowCaster(BoundingFrustumD frustum, Matrix viewProjectionLocal, MyViewport viewport, DepthStencilView depthTarget, bool isCascade, string debugName)
        {
            var frustumMask = m_cullQuery.AddFrustum(frustum);

            MyDepthPass pass = new MyDepthPass();

            pass.DebugName = debugName;
            pass.Cleanup();
            pass.ProcessingMask = frustumMask;
            pass.ViewProjection = viewProjectionLocal;
            pass.Viewport       = viewport;

            pass.DSV = depthTarget;
            pass.DefaultRasterizer = isCascade ? MyRender11.m_cascadesRasterizerState : MyRender11.m_shadowRasterizerState;

            pass.PerFrame();

            m_wavefront.Add(pass);
        }