Compile a pixel shader from a string?

Hey all!

I was wondering if it’s possible to compile a pixel shader at runtime from a string which contains the source code?


In Windows you can programmatically run 2mgfx.exe with Process.Start

It’s ugly but it works.

1 Like

Dunno if this still works was long ago.

There is a test class you can copy paste down in the post should probably read thru the post and its probably not cross platform.

1 Like

Thanks for the replies! Ah, so you can build the string, save it to a file, then import it using the path to the file. Hmm.

That would be good enough for me as my idea is just gonna be an experiment.