u/HeedlessNomad

▲ 633 r/godot

I moved my compass out of the HUD and into the ocean shader. Here's the breakdown.

Early development footage from the sailing game I'm making solo in Godot 4. My first compass sat in the corner of the screen, and every time I checked it, I stopped looking at the sea. Which is a problem in a game called Seagazer... So i moved it onto the water!

Before: I had a placeholder dial. Nothing fancy. Just a white CylinderMesh with four Label3D letters, filmed by an orthographic camera into a 600 × 400 SubViewport in the corner. Dots on top showed each find/ Points of interest: their angle was its bearing, and their distance from the center was how far off it was.

After: no new mesh. The dial still does the tracking, with its SubViewport set to UPDATE_DISABLED. Each frame a HUD script takes the nearest four signals and publishes them as uniforms on the ocean material, and an include in the ocean's fragment shader draws the ring and the pulses.

The ring is a standing ripple. Its crest tilts the water's normal, so it catches the sky like the rest of the sea, with a thin painted line on top. North is fixed to the world, so in a turn the boat swings inside it.

Pulses (like sonar) leave the hull every 4 s at the edge of range and every 1.8 s close in, gold on the side facing the find. They're centered on the hull and travel with it, because a ripple left in the water would fall behind at full sail.

And last the tricky one. Where the stern wake crosses the ring, the script asks the wake trail where its ribbon crosses, and the shader sweeps the ring's ends aside along its edge. With the ring down and no pulse in flight, the shader returns at once.

Feedback on the ring is very welcome!

u/HeedlessNomad — 5 days ago

Bow spray as two mesh sheets shaded by the ocean's own shader instead of particles: layer breakdown (Godot 4)

This is the bow spray in Seagazer, the sailing game I'm making in Godot 4. The old spray was unshaded, additive particle billboards, so it glowed at night and sat on top of the water instead of coming out of it. The rebuild, layer by layer:

  • Two 64 × 24 grid sheets, one per side, bent into a curl in the vertex shader.
  • Shaded by the ocean's own shader code through one #define, with the ocean's uniforms copied every frame, so they match the water at any time of day.
  • A 23-plane hull stand-in and 17 water samples per side keep the root outside the hull when the boat banks.
  • The root sits 12 cm underwater and the ocean draws over it, which hides the seam without an alpha fade.
  • Droplets on top, each leaving a ring where it lands.

Critique welcome, especially from anyone who has shipped hull spray.

u/HeedlessNomad — 18 days ago
▲ 901 r/godot

Finally landed on a Bow Spray effect I'm happy with!

Sort of had a lazy particle emitter on both sides of the boat to simulate it cutting through the ocean before, but it just wasn't landing the mark. Was also a pointed out in player feedback, so decided to finally tackle it. Find I'm liking this version much better!

Edit: Yall, I'm overwhelmed by the response and the DMs! Thank you for all the feedback and kind words. I spend a lot of time working on this alone which makes it tough to really "know" if I'm getting something right. Really encouraged by the positive response. A steam page is coming! and I'm thinking through tutorials as well.

u/HeedlessNomad — 1 month ago