• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

GML to GLSL compiler?

gitwalrus

Member
I found a C++ to GLSL (shader language) compiler. I have no idea how well it works or if it works at all... Anyways you can compile GML to C++. This tool claims to compile C++ to GLSL. So could you in theory make GML run as a shader? It would probably be so slow that even a simple pass through shader would lag but I might try messing with it to see if I can get something to compile...

https://github.com/AlexanderDzhoganov/GLSLplusplus

EDIT: Fixed typo.
 

kburkhart84

Firehammer Games
I don't know the project well, but I know that it can't compile all C++ to GLSL. C++ can do way too many things that GLSL cannot. The same issue applies to GML.

I honestly don't get it. If I wanted to actually write shaders, I would just learn the proper language instead of trying to convert from another language that would give limitations etc...(I'm not being rude to you gitwalrus, just saying in a general sense, why force an issue if there is an easier way).
 

Mercerenies

Member
Go to that link you posted and scroll down and look at the example on the front page. It isn't a C++ to GLSL translator; it's a DSL inside C++ that produces GLSL code. That's an entirely different (and much simpler) tool.
 

gitwalrus

Member
I don't know the project well, but I know that it can't compile all C++ to GLSL. C++ can do way too many things that GLSL cannot. The same issue applies to GML.

I honestly don't get it. If I wanted to actually write shaders, I would just learn the proper language instead of trying to convert from another language that would give limitations etc...(I'm not being rude to you gitwalrus, just saying in a general sense, why force an issue if there is an easier way).
Well it is not that I think it would be useful. I was just thinking that it would be a fun toy to make just to see if the system can be abused that way. ;)

Go to that link you posted and scroll down and look at the example on the front page. It isn't a C++ to GLSL translator; it's a DSL inside C++ that produces GLSL code. That's an entirely different (and much simpler) tool.
Huh, I did not see that. I guess it does not work... Oh well experiment over.
 
M

MishMash

Guest
From my experience with GLSL, and languages like openCL, Cuda; It doesn't really make much sense to convert existing code directly to a GPU form. Whether it can or can't is somewhat irrelevant. Often times, a direct translation will be inefficient and not work well with the SIMD nature of GPUs.

For General-purpose GPU computation, you are far better off re-writing your code in something like OpenCL. This same idea applies with GML: A GML to GLSL converter wouldn't really make sense, because the two languages serve fundamentally different purposes, deal with different kinds of data, and input/output different things. You could make something that converted a syntactically similar form of GML down to GPU-executable code, but it wouldn't support the full feature set of GM, and would most likely produce code that is inefficient and slow to run on a GPU.
 

Tthecreator

Your Creator!
Yea you would have to think of ways to specify certain things in gml to make up for what's in glsl that isn't in game maker.
That would require the developer to still learn some stuff like matrices, vectors, etc....at which point you might as well learn the entire language. Believe me, the language is not that hard. Not hard at all. It's the advanced math and other advanced stuff that is hard about shaders. That's why I was so impressed by @MishMash lightning stuff.
 
Top