Exemple #1
0
        public Shader Generate(GenFlags flags)
        {
            string pp = "";

            if (flags.HasFlag(GenFlags.ColorMap))
            {
                pp += "#define HAS_COLOR_MAP\n";
            }

            if (flags.HasFlag(GenFlags.VertexColor))
            {
                pp += "#define HAS_VERTEX_COLOR\n";
            }

            if (flags.HasFlag(GenFlags.PhongSpecularShading))
            {
                pp += "#define HAS_PHONG_SPECULAR_SHADING\n";
            }

            if (flags.HasFlag(GenFlags.Skinning))
            {
                pp += "#define HAS_SKINNING\n";
            }

            if (flags.HasFlag(GenFlags.Lighting))
            {
                pp += "#define HAS_LIGHTING\n";
            }

            return(new Shader("open3mod.Shader.UberVertexShader.glsl", "open3mod.Shader.UberFragmentShader.glsl", pp));
        }
Exemple #2
0
        public Shader Generate( GenFlags flags )
        {
            string pp = "";

            if (flags.HasFlag(GenFlags.ColorMap))
            {
                pp += "#define HAS_COLOR_MAP\n";
            }

            if (flags.HasFlag(GenFlags.VertexColor))
            {
                pp += "#define HAS_VERTEX_COLOR\n";
            }

            if (flags.HasFlag(GenFlags.PhongSpecularShading))
            {
                pp += "#define HAS_PHONG_SPECULAR_SHADING\n";
            }

            if (flags.HasFlag(GenFlags.Skinning))
            {
                pp += "#define HAS_SKINNING\n";
            }

            if (flags.HasFlag(GenFlags.Lighting))
            {
                pp += "#define HAS_LIGHTING\n";
            }

            return Shader.FromResource("open3mod.Shader.UberVertexShader.glsl", "open3mod.Shader.UberFragmentShader.glsl", pp);
        }
Exemple #3
0
        public Shader Generate(GenFlags flags, int lightCount)
        {
            string pp = "";

            if (lightCount > 0)
            {
                pp += "#define NR_LIGHTS " + lightCount.ToString() + "\n";
            }

            if (flags.HasFlag(GenFlags.TwoSide))
            {
                pp += "#define HAS_TWOSIDE\n";
            }

            if (flags.HasFlag(GenFlags.VertexColor))
            {
                pp += "#define HAS_VERTEX_COLOR\n";
            }

            if (flags.HasFlag(GenFlags.PhongSpecularShading))
            {
                pp += "#define HAS_PHONG_SPECULAR_SHADING\n";
            }

            if (flags.HasFlag(GenFlags.Skinning))
            {
                pp += "#define HAS_SKINNING\n";
            }

            if (flags.HasFlag(GenFlags.Lighting))
            {
                pp += "#define HAS_LIGHTING\n";
            }

            return(Shader.FromResource("open3mod.Shaders.UberVertexShader.glsl", "open3mod.Shaders.UberFragmentShader.glsl", pp));
        }