开发者

GLSL - Equivalent Of "layout (location = 1)" In #version 130

I am reading a tutorial about openGL 3.3 (where naturally GLSL 330 is in use). Unfortunately my hardware is limited to openGL 3.0 (where GLSL 130 is the newest format). In GLSL 130 the syntax

layout (location = 1) in vec4 position;

produces an error. Most importantly a code where several instances of "layout" are appl开发者_开发问答ied to different variables does not work. I even tried

#extension ARB_explicit_attrib_location : require

which is also not supported. Is there a way to rewrite these statements from 330 in 130 equivalently?


If your implementation does not support ARB_explicit_attrib_location (either as an extension or as version 330 or later), then you cannot use explicit attribute locations. You must specify them before the linking phase with glBindAttribLocation.

And technically, your "hardware" could do this just fine. NVIDIA and ATI support this extension in all hardware that they still support in drivers. This is an API convenience. I'm guessing you're on some from of Intel hardware. If so, you have my sympathy.

BTW, is that my code, by chance?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜