Solving Minecraft SEUS Shader `OpenGL error: 1282 (Invalid operation)` on Linux (Steam Deck, MESA Driver)

2023-01-20

Being strict is not always good.

I opened Minecraft and tried to add a shader on my Steam Deck, but it rendered a weird not-textured scene.

Optifine reported an error in the console OpenGL error: 1282 (Invalid operation).

So according to the blog, remove the const keyword from gbuffers_textured.fsh (~line 240):

- const float K_R = 0.186 * rayleighAmount;
- const float K_M = 0.035 * mieAmount;
+ float K_R = 0.186 * rayleighAmount;
+ float K_M = 0.035 * mieAmount;

Similarly, in Common.inc (~line 220):

- const float K_R = 0.186 * rayleighAmount;
- const float K_M = 0.035 * mieAmount;
+ float K_R = 0.186 * rayleighAmount;
+ float K_M = 0.035 * mieAmount;

Ref: SEUS Renewed1.0.0のInvalid programエラー解決法 | サイバー×サイバー

I also have another error saying:

error: no function with name 'texture2DLod'

After doing some googling, I add these at the beginning of Common.inc:

+ #extension GL_ARB_shader_texture_lod : require

No errors anymore.

Ref: https://github.com/trzy/Supermodel/issues/4

It seems like the MESA driver implies the OpenGL standard more strictly than others, so these miss-coding codes can run perfectly on Windows but not on Linux.

维护网站需要一定的开销,如果您认可这篇文章,烦请关闭广告屏蔽器浏览一下广告,谢谢!
加载中...

(。・∀・)ノ゙嗨,欢迎来到 lookas 的小站!

这里是 lookas 记录一些事情的地方,可能不时会有 lookas 的一些神奇的脑洞或是一些不靠谱的想法。

总之多来看看啦。