toc

content

Working on fishy facts offline:

  • I forgot to sync my notes, so I don't have the most recent TODO list on me.
  • Copied TODOs from 20260620190345
  • Today, I want to focus on improving controller support. Tomorrow, I think it would be fun to work on improving the QoL/juice on stream.
  • I did some playtests a few days ago and I think we need a separate set of levels for teaching stubs, so I'm bringing back the sea urchin exhibit.

Outline

I want to see if I can implement an outline shader with the standardBaseMaterial3D, without writing any custom shader code. I'm interested in doing this because I don't want my game to have any frame hitches due to shader compilation, so I want everything to use the same shader if possible and the standard material has a lot of features built into it already.

I found a grow and grow_amount property. These didn't create the right effect, because none of the faces were connected. Reading the documentation, I find out that I need face-weighted normals in order for the mesh-based outline to work. So, I updated the blender files to use bevel and weighted normal modifiers. This made the grow properties on the material work correctly.

However, the outline is drawn ontop of the object and below the floor, so the outline doesn't look quite right. I tried to use render priority to fix this, but apparently that doesn't work for opaque objects and only works for transparent objects right now. https://forum.godotengine.org/t/understanding-render-priority-sorting-offset-etc-making-objects-render-behind-others/46902

So, I tried doing an outline with the stencil buffer (though the API to do this is marked as experimental). Following the documentation, I do these steps:

  • Set stencil_mode buffer to STENCIL_MODE_OUTLINE.
  • Set stencil_color to the desired color.
  • Set stencil_outline_thickness to the desired thickness.

This seems to work! The outline is rendered above the floor and behind the object, like I want it to. It also automatically adds a next pass which is set to read the stencil and draw wherever the reference value is not 1

The documentation says I need a next_pass material in order for this to work, so I try making one:

  • Make an outline material by setting cull_mode to CULL_FRONT, shading_mode to SHADING_MODE_UNSHADED, albedo_color to Color.BLACK, grow to true, and grow_amount to the desired thickness.
  • Setting the outline to match the automatically generated next pass which draws wherever the stencil is not equal to the reference value 1.
  • Set the outline material as the material_overlay material on the desired MeshInstance3D that I want the outline rendered on.

Setting the stencil color to transparent and then setting the material overlay only on the one I want to have focused seems to work well! The only caveat is that It draws the outline underneath all other objects using the same material, but I think I could fix this by creating a material that doesn't draw to the stencil buffer for objects that are not focused. However, none of the objects currently overlap so I don't need to do this right now.

TODO

Vertical Slice:

  • Music:
  • Sounds:
  • Touch Pool Exhibits:
  • Visual Novel:
  • Level Select
  • Map Select
  • Collectibles

TODO:

meta

created:

backlinks: 20260701043110 fishy facts

commit: 92dcff02