// Draw muzzle flash not matter if in frustum (it's because it's above the frustum) public override bool Draw(MyRenderObject renderObject) { if (base.Draw(renderObject) == false) { return(false); } m_barrel.Draw(); if (MyMinerGame.IsPaused()) { return(false); } // Draw muzzle flash int deltaTime = MyMinerGame.TotalGamePlayTimeInMilliseconds - m_lastTimeShoot; if (deltaTime <= MyMachineGunConstants.MUZZLE_FLASH_MACHINE_GUN_LIFESPAN) { MyParticleEffects.GenerateMuzzleFlash(m_positionMuzzleInWorldSpace, WorldMatrix.Forward, m_muzzleFlashRadius, m_muzzleFlashLength, MyRender.GetCurrentLodDrawPass() == MyLodTypeEnum.LOD_NEAR); } if (m_smokeEffect != null) { m_smokeEffect.Near = MyRender.GetCurrentLodDrawPass() == MyLodTypeEnum.LOD_NEAR; } return(true); }
public static void Draw() { if (MyRender.GetCurrentLodDrawPass() == MyLodTypeEnum.LOD0) { MyHud.DrawGPS(); } }
public static void Draw() { if (MyRender.GetCurrentLodDrawPass() == Utils.MyLodTypeEnum.LOD_NEAR && CanDrawCockpitWeapons() && MyFakes.DRAW_WEAPONS) { var old = MySession.PlayerShip.Weapons.Visible; MySession.PlayerShip.Weapons.Visible = true; MySession.PlayerShip.Weapons.Draw(); MySession.PlayerShip.Weapons.Visible = old; MySession.PlayerShip.CubeBuilder.Draw(); } }
public static void SetupBaseEffect(MyEffectBase effect, float fogMultiplierMult = 1.0f) { if (MyRender.EnableFog) { effect.SetFogDistanceFar(MySector.FogProperties.FogFar); effect.SetFogDistanceNear(MySector.FogProperties.FogNear); effect.SetFogColor(MySector.FogProperties.FogColor); effect.SetFogMultiplier(MySector.FogProperties.FogMultiplier * fogMultiplierMult); effect.SetFogBacklightMultiplier(MySector.FogProperties.FogBacklightMultiplier); } else { effect.SetFogMultiplier(0); } //if (MyRenderConstants.RenderQualityProfile.ForwardRender || !MyRender.EnableLODBlending) { if (MyRender.GetCurrentLodDrawPass() == MyLodTypeEnum.LOD0) { effect.SetLodCut((GetLodTransitionDistanceFar() + GetLodTransitionDistanceNear()) / 2.0f); } else if (MyRender.GetCurrentLodDrawPass() == MyLodTypeEnum.LOD1) { effect.SetLodCut(-(GetLodTransitionDistanceFar() + GetLodTransitionDistanceNear()) / 2.0f); } else { effect.SetLodCut(0); } effect.SetLodBackgroundCut(GetLodTransitionDistanceBackgroundEnd()); } /* * if (!MyRenderConstants.RenderQualityProfile.ForwardRender && MyRender.EnableLODBlending) * { * if (MyRender.GetCurrentLodDrawPass() == MyLodTypeEnum.LOD1) * { * //effect.SetLodCut(-(GetLodTransitionDistanceFar() + GetLodTransitionDistanceNear()) / 2.0f); * //effect.SetLodCut(-(GetLodTransitionDistanceFar() + GetLodTransitionDistanceNear()) / 2.0f); * effect.SetLodCut(0); * } * else * { * effect.SetLodCut(0); * } * } */ }
public static void Draw() { if (MyRender.GetCurrentLodDrawPass() == MyLodTypeEnum.LOD0) { MyStateObjects.DepthStencil_TestFarObject_DepthReadOnly.Apply(); MyStateObjects.Dynamic_Decals_BlendState.Apply(); MyStateObjects.BiasedRasterizer_Decals.Apply(); Effects.MyEffectDecals effect = (Effects.MyEffectDecals)MyRender.GetEffect(MyEffects.Decals); // Draw voxel decals m_decalsForVoxels.Draw(m_vertices, effect, m_texturesDiffuse, m_texturesNormalMap); // Draw model decals m_decalsForModels.Draw(m_vertices, effect, m_texturesDiffuse, m_texturesNormalMap); } }
public override bool Draw(MyRenderObject renderObject) { bool drawDebug = MyRender.IsModuleEnabled(MyRenderStage.DebugDraw, MyRenderModuleEnum.InfluenceSpheres); var isEditorOrDebugDraw = MyGuiScreenGamePlay.Static.IsEditorActive() || drawDebug; if (isEditorOrDebugDraw && MyRender.GetCurrentLodDrawPass() == MyLodTypeEnum.LOD0 && !MyEntities.IsTypeHidden(typeof(MyInfluenceSphere))) { Matrix worldMatrix = WorldMatrix; var innerColor = Color.White.ToVector4(); var innerSphere = new BoundingSphere(worldMatrix.Translation, RadiusMin); MySimpleObjectDraw.DrawTransparentSphere(ref worldMatrix, innerSphere.Radius, ref innerColor, true, 12, MyTransparentMaterialEnum.ObjectiveDummyFace, MyTransparentMaterialEnum.ObjectiveDummyLine); var outerColor = 0.5f * innerColor; var outerSphere = new BoundingSphere(worldMatrix.Translation, RadiusMax); MySimpleObjectDraw.DrawTransparentSphere(ref worldMatrix, outerSphere.Radius, ref outerColor, true, 12, MyTransparentMaterialEnum.ObjectiveDummyFace, MyTransparentMaterialEnum.ObjectiveDummyLine); } return(true); }
public override bool Draw(Render.MyRenderObject renderObject = null) { if (base.Draw(renderObject)) { // Draw muzzle flash int deltaTime = MyMinerGame.TotalGamePlayTimeInMilliseconds - m_lastTimeShoot; if (deltaTime <= MyMachineGunConstants.MUZZLE_FLASH_MACHINE_GUN_LIFESPAN) { MyParticleEffects.GenerateMuzzleFlash(GetMuzzlePosition(), WorldMatrix.Forward, MyMwcUtils.GetRandomFloat(0.8f, 1.2f), MyMwcUtils.GetRandomFloat(1, 2), MyRender.GetCurrentLodDrawPass() == MyLodTypeEnum.LOD_NEAR); } return(true); } return(false); }