Awwwww yiss. Shader examples for GMS.

edited in General
@Nandrew and I have been looking into ways to juice our current project up graphically. As you may know, the latest version of GM Studio has incorporated support for those ultra-tasty programmable shaders we always wanted. In my quest to harness these arcane energies, I stumbled across this page on the GM frumz with several common shaders pre-written and ready to dissect or use as you please.

http://gmc.yoyogames.com/index.php?showtopic=586380

Enjoy! I certainly will.

Comments

  • Wait, what? GM has shaders now? ... Game idea previously abandoned due to slow pixel lookup gets reanimated
  • @dislekcia the inclusion of shader in GM:S 1.2 is slightly offput by the fact that really useful functions like screen_redraw or background_createfromscreen() no longer work ;)
  • GMStudio continues to undisappoint me in a drastic way.
  • edited
    ...until you learn that GMS doesn't submit anything drawn via its native primitive functions in a format the shaders can fully process. As far as I can tell with my limited knowledge of shaders: Wanna draw a circle that's not pure black? Custom vertex buffer format definitions and manual population. That, or splack everything to a surface first. Or have a circle sprite.

    One hand giveth, the other taketh away. -_-
  • edited
    My last experiences with GMS:
    1. Mysterious looping music in-game where no code existed to call such music.
    2. Web build doesn't work when executable worked.

    I'm not a full-on dev so I was no good debugging stuff that are supposed to work but doesn't. So I gave up :(

    From my perspective, It's awesome for prototyping, it's so fast.
    Then cleaning that prototype up... That's hell.

    *from a non-programmer's perspective*
  • @Tuism the 3rd circle of hell is a programmer trying to get the web version of unity build to work ;)

    (Ok that was some hyperbole, but it's vying for the top stop on my most annoying things to do in GM)
  • @Karuji do you mean Unity or GMS? I've (knock on wood hold thumbs omg plzdon'tfuckup) thus far not had problems with Unity implementation, but of course I'm pretty shallow in the pool yet...
  • Gazza_N said:
    ...until you learn that GMS doesn't submit anything drawn via its native primitive functions in a format the shaders can fully process. As far as I can tell with my limited knowledge of shaders: Wanna draw a circle that's not pure black? Custom vertex buffer format definitions and manual population. That, or splack everything to a surface first. Or have a circle sprite.

    One hand giveth, the other taketh away. -_-
    Draw a quad that uses a circle texture. Custom vertex formats on only 4 vertices, yay :)
  • Unity works pretty well from what I have seen. I haven't really dived into the more advanced stuff there.

    I've also work on web-builds for some of my small projects, and aside from one of two weird errors that I don't normally get in the windows build it runs fine.

    I think that when building a GM game with the intention of doing a web-build you should test the web-build as you develop as opposed to making a game and then trying to get it working and then doing a web-build.

    And ye I know YoYo kinda fucked that up royally with the web-build being a nice expensive plugin where Unity bundled it with the free version.
  • edited
    Dat expensive web-build plugin. Yeah dem basterds >:s that it doesn't work 100% is even worse.
  • edited
    dislekcia said:
    Draw a quad that uses a circle texture. Custom vertex formats on only 4 vertices, yay :)
    It's actually perfectly fine with drawing sprites and anything else that's natively textured-quad-based (surfaces, backgrounds, etc) without any shenanigans, but it's when you try to use primitive functions like draw_circle or the triangle functions that it has a fit. I tried to copypasta the ol' boring shaded triangle "hello world" code from the GLSL reference online, but alas, no dice. I think a format mismatch is to blame, but given that I started with GLSL three hours ago, I may well be missing something.

    A circle sprite is probably the easiest workaround, I agree. :P

Sign In or Register to comment.