Exemplo n.º 1
0
        public void LoadContent(Game game, string diffuseTexture, string bumpMap, string specMap, string nightMap)
        {
            planet.LoadContent(game);

            bs = new BoundingSphere(position, radius);

            planetDiffuse = localContent.Load <Texture2D>(@"textures\" + diffuseTexture);

            if (!string.IsNullOrEmpty(bumpMap))
            {
                planetBump = localContent.Load <Texture2D>(@"textures\" + bumpMap);
            }

            if (!string.IsNullOrEmpty(specMap))
            {
                planetSpec = localContent.Load <Texture2D>(@"textures\" + specMap);
            }

            if (!string.IsNullOrEmpty(nightMap))
            {
                planetNight = localContent.Load <Texture2D>(@"textures\" + nightMap);
            }

            planetEffect = game.Content.Load <Effect>(@"shaders\planetEffect");

            planetWorldMatrix      = planetEffect.Parameters["World"];
            planetViewMatrix       = planetEffect.Parameters["View"];
            planetProjectionMatrix = planetEffect.Parameters["Projection"];

            planetDiffuseTexture = planetEffect.Parameters["DiffuseTexture"];
            planetLightPosition  = planetEffect.Parameters["DirectionalLight"];
            planetLightColor     = planetEffect.Parameters["DirectionalLightColor"];
            planetHazeColor      = planetEffect.Parameters["hazeColor"];

            planetCameraPos = planetEffect.Parameters["cameraPosition"];

            planetSpecularPow       = planetEffect.Parameters["specularPower"];
            planetSpecularIntensity = planetEffect.Parameters["specularIntensity"];

            planetBumpTexture = planetEffect.Parameters["NormalMapTexture"];

            planetSpecTexture = planetEffect.Parameters["SpecularTexture"];

            planetNightTexture = planetEffect.Parameters["NightTexture"];
        }
Exemplo n.º 2
0
        public void LoadContent(Game game, string atmosphereTexture)
        {
            if (!string.IsNullOrEmpty(atmosphereTexture))
            {
                atmosphereDiffuse = localContent.Load <Texture2D>(@"textures\" + atmosphereTexture);
            }

            atmosphereEffect = game.Content.Load <Effect>(@"shaders\atmosphereEffect");

            atmosWorldMatrix      = atmosphereEffect.Parameters["World"];
            atmosViewMatrix       = atmosphereEffect.Parameters["View"];
            atmosProjectionMatrix = atmosphereEffect.Parameters["Projection"];

            atmosDiffuseTexture = atmosphereEffect.Parameters["DiffuseTexture"];
            atmosLightPosition  = atmosphereEffect.Parameters["DirectionalLight"];
            atmosLightColor     = atmosphereEffect.Parameters["DirectionalLightColor"];

            atmosphereMesh.LoadContent(game);

            bs = new BoundingSphere(position, planetRadius + atmosRadius);
        }
Exemplo n.º 3
0
        public void LoadContent(Game game, string diffuseTexture, Color starColor, Color haloColor)
        {
            starDiffuse = game.Content.Load <Texture2D>(@"textures\" + diffuseTexture);
            haloDiffuse = game.Content.Load <Texture2D>(@"textures\glow");

            spriteCenter = new Vector2(haloDiffuse.Width / 2, haloDiffuse.Height / 2);

            starEffect = game.Content.Load <Effect>(@"shaders\suneffect");

            starWorldMatrix      = starEffect.Parameters["World"];
            starViewMatrix       = starEffect.Parameters["View"];
            starProjectionMatrix = starEffect.Parameters["Projection"];

            starDiffuseTexture = starEffect.Parameters["DiffuseTexture"];

            starColorData = starEffect.Parameters["StarColor"];

            halo           = new SpriteBatch(game.GraphicsDevice);
            this.starColor = new Vector4((float)starColor.R / 255.0f, (float)starColor.G / 255.0f, (float)starColor.B / 255.0f, 1.0f);
            this.haloColor = haloColor;

            star.LoadContent(game);
        }