public Helicopter(Game game, Model model, ConcreteEffect effect) : base(model, game) { _effect = new ConcreteEffect(effect); //this._effect.Parameters["AmbientIntensity"].SetValue(0); //this._effect.Parameters["DiffuseIntensity"].SetValue(0); this._effect.Parameters["ReflectionEnabled"].SetValue(true); //this._effect.Parameters["SpecularIntensity"].SetValue(0); _texture = game.Content.Load<Texture2D>("Models/Helicopter/helicopterTexture"); normalmap = game.Content.Load<Texture2D>("Models/Helicopter/helicopterNormalMap"); }
public Sphere(Game game, Model model, ConcreteEffect effect) : base(model, game) { _effect = new ConcreteEffect(effect); this._effect.Parameters["ReflectionEnabled"].SetValue(true); this._effect.Parameters["BumpEnabled"].SetValue(true); _isDoubleSided["Sphere"] = false; _texture = game.Content.Load<Texture2D>("Models/Sphere/texture"); //normalmap = game.Content.Load<Texture2D>("Models/Sphere/normalMap"); //normalmap = game.Content.Load<Texture2D>("Models/Sphere/setts-normalmap");' normalmap = game.Content.Load<Texture2D>("Models/Sphere/normal-map"); }
public Snowplow(Model model, Game game, ConcreteEffect effect) : base(model, game) { // _effect = new ConcreteEffect(effect); //this.SetLighting(effect); //_effect.ReflectionEnabled = true; //_effect.BumpEnabled = true; //_effect.FogEnabled = false; _isDoubleSided["Circle"] = true; _isDoubleSided["Circle.004"] = true; _isDoubleSided["Circle.003"] = true; }
public override void SetLighting(ConcreteEffect conceffect) { BasicEffect light = new BasicEffect(_device); light.FogEnabled = conceffect.FogEnabled; light.FogColor = conceffect.FogColor; light.FogStart = conceffect.FogStart; light.FogEnd = conceffect.FogEnd; light.DirectionalLight0.Direction = conceffect.DirectionalLightDirection; light.DirectionalLight0.DiffuseColor = conceffect.DirectionalLightDiffuseColor; light.DirectionalLight0.SpecularColor = conceffect.DirectionalLightSpecularColor; light.LightingEnabled = conceffect.LightingEnabled; light.DirectionalLight0.Enabled = conceffect.DirectionalLightEnabled; foreach (ModelMesh modelMesh in _model.Meshes) { foreach (Effect effect in modelMesh.Effects) { if (effect is IEffectFog) { IEffectFog fogEffect = (IEffectFog)effect; fogEffect.FogColor = light.FogColor; fogEffect.FogEnabled = light.FogEnabled; fogEffect.FogStart = light.FogStart; fogEffect.FogEnd = light.FogEnd; } if (effect is IEffectLights) { if (light.LightingEnabled) { IEffectLights lightEffect = (IEffectLights)effect; lightEffect.AmbientLightColor = light.AmbientLightColor; lightEffect.LightingEnabled = true; lightEffect.DirectionalLight0.Enabled = light.DirectionalLight0.Enabled; lightEffect.DirectionalLight0.Direction = light.DirectionalLight0.Direction; lightEffect.DirectionalLight0.DiffuseColor = light.DirectionalLight0.DiffuseColor; lightEffect.DirectionalLight0.SpecularColor = light.DirectionalLight0.SpecularColor; } } } } }
public void SetLightning(ConcreteEffect effect) { foreach(AbstractEntity item in entities) { item.SetLighting(effect); } }
public virtual void SetLighting(ConcreteEffect conceffect) { }
/// <summary> /// LoadContent will be called once per game and is the place to load /// all of your content. /// </summary> protected override void LoadContent() { // Create a new SpriteBatch, which can be used to draw textures. spriteBatch = new SpriteBatch(GraphicsDevice); ConcreteEffect effectastic = new ConcreteEffect(Content.Load<Effect>("Effects/effectastic")); effectastic.AmbientLightColor = Color.Violet.ToVector3(); skyboxTexture = Content.Load<TextureCube>("Skyboxes/Sunset"); skybox = new Skybox(skyboxTexture, Content); Snowplow plow = new Snowplow(Content.Load<Model>("Models/snowplow"), this, effectastic); plow.Position += new Vector3(5,0,-2); sceneManager.Scene.AddEntity(plow); Snowplow plow2 = new Snowplow(Content.Load<Model>("Models/snowplow"), this, effectastic); plow2.Position += new Vector3(5,0,2); sceneManager.Scene.AddEntity(plow2); Snowplow plow3 = new Snowplow(Content.Load<Model>("Models/snowplow"), this, effectastic); plow3.Position += new Vector3(5, 0, -20); sceneManager.Scene.AddEntity(plow3); sphere = new Sphere(this, Content.Load<Model>("Models/Sphere/sphere_mapped"), effectastic); sphere.Position = Vector3.Zero; sceneManager.Scene.AddEntity(sphere); //helicopta = new Helicopter(this, Content.Load<Model>("Models/Helicopter/Helicopter"), effectastic); //helicopta.Position = new Vector3(-4, 10, 0); //sceneManager.Scene.AddEntity(helicopta); //Sets lightning for whole scene sceneManager.Scene.SetLightning(effectastic); }