public odfMaterialPropertySet Clone() { odfMaterialPropertySet prop = new odfMaterialPropertySet(); prop.Unknown1 = Unknown1; prop.Diffuse = new Color4(Diffuse.ToVector4()); prop.Ambient = new Color4(Ambient.ToVector4()); prop.Specular = new Color4(Specular.ToVector4()); prop.Emissive = new Color4(Emissive.ToVector4()); prop.SpecularPower = SpecularPower; return(prop); }
public DxLight GetLight() { DxLight light = new DxLight { Type = LightType, Position = Position.ToVector3(), Direction = Direction.ToVector3(), Ambient = Ambient.ToVector4(), Diffuse = Diffuse.ToVector4(), Specular = Specular.ToVector4(), Attenuation = new Vector3(0.0f, 0.005f, 0.0f), SpotPower = 0.001f, Range = 1000f }; return(light); }
public override void Apply(Matrix world) { base.Apply(world); Effect.CurrentTechnique = Effect.Techniques[0]; Effect.Parameters["World"].SetValue(world); Effect.Parameters["View"].SetValue(Camera.Current.View); Effect.Parameters["Projection"].SetValue(Camera.Current.Projection); Effect.Parameters["LightPosition"].SetValue(Light.Current.Transform.Position); Effect.Parameters["CameraPosition"].SetValue(Camera.Current.Transform.Position); Effect.Parameters["Shininess"].SetValue(Shininess); Effect.Parameters["AmbientColor"].SetValue(Ambient.ToVector4() * Light.Current.Ambient.ToVector4()); Effect.Parameters["DiffuseColor"].SetValue(Diffuse.ToVector4() * Light.Current.Diffuse.ToVector4()); Effect.Parameters["SpecularColor"].SetValue(Specular.ToVector4() * Light.Current.Specular.ToVector4()); Effect.Parameters["Tiling"].SetValue(Tiling); Effect.Parameters["Offset"].SetValue(Offset); Effect.Parameters["DiffuseTexture"].SetValue(Texture); Effect.CurrentTechnique.Passes[0].Apply(); }