internal static void DrawIndexedGBufferPass(MyRenderContext rc, int indexCount, int startIndexLocation, int baseVertexLocation) { BeginDrawGBufferPass(rc); rc.DrawIndexed(indexCount, startIndexLocation, baseVertexLocation); SwitchDrawGBufferPass(rc); rc.DrawIndexed(indexCount, startIndexLocation, baseVertexLocation); EndDrawGBufferPass(rc); }
internal static void DrawIndexedBillboards(MyRenderContext rc, int indexCount, int startIndexLocation, int baseVertexLocation) { MyStereoRender.SetViewport(rc, MyStereoRegion.LEFT); rc.AllShaderStages.SetConstantBuffer(MyCommon.FRAME_SLOT, MyCommon.FrameConstantsStereoLeftEye); rc.DrawIndexed(indexCount, startIndexLocation, baseVertexLocation); MyStereoRender.SetViewport(rc, MyStereoRegion.RIGHT); rc.AllShaderStages.SetConstantBuffer(MyCommon.FRAME_SLOT, MyCommon.FrameConstantsStereoRightEye); rc.DrawIndexed(indexCount, startIndexLocation, baseVertexLocation); MyStereoRender.SetViewport(rc, MyStereoRegion.FULLSCREEN); rc.AllShaderStages.SetConstantBuffer(MyCommon.FRAME_SLOT, MyCommon.FrameConstants); }
static void DrawHighlightedPart(MyRenderContext RC, MyPart part, MyInstanceLodState state) { // settings per part (using MyPart.cs): MyShaderBundle shaderBundle = part.GetShaderBundle(state); RC.SetInputLayout(shaderBundle.InputLayout); RC.VertexShader.Set(shaderBundle.VertexShader); RC.PixelShader.Set(shaderBundle.PixelShader); // (using MyHighlightPass.cs): RC.SetRasterizerState(null); RC.DrawIndexed(part.IndicesCount, part.StartIndex, part.StartVertex); }
internal static void DrawIndexedBillboards(MyRenderContext rc, int indexCount, int startIndexLocation, int baseVertexLocation) { MyStereoRender.SetViewport(rc, MyStereoRegion.LEFT); rc.AllShaderStages.SetConstantBuffer(MyCommon.FRAME_SLOT, MyCommon.FrameConstantsStereoLeftEye); rc.DrawIndexed(indexCount, startIndexLocation, baseVertexLocation); MyStereoRender.SetViewport(rc, MyStereoRegion.RIGHT); rc.AllShaderStages.SetConstantBuffer(MyCommon.FRAME_SLOT, MyCommon.FrameConstantsStereoRightEye); rc.DrawIndexed(indexCount, startIndexLocation, baseVertexLocation); MyStereoRender.SetViewport(rc, MyStereoRegion.FULLSCREEN); rc.AllShaderStages.SetConstantBuffer(MyCommon.FRAME_SLOT, MyCommon.FrameConstants); }
internal static void DrawIndexedGBufferPass(MyRenderContext rc, int indexCount, int startIndexLocation, int baseVertexLocation) { BeginDrawGBufferPass(rc); rc.DrawIndexed(indexCount, startIndexLocation, baseVertexLocation); SwitchDrawGBufferPass(rc); rc.DrawIndexed(indexCount, startIndexLocation, baseVertexLocation); EndDrawGBufferPass(rc); }