Пример #1
0
        public static Shader CreateValidShader()
        {
            Shader shader = new Shader();

            string fragSource = ResourceShaders.GetShaderSource("valid.frag");
            string vertSource = ResourceShaders.GetShaderSource("valid.vert");

            shader.LoadShaders(
                new ShaderObject(fragSource, ShaderType.FragmentShader),
                new ShaderObject(vertSource, ShaderType.VertexShader));

            shader.UseProgram();

            return(shader);
        }
Пример #2
0
        public static Shader CreateValidShader()
        {
            Shader shader = new Shader();

            string fragSource = ResourceShaders.GetShaderSource("valid.frag");
            string vertSource = ResourceShaders.GetShaderSource("valid.vert");

            var shaders = new List <Tuple <string, ShaderType, string> >()
            {
                new Tuple <string, ShaderType, string>(fragSource, ShaderType.FragmentShader, ""),
                new Tuple <string, ShaderType, string>(vertSource, ShaderType.VertexShader, ""),
            };

            shader.LoadShaders(shaders);

            shader.UseProgram();

            return(shader);
        }