示例#1
0
        public static Shader CreateShader(ShaderSettings settings)
        {
            var constructor = new ShaderConstructor(settings);

            constructor.GenerateVertex();
            constructor.GenerateFragment();
            return(constructor.Creator());
        }
示例#2
0
        public static Shader CreateShader(string vs, string fs)
        {
            var constructor = new ShaderConstructor();

            constructor.rawVertex   = vs;
            constructor.rawFragment = fs;
            return(constructor.Creator());
        }
示例#3
0
        private void CreateShader()
        {
            string path = "Toys.Resourses.shaders.";
            string vs   = ShaderManager.ReadFromAssetStream(path + "PM.vsh");
            string fs   = ShaderManager.ReadFromAssetStream(path + "PM.fsh");

            shaderProgram = ShaderConstructor.CreateShader(vs, fs);
            CreateShader(shaderProgram);
        }
示例#4
0
        /*
         *      public byte SetFlags
         *      {
         *              set {
         *                      BitArray flags = new BitArray(new byte[] { value });
         *                      noCull = flags[0];
         *                      groundShadow = flags[1];
         *                      drawShadow = flags[2];
         *                      receiveShadow = flags[3];
         *                      hasEdge = flags[4];
         *                      vertexColour = flags[5];
         *                      pointDrawing = flags[6];
         *                      lineDrawing = flags[7];
         *              }
         *      }
         */

        private void CreateShader()
        {
            shaderProgram = ShaderConstructor.CreateShader(ShaderSettings);
            CreateShader(shaderProgram);
        }
示例#5
0
 private void CreateShader()
 {
     shaderProgram = ShaderConstructor.CreateShader(vs, fs);
     shaderProgram.ApplyShader();
     CreateShader(shaderProgram);
 }