public string Build()
        {
            GlobalVariables.Clear();
            Main.Content = "";



            StringBuilder result = new StringBuilder("#version " + Version + "\r\n");

            #region prepare data
            VertexPositionBuilder.Build();
            VertexNormalBuilder.Build();


            Main.Build();
            #endregion prepare data


            // Add global variables.
            foreach (var gVar in GlobalVariables)
            {
                result.Append(gVar.ToString() + ";");
            }

            // Add Main function.
            result.Append(Main.Result);

            // return result
            return(result.ToString());
        }
        public VertexShaderBuilder(string version)
        {
            Version = version;

            VertexNormalBuilder   = new VertexNormalBuilder();
            VertexPositionBuilder = new VertexPositionBuilder(GlobalVariables, Main, Mat4Loop);
        }