Thomas
Thomas

Reputation: 6196

Is there a way to use GLSL with monogame?

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?

Upvotes: 0

Views: 1955

Answers (2)

deherch
deherch

Reputation: 669

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

Upvotes: 3

Daniel Johnson
Daniel Johnson

Reputation: 701

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

Upvotes: 1

Related Questions