Gloop Shader

As part of the toon/comic style of the game I was requested to create a shader that applied a highlight, permanently in the top right of an object, not reacting to real light.
The shader was to be applied to blobs of various shapes and sizes, but normally spherical, on squid like things attached to enemy heads that we called brain slugs and little balls that jump at um. The squids were dropped, but blobs of what became called gloop and the jumping enemies stayed.
The shader takes in mesh positions baked into UV data on the mesh and creates a screen space cone mask from that point in the desired direction. Then a basic Fresnel mask. The two put together can create a highlight permanently in the upper right of a roughly spherical mesh.

----

Junkster is an unreleased project from by Stormcloud Games. Currently stalled by lack of publisher but with some luck the product will release to the public, but as yet it is unknown when.Wishlist on steam if you want to see it released: https://store.steampowered.com/app/1675860/Junkster/

Spheres with the gloop material on them. Shows highlight spot on submeshes.

Spheres with the gloop material on them. Shows highlight spot on submeshes.

Gloop material on in-game meshes getting used in a level.

Gloop material on in-game meshes getting used in a level.

Video showing gloop material getting used in-game on enemies attacking main character.

Gloop highlight breakdown. Each submesh has a centre location from UV's, a screen space cone is drawn from that which is multiplied by Fresnel and clipped, producing the highlight shape and location.

Gloop highlight breakdown. Each submesh has a centre location from UV's, a screen space cone is drawn from that which is multiplied by Fresnel and clipped, producing the highlight shape and location.

Submesh centre points are written into UV set values with a basic custom Python tool in Blender.

Submesh centre points are written into UV set values with a basic custom Python tool in Blender.

Submesh positions UV's sets shown in blender.

Submesh positions UV's sets shown in blender.

Gloop material on junk piles.

Gloop material on robot heads. Each one has its own material parameters giving the direction of the highlight and angle of the slug