开发者

Is there a better way than writing several different versions of your GLSL shaders for compatibility sake?

开发者 https://www.devze.com 2023-02-28 14:52 出处:网络
I\'m starting to play with OpenGL and I\'d like to avoid the fixed functions as much as possible as the trend seems to be away from them.However, my graphics card is old and only supports up to OpenGL

I'm starting to play with OpenGL and I'd like to avoid the fixed functions as much as possible as the trend seems to be away from them. However, my graphics card is old and only supports up to OpenGL 2.1. Is there a way to wr开发者_JAVA技巧ite shaders for GLSL 1.20.8 and then run them without issue on OpenGL 3.0 and OpenGL 4.0 cards? Perhaps something when requesting the opengl context where you can specify a version?


I should use the #version directive.

0

精彩评论

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

关注公众号