Documentation for the glslfx format

I am interested in writing some custom glsl shaders to use in storm or the Houdini/Solaris viewport.

In each of the glslfx files there is a configuration block. Is there any documentation on what this metadata means?

Chris King

Hey Chris, I think the answer is no, unfortunately, but for a definitive answer on imaging-related questions, can you make your future posts in the “Hydra” category here?

I don’t think we’ve published any, although we hope to remedy that. In the meantime, we’re happy to answer questions, and you can use some of the existing code as a template.

GLSLFX has a few different types of blocks:

  • “glsl”, specifying a named block of shader code. Note that in Storm, at least, the shader code makes careful use of abstractions and macros to be both GLSL and MSL friendly. If it’s run as part of hydra, it can access geometry data with HdGet_* calls that are automatically generated by the geometry description.
  • “layout”, specifying the format of interstage data for an associated glsl block; this is mostly used by hdStorm internal snippets, and is used to automatically generate buffer binding statements.
  • “configuration”, which can be used to concatenate named “glsl” blocks together to provide an entrypoint for a certain shader stage. In Hydra, the entry points we support for scene materials are “displacementShader”, “surfaceShader”, and “volumeShader”, though GLSLFX has facilities for specifying GPU shader stages as well.
    … and then we also support #import, which is just #include.

Let me know if there’s anything else you want clarification on.