public void PrepareForDraw(MyEffectDistantImpostors effect) { if (!ImpostorProperties.Enabled) return; if (ImpostorProperties.ImpostorType == MyImpostorType.Nebula) { Matrix mat = Matrix.CreateScale(ImpostorProperties.MinDistance) * Matrix.CreateTranslation(MyCamera.Position * 0.5f); Matrix projection = Matrix.CreatePerspectiveFieldOfView(MyCamera.Zoom.GetFOV(), MyCamera.ForwardAspectRatio, 1000, 10000000); effect.SetWorldMatrix(mat); effect.SetViewProjectionMatrix(MyCamera.ViewMatrix * projection); effect.SetScale(ImpostorProperties.Radius * 0.00018f); effect.SetColor(ImpostorProperties.Color); effect.SetContrastAndIntensity(new Vector2(ImpostorProperties.Contrast, ImpostorProperties.Intensity)); effect.SetAnimation(m_animationTime); effect.SetCameraPos(MyCamera.Position); effect.SetSunDirection(-MyGuiScreenGamePlay.Static.GetDirectionToSunNormalized()); effect.SetTechnique(MyEffectDistantImpostors.Technique.Textured3D); effect.Begin(); MySimpleObjectDraw.ModelSphere.Render(); effect.End(); } }