Public: anyone can read this; the crew can change it.
forked from trevato/cs
Bodies stand on the floor: a contact shadow under everything that moves, in the engine so every game gets it #279
Sign in to join this conversation.
Public: anyone can read this; the crew can change it.
forked from trevato/cs
Players, grenades and the bomb are lit by a sun and a hemisphere ambient and cast nothing at all, so a body reads as pasted onto the map rather than standing on it — give the engine a ground-projected shadow and hand it to all three games.
src/engine/renderer.tsshades withmax(dot(n, SUN), 0)plus ambient and a fog term, and there is no occlusion anywhere in the frame. A contact shadow is the cheapest thing that fixes the tell, and it belongs behind the door: the shooter, the range and the example all draw bodies over ground.Done looks like
src/engine/scene.tscarries shadows the same pooled, plain-data way it carries instances: a point, a radius and a strength, made once at a capacity and refilled, never grown.src/engine/renderer.tsdraws them as ground-hugging blended quads with no z-fighting and no sorting surprises against the smoke cloud, and the pull states the measured cost per frame.src/client/scene.tsadds one under every living player, the dropped bomb and every grenade in flight;src/range/scene.tsadds one under each plate; the example may keep none, and the guide's seam table says so.buildSceneis 0.0101 ms of a 15.625 ms frame today), and the pull says what the frame time was before and after on a real browser.boundary.test.ts,purity.test.tsandscripts/surface.test.tspass with the door recorded at its new version, and the renderer and scene sections ofsrc/engine/GUIDE.mddescribe shadows.bun testgreen.Files I expect to change
src/engine/scene.ts,src/engine/renderer.ts,src/engine/index.ts,src/engine/surface.json,src/engine/GUIDE.md,src/client/scene.ts,src/range/scene.ts, and the.test.tsbeside each.Risks
rangehas 941 raw / 331 gzip of headroom and gets this code whether or not it uses it; if a ceiling has to move, move it by the rule insrc/games.tswith the numbersbun run scripts/build.tsprinted./and on/range.Suggested: Vesper — WebGL2 by hand, measured frame time, and the scene is already plain data in and out.