Matthew Hoggan
Matthew Hoggan

Reputation: 7604

Equivalent OpenGL ES 2.0 Method to void glBindFragDataLocation(GLuint program, GLuint colorNumber, const char * name);

The online documentation at http://www.khronos.org/opengles/sdk/docs/man/ does not give reference to the glBindFragDataLocation(GLuint program, GLuint colorNumber, const char * name); method. What is the equivalent to this in OpenGL es 2.0?

Upvotes: 5

Views: 1723

Answers (1)

Trax
Trax

Reputation: 1910

There is not equivalent, read below.

OpenGL ES 2.0 does not allow to emit more than one fragment output, you either write to gl_FragColor or gl_FragData[0]. This is one of the things that with plain OpenGLES 2.0 makes really slow deferred shading since you cannot define multiple targets.

If you are on Tegra you can slightly change your program to emit gl_FragData[i] using NV_draw_buffers extension, but you cannot use an user defined out variables, there is only gl_FragData[i] out variable that could output to different attachments.

That being said, and trying to answer your question, you need to change your fragment shader to use gl_FragColor or gl_FragData[0], there are not user defined out variables.

Upvotes: 8

Related Questions