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); }
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); }
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); }