Apex GP

Devlog

Rain lit by its lamps, and a game that boots in a browser

Night rain now takes its light from the lamps it falls through, and the game boots in a browser - plus the fog haze that was secretly holding up the wet road.

Fifty-five commits in two days, split between two jobs that never touched each other.

The night rain takes its light from the lamps

The night rain was a flat sheet with a tint on it. Each drop now takes its brightness from the lamps it falls through: the player's headlights, the two nearest cars' rain lights, then the nearest masts. A drop with no lamp on it loses its colour and nearly vanishes, so rain reads as something in front of the light rather than a screen over the picture.

Eight lamps per drop, down from fourteen. A coverage pass put eight at a hundred percent of the lit field, six at eighty-three to ninety-nine, four under fifty-five. It is not free: the shader lights four vertices per drop, across thirteen and a half thousand drops.

The daylight rain was being hazed by fog

The second pass on the day rain found what I should have caught first: part of what made the wet road read as wet was haze. Thinning the fog to a quarter in heavy rain and lifting exposure 1.35 took the water-to-road ratio from 0.856 to 0.737, under the 0.80 it has to hold.

Letting the water follow the road fixed it. A fitted multiplier on the day reflection tint, 1.15 in heavy rain and exactly 1.0 at night, puts the chase camera back at 0.851.

The low camera does not survive it, going 1.401 to 1.746. I have not fixed that; it is written down rather than left to be found.

The game boots in a browser

The demo loads the real race path, one circuit, one car, two laps, without forking the game logic. The first export was 243.7 MB; pruning what the demo never loads took the data pack to 152.3 MB. The web template's wasm is 39.5 MB on its own, so the 30 MB target was never reachable and I stopped chasing it.

It rendered white on a phone first. AgX with a 10.0 white point clipped every lit surface; Filmic at half exposure fixed it.

Then glowing lines appeared over the road. Ten hypotheses, each a build and a screenshot rather than a reading of the code. It was the grass blade field, which that renderer cannot draw. It is skipped on web now and the road is clean at 180 km/h.

All of this is on branches, not merged. Next: the low-camera water ratio, and a real fix for the tuft shader's web path instead of switching it off.

← All devlog posts ยท RSS