Пример #1
0
        internal static ShaderProgram LoadShader(ShaderProgramData shader_data)
        {
            var shader_program = new ShaderProgram(shader_data.VertexShader, shader_data.FragmentShader, shader_data.Samplers, shader_data.Params);

            shader_program.Id = shader_data.Id;

            return(shader_program);
        }
Пример #2
0
        public static ShaderProgramData LoadShaderProgramData(string vs_path, string fs_path)
        {
            var result = ShaderBuilder.Build(vs_path, fs_path);

            var id = Path.GetFileNameWithoutExtension(vs_path);

            var shader_program_data = new ShaderProgramData()
            {
                Id             = id,
                VertexShader   = result.VsBytes,
                FragmentShader = result.FsBytes,
                Samplers       = result.Samplers,
                Params         = result.Params
            };

            return(shader_program_data);
        }