コード例 #1
0
 public void RenderPass(DeviceContext context, RenderingPass pass, ShaderResourceView occlusionInfosView)
 {
     if (pass.Layer == RenderingLayer.TwoSidedOpaque)
     {
         Render(context, occlusionInfosView);
     }
 }
コード例 #2
0
    public void RenderPass(DeviceContext context, RenderingPass pass)
    {
        if (pass.Layer != RenderingLayer.UiElements)
        {
            return;
        }

        if (pass.OutputMode != OutputMode.Standard)
        {
            throw new InvalidOperationException();
        }

        context.InputAssembler.PrimitiveTopology = PrimitiveTopology.TriangleStrip;

        context.VertexShader.Set(vertexShader);
        context.VertexShader.SetConstantBuffer(2, menuToControllerSpaceTransform.Buffer);

        context.PixelShader.Set(pixelShader);
        context.PixelShader.SetShaderResource(ShaderSlots.MaterialTextureStart, menuViewTexture);

        for (uint deviceIdx = 0; deviceIdx < OpenVR.k_unMaxTrackedDeviceCount; ++deviceIdx)
        {
            if (!controllerManager.StateTrackers[deviceIdx].MenuActive)
            {
                continue;
            }

            context.VertexShader.SetConstantBuffer(1, trackedDeviceBufferManager.GetObjectToWorldSpaceTransformBuffer(deviceIdx));

            context.Draw(2 * 20, 0);
        }
    }
コード例 #3
0
    public void RenderPass(DeviceContext context, RenderingPass pass)
    {
        if (!model.IsVisible)
        {
            return;
        }

        renderer.RenderPass(context, pass);
    }
コード例 #4
0
    public void RenderPass(DeviceContext context, RenderingPass pass)
    {
        context.VertexShader.SetConstantBuffer(1, modelToWorldTransform.Buffer);

        parentFigure.RenderPass(context, pass);
        foreach (var figure in childFigures)
        {
            figure.RenderPass(context, pass);
        }
    }
コード例 #5
0
    public void RenderPass(DeviceContext context, RenderingPass pass)
    {
        iblEnvironment.Apply(context.PixelShader);

        if (pass.Layer == RenderingLayer.OneSidedOpaque)
        {
            bool depthOnly = pass.OutputMode == OutputMode.FalseDepth;
            //backdrop.Render(context, depthOnly);
            floor.Render(context, depthOnly);
            renderModelRenderer.Render(context, depthOnly);
            //primitiveRenderer.Render(context, depthOnly);
        }

        actor.RenderPass(context, pass);
        menu.RenderPass(context, pass);
    }
コード例 #6
0
    public void RenderPass(DeviceContext context, RenderingPass pass)
    {
        context.InputAssembler.PrimitiveTopology = PrimitiveTopology.TriangleList;
        context.InputAssembler.InputLayout       = inputLayout;
        context.InputAssembler.SetVertexBuffers(0, vertexRefiner.RefinedVertexBufferBinding);

        var vertexShaderForMode = pass.OutputMode == OutputMode.FalseDepth ? falseDepthVertexShader : vertexShader;

        context.VertexShader.SetShaderResource(0, texturedVertexInfoPairsView);
        context.VertexShader.Set(vertexShaderForMode);

        foreach (int surfaceIdx in surfaceOrder)
        {
            var  surface  = surfaces[surfaceIdx];
            var  material = materialSet.Materials[surfaceIdx];
            bool isUnorderedTransparent = areUnorderedTransparent[surfaceIdx];

            var opaqueLayer      = isOneSided ? RenderingLayer.OneSidedOpaque : RenderingLayer.TwoSidedOpaque;
            var transparentLayer = isUnorderedTransparent ?
                                   RenderingLayer.UnorderedTransparent :
                                   (isOneSided ? RenderingLayer.OneSidedBackToFrontTransparent : RenderingLayer.TwoSidedBackToFrontTransparent);

            ShaderResourceView secondaryNormalMap = shapeNormals?.NormalsMapsBySurface[surfaceIdx];

            if (pass.Layer == opaqueLayer)
            {
                material.Apply(context, pass.OutputMode, secondaryNormalMap);
                surface.DrawOpaque(context);
                material.Unapply(context);
            }

            if (pass.Layer == transparentLayer)
            {
                material.Apply(context, pass.OutputMode, secondaryNormalMap);
                surface.DrawTransparent(context);
                material.Unapply(context);
            }
        }

        context.VertexShader.SetShaderResource(0, null);
    }
コード例 #7
0
 public void RenderPass(DeviceContext context, RenderingPass pass)
 {
     figureGroup.RenderPass(context, pass);
 }
コード例 #8
0
 public void RenderPass(DeviceContext context, RenderingPass pass)
 {
     renderer.RenderPass(context, pass);
 }