/// <summary> /// Load content for the screen. /// </summary> /// <param name="GraphicInfo"></param> /// <param name="factory"></param> /// <param name="contentManager"></param> protected override void LoadContent(GraphicInfo GraphicInfo, GraphicFactory factory, IContentManager contentManager) { base.LoadContent(GraphicInfo, factory, contentManager); { for (int i = 0; i < 10; i++) { for (int j = 0; j < 10; j++) { float x, y; x = -i * 100; y = -j * 100; TreeModel tm = new TreeModel(factory, "Trees\\Pine", null, null); ForwardTreeShader ts = new ForwardTreeShader(); TreeMaterial tmat = new TreeMaterial(ts, new WindStrengthSin()); GhostObject go = new GhostObject(new Vector3(x, 0, y), Matrix.Identity, new Vector3(0.05f)); IObject ox = new IObject(tmat, tm, go); this.World.AddObject(ox); } } } ///add a camera this.World.CameraManager.AddCamera(new CameraFirstPerson(GraphicInfo.Viewport)); }
/// <summary> /// Load content for the screen. /// </summary> /// <param name="GraphicInfo"></param> /// <param name="factory"></param> /// <param name="contentManager"></param> protected override void LoadContent(PloobsEngine.Engine.GraphicInfo GraphicInfo, PloobsEngine.Engine.GraphicFactory factory, IContentManager contentManager) { ///must be called before all base.LoadContent(GraphicInfo, factory, contentManager); { for (int i = 0; i < 10; i++) { for (int j = 0; j < 10; j++) { float x, y; x = -i * 100; y = -j * 100; TreeModel tm = new TreeModel(factory,"Trees\\Pine",null,null); DeferredTreeShader ts = new DeferredTreeShader(); TreeMaterial tmat = new TreeMaterial(ts, new WindStrengthSin()); GhostObject go = new GhostObject(new Vector3(x, 0, y), Matrix.Identity, new Vector3(0.05f)); IObject ox = new IObject(tmat, tm, go); this.World.AddObject(ox); } } } ///Add some directional lights to completely iluminate the world #region Lights DirectionalLightPE ld1 = new DirectionalLightPE(Vector3.Left, Color.White); DirectionalLightPE ld2 = new DirectionalLightPE(Vector3.Right, Color.White); DirectionalLightPE ld3 = new DirectionalLightPE(Vector3.Backward, Color.White); DirectionalLightPE ld4 = new DirectionalLightPE(Vector3.Forward, Color.White); DirectionalLightPE ld5 = new DirectionalLightPE(Vector3.Down, Color.White); float li = 0.4f; ld1.LightIntensity = li; ld2.LightIntensity = li; ld3.LightIntensity = li; ld4.LightIntensity = li; ld5.LightIntensity = li; this.World.AddLight(ld1); this.World.AddLight(ld2); this.World.AddLight(ld3); this.World.AddLight(ld4); this.World.AddLight(ld5); #endregion ///Add a AA post effect this.RenderTechnic.AddPostEffect(new AntiAliasingPostEffect()); ///add a camera this.World.CameraManager.AddCamera(new CameraFirstPerson(GraphicInfo.Viewport)); }