Пример #1
0
		public override Backend.Program CreateProgram(string vertex, string fragment)
		{
			Shader vertexShader = new Shader(this, ShaderType.Vertex);
			vertexShader.Compile(vertex ?? @"void main() { gl_Position = ftransform(); gl_TexCoord[0] = gl_MultiTexCoord0; }");
			Shader fragmentShader = new Shader(this, ShaderType.Fragment);
			fragmentShader.Compile(fragment ?? @"uniform sampler2D texture; void main() { gl_FragColor = texture2D(texture, gl_TexCoord[0].xy); }");
			Program result = this.CreateProgram() as Program;
			result.Attach(vertexShader);
			result.Link();
			result.Attach(fragmentShader);
			result.Link();
			return result;
		}
Пример #2
0
		protected Shader(Shader original) :
			base(original)
		{ }