示例#1
0
        public static IShaderEffect Create(ShaderName name)
        {
            IShaderEffect shaderEffect;

            switch (name)
            {
            case ShaderName.Color:
                shaderEffect = new ColorShader();
                break;

            case ShaderName.Ambient:
                shaderEffect = new AmbientShader();
                break;

            case ShaderName.Diffuse:
                shaderEffect = new DiffuseLighting();
                break;

            case ShaderName.Specular:
                shaderEffect = new SpecularLighting();
                break;

            case ShaderName.Multitexture:
                shaderEffect = new Multitexturing();
                break;

            case ShaderName.Texture:
                shaderEffect = new TextureMapping();
                break;

            case ShaderName.Test:
                shaderEffect = new TestShader();
                break;

            case ShaderName.Bumpmaping:
                shaderEffect = new BumpMapping();
                break;

            case ShaderName.ParallaxMapping:
                shaderEffect = new ParallaxMapping();
                break;

            case ShaderName.LightingEffect:
                shaderEffect = new LightingShader();
                break;

            case ShaderName.DirectionalLightingParallaxMapping:
                shaderEffect = new DirectionalLightingParallax();
                break;

            case ShaderName.DepthShader:
                shaderEffect = new DepthShader();
                break;

            default:
                shaderEffect = null;
                break;
            }
            return(shaderEffect);
        }
示例#2
0
        public static IShaderEffect Create(ShaderName name)
        {
            IShaderEffect shaderEffect;

            switch (name)
            {
                case ShaderName.Color:
                    shaderEffect = new ColorShader();
                    break;
                case ShaderName.Ambient:
                    shaderEffect = new AmbientShader();
                    break;
                case ShaderName.Diffuse:
                    shaderEffect = new DiffuseLighting();
                    break;
                case ShaderName.Specular:
                    shaderEffect = new SpecularLighting();
                    break;
                case ShaderName.Multitexture:
                    shaderEffect = new Multitexturing();
                    break;
                case ShaderName.Texture:
                    shaderEffect = new TextureMapping();
                    break;
                case ShaderName.Test:
                    shaderEffect = new TestShader();
                    break;
                case ShaderName.Bumpmaping:
                    shaderEffect = new BumpMapping();
                    break;
                case ShaderName.ParallaxMapping:
                    shaderEffect = new ParallaxMapping();
                    break;
                case ShaderName.LightingEffect:
                    shaderEffect = new LightingShader();
                    break;
                case ShaderName.DirectionalLightingParallaxMapping:
                    shaderEffect = new DirectionalLightingParallax();
                    break;
                case ShaderName.DepthShader:
                    shaderEffect = new DepthShader();
                    break;
                default:
                    shaderEffect = null;
                    break;
            }
            return shaderEffect;
        }