1. Hey! Guest! The 35th GMC Jam will take place between November 28th, 12:00 UTC - December 2nd, 12:00 UTC. Why not join in! Click here to find out more!
    Dismiss Notice

What can be done with GLSL extension directives?

Discussion in 'Advanced Programming Discussion' started by Juju, May 21, 2019.

  1. Juju

    Juju Member

    Joined:
    Jun 20, 2016
    Posts:
    412
    GameMaker's standard implementation of GLSL ES version 1.00rev17 leaves out some functionality that is commonly used in graphics programming. Fortunately, we can access some of these features by using GLSL's #extension directive.

    Here're two examples that demonstrate how to enable two particularly useful extensions. (Bear in mind that I've tested these on Windows but not other platforms.)

    GL_EXT_frag_depth, which enables per-pixel depth setting (gl_FragDepthEXT):
    https://github.com/JujuAdams/gl_FragDepthEXT

    GL_OES_standard_derivatives, which enables derivative functions (dFdx/dFdy/fwidth):
    https://github.com/JujuAdams/GL_OES_standard_derivatives

    I'm hardly the first person to demonstrate this extension directive functionality, but beyond these two extensions, I don't really know what other extensions are available and what they can do. There's an extension registry here and a GitHub repo for Angle (the OGL-to-DX transpiler GM uses) here but that's a lot of information to wade through. Anyone have any suggestions?
     
    Last edited: May 21, 2019
    Xor, hippyman, xygthop3 and 3 others like this.
  2. xygthop3

    xygthop3 Member

    Joined:
    Jun 20, 2016
    Posts:
    115
  3. Juju

    Juju Member

    Joined:
    Jun 20, 2016
    Posts:
    412
    Tried vertex texture fetch in HLSL and had no luck, I suspect because GM isn't binding the necessary sampler(s) to the vertex shader. I'll try again in GLSL ES, though I don't hold out much hope.

    The EXT_multiview_draw_buffers spec says it's written against ES 2.x but we might get lucky there.
     
    Last edited: May 22, 2019
    xygthop3 likes this.

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice