Login
You're viewing the functional.cafe public feed.
  • Nov 14, 2026, 9:08 PM

    @dbat Probably shaders, in a deferred style. My mind immediately comes to distance fields, since they are an easy way of generating droopy visuals:

    1. Draw goo objects to a buffer as a mask;
    2. Run jump-flood on it to make the mask into a distance field;
    3. Render that distance field to the screen with a goop shader, using the distance field to even generate normals/lighting.
    💬 1🔄 0⭐ 2

Replies

  • 💬 1🔄 0⭐ 0
  • Nov 14, 2026, 11:17 PM

    @dbat A bit more concretely in Godot terms in sentence case, and things you're supposed to look up in quotes:

    1. Set up a separate Viewport where your goo objects get drawn to, with a black background, with just a plain white unlit shader;
    2. Create a CompositorEffect (post process shader) that implements "jump-flood", outputting the distance, and attach to the Environment of that viewport;
    3. Create a shader that reads the ViewportTexture above, and outputs the goo material:
      • At the most basic, you'll check if the distance against some positive threshold, emitting a solid color if it's smaller, and transparent if greater;
      • You can also use the "central difference method" to find the direction of the surface, to use for lighting
        • Since you're talking 2D, you can use the "fwidth" function over the color you sampled from the distance texture.
    4. Add a plane that covers the screen that uses the material from the previous step, and put it in the correct layer/sort order you want for the goo to appear in.
    💬 2🔄 0⭐ 2
  • 💬 0🔄 0⭐ 0
  • 💬 0🔄 0⭐ 1