0

I'd rather create shaders in GLSL than HLSL.

Is there a way for it to work with monogame? Or do I have to use HLSL .fx files?

4

2 回答 2

3

Short answer: not yet

Currently, you have to write your shaders in HLSL, regardless of whether you are using DirectX or OpenGL. The .fx shader (written in HLSL) will be converted to GLSL internally if you are targeting OpenGL and are using the MonoGame Content pipeline (with the MonoGame effect content processor) or the 2MGFX tool.

So yeah, if you prefer to write your shaders in GLSL. You will have to convert them to HLSL first, and then, internally it will be converted back to GLSL anyways.. Seems ridiculous, right? But that seems to be the current situation.

They will be adding support for GLSL shaders in the future.

Source: MonoGame documentation

于 2014-05-28T14:42:46.693 回答
1

You could use a converter to convert between GLSL files to HLSL files. Google Search

于 2013-07-09T18:00:06.407 回答