コード例 #1
0
    private void Render(DeviceContext context, ShaderResourceView occlusionInfosView)
    {
        context.InputAssembler.InputLayout = inputLayout;
        meshBuffers.Bind(context.InputAssembler);

        context.VertexShader.Set(vertexShader);
        context.VertexShader.SetShaderResources(0, surrogateFacesView, occlusionInfosView);

        material.Apply(context);

        meshBuffers.Draw(context);

        context.VertexShader.SetShaderResources(0, null, null);
    }
コード例 #2
0
 public void Render(DeviceContext context, bool depthOnly)
 {
     context.InputAssembler.PrimitiveTopology = PrimitiveTopology.TriangleList;
     context.InputAssembler.SetVertexBuffers(0, vertexBufferBinding);
     context.InputAssembler.SetIndexBuffer(indexBuffer, SharpDX.DXGI.Format.R16_UInt, 0);
     if (depthOnly)
     {
         context.PixelShader.Set(null);
     }
     else
     {
         material.Apply(context);
     }
     context.DrawIndexed(indexCount, 0, 0);
 }
コード例 #3
0
    public void Render(DeviceContext context, bool depthOnly)
    {
        modelToWorldTransform.Update(context, transform);

        context.InputAssembler.InputLayout = inputLayout;
        meshBuffers.Bind(context.InputAssembler);

        context.VertexShader.Set(vertexShader);
        context.VertexShader.SetConstantBuffer(1, modelToWorldTransform.Buffer);

        if (depthOnly)
        {
            context.PixelShader.Set(null);
        }
        else
        {
            material.Apply(context);
        }

        meshBuffers.Draw(context);
    }