Skip to content

This javascript webapp converts GLSL code from shadertoy.com to Gamemaker GLSL ES as well as output other necessary code to run.

Notifications You must be signed in to change notification settings

fnkycoldmadeanr/Shadertoy2GM

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

logoShadertoy2GM

This javascript webapp converts GLSL code from shadertoy.com to Gamemaker GLSL ES as well as output other necessary code to run.

What does it do?

  • Adds varying vec2 fragCoord;
  • Replaces void MainImage() with void main(void).
  • Replaces fragColor with gl_FragColor.
  • Replaces all instances of texture to texture2D.
  • Replaces all instances of iChannel0 to gm_BaseTexture.
  • Replaces all instances of iTime to iGlobalTime.
  • Adds uniform vec3 iResolution; if iResolution.xy is found, else...
  • ...Adds uniform float iResolution; if iResolution is found
  • Adds uniform float iGlobalTime;.
  • Edits the pow(x, y) function to pow(abs(x), y)
  • Outputs vertex, fragment, create event, and draw event.
  • Warns of incompatible commands.

This works for simple shaders. More complex shaders require more manual work on your part.

Shader Inputs Supported
iResolution
iTime
iTimeDelta
iFrame
iChannelTime
iChannelResolution
iMouse
iChannel0
iDate
iSampleRate

What did I learn?

✔️JavaScript text processing.

Any feedback is welcome! :)

About

This javascript webapp converts GLSL code from shadertoy.com to Gamemaker GLSL ES as well as output other necessary code to run.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 63.9%
  • HTML 25.0%
  • CSS 11.1%