protected override void DrawPrepare() {
base.DrawPrepare();
if (!AmbientShadowHighlight && SelectedObject == null || _outlineBuffer == null) return;
DeviceContext.ClearDepthStencilView(_outlineDepthBuffer.DepthView, DepthStencilClearFlags.Depth | DepthStencilClearFlags.Stencil, 1f, 0);
DeviceContext.OutputMerger.SetTargets(_outlineDepthBuffer.DepthView);
DeviceContext.Rasterizer.State = DeviceContextHolder.DoubleSidedState;
(AmbientShadowHighlight ? (IRenderableObject)CarHelper.AmbientShadowNode : SelectedObject)
.Draw(DeviceContextHolder, ActualCamera, SpecialRenderMode.Outline);
DeviceContext.ClearRenderTargetView(_outlineBuffer.TargetView, Color.Transparent);
DeviceContext.OutputMerger.SetTargets(_outlineBuffer.TargetView);
var effect = DeviceContextHolder.GetEffect<EffectPpOutline>();
effect.FxDepthMap.SetResource(_outlineDepthBuffer.View);
effect.FxScreenSize.Set(new Vector4(Width, Height, 1f / Width, 1f / Height));
DeviceContextHolder.PrepareQuad(effect.LayoutPT);
effect.TechOutline.DrawAllPasses(DeviceContext, 6);
}