Example #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="TreeMaterial"/> class.
 /// </summary>
 /// <param name="shader">The shader.</param>
 public TreeMaterial(DeferredTreeShader shader)
 {
     wsource       = new WindStrengthSin();
     this.animator = new TreeWindAnimator(wsource);
     this.shader   = shader;
     CanAppearOfReflectionRefraction = true;
     CanCreateShadow = true;
     IsVisible       = true;
 }
Example #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="TreeMaterial"/> class.
 /// </summary>
 /// <param name="shader">The shader.</param>
 /// <param name="wsource">The wsource.</param>
 public TreeMaterial(DeferredTreeShader shader, WindSource wsource)
 {
     this.wsource  = wsource;
     this.shader   = shader;
     this.animator = new TreeWindAnimator(wsource);
     CanAppearOfReflectionRefraction = true;
     CanCreateShadow = true;
     IsVisible       = true;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="TreeMaterial"/> class.
 /// </summary>
 /// <param name="shader">The shader.</param>
 public TreeMaterial(DeferredTreeShader shader)         
 {
     wsource = new WindStrengthSin();
     this.animator = new TreeWindAnimator(wsource);
     this.shader = shader;
     CanAppearOfReflectionRefraction = true;
     CanCreateShadow = true;
     IsVisible = true;
 }
        /// <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));
        }
Example #5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="TreeMaterial"/> class.
 /// </summary>
 /// <param name="shader">The shader.</param>
 /// <param name="wsource">The wsource.</param>
 public TreeMaterial(DeferredTreeShader shader, WindSource wsource)
 {
     this.wsource  = wsource;
     this.shader   = shader;
     this.animator = new TreeWindAnimator(wsource);
 }
Example #6
0
 /// <summary>
 /// Initializes a new instance of the <see cref="TreeMaterial"/> class.
 /// </summary>
 /// <param name="shader">The shader.</param>
 public TreeMaterial(DeferredTreeShader shader)
 {
     wsource       = new WindStrengthSin();
     this.animator = new TreeWindAnimator(wsource);
     this.shader   = shader;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="TreeMaterial"/> class.
 /// </summary>
 /// <param name="shader">The shader.</param>
 /// <param name="wsource">The wsource.</param>
 public TreeMaterial(DeferredTreeShader shader, WindSource wsource) 
 {
     this.wsource = wsource;
     this.shader = shader;
     this.animator = new TreeWindAnimator(wsource);
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="TreeMaterial"/> class.
 /// </summary>
 /// <param name="shader">The shader.</param>
 public TreeMaterial(DeferredTreeShader shader)         
 {
     wsource = new WindStrengthSin();
     this.animator = new TreeWindAnimator(wsource);
     this.shader = shader;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="TreeMaterial"/> class.
 /// </summary>
 /// <param name="shader">The shader.</param>
 /// <param name="wsource">The wsource.</param>
 public TreeMaterial(DeferredTreeShader shader, WindSource wsource) 
 {
     this.wsource = wsource;
     this.shader = shader;
     this.animator = new TreeWindAnimator(wsource);
     CanAppearOfReflectionRefraction = true;
     CanCreateShadow = true;
     IsVisible = true;
 }