feat(gl): OpenGL 4.1 and the ludic.render3d renderer
`Gl.*` binds the whole OpenGL 4.1 core API — every entry point of the platform gl3.h with every GL_* constant, generated by `ludic-dev glgen` with per-call ABI thunks. Windowed builds get an NSOpenGLContext on the existing window at Retina resolution; headless builds render into an offscreen CGL context, so a program that uses Gl.* renders and screenshots identically under the test harness. It links gl.ll, the thunks and OpenGL.framework only when used; every other build stays byte-identical. packages/ludic.render3d is a physically based renderer written on that surface: HDRI image-based lighting, GPU-generated terrain with scanned PBR materials, CDLOD, cascaded shadows, glTF with skinning, instanced vegetation with impostors, procedural grass, water, SSAO, and an HDR pipeline with bloom, auto-exposure and ACES. It also carries this session's work on it: the terrain at half its cost (10.3 -> 5.4 ms of frame), the streaming hitch that got worse the longer you played, a resize that emptied the world, and the packaging that lets a game use the renderer from its own repository — `ludic assets`, the material manifest shipping with the package, and shader lookup falling back to the install root. See changes/ for each, with its numbers. The camping game that drove all of it has moved out to its own repository, Maroon Lake; examples/rendering/smooth.ludic stays as the renderer's example here. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
parent
470971bf70
commit
f25289db20
90 changed files with 35316 additions and 19853 deletions
|
|
@ -221,12 +221,40 @@ function jp_number(p: JP) -> Val {
|
|||
di -= 1
|
||||
}
|
||||
var raw = ip * 65536 + frac
|
||||
raw = jp_exponent(p, raw)
|
||||
if neg != 0 { raw = -raw }
|
||||
return value_fixed(raw)
|
||||
}
|
||||
if p.i < p.n and (p.s[p.i] == 'e' or p.s[p.i] == 'E') { # 1e-05: an exponent makes it a fixed
|
||||
var raw = jp_exponent(p, ip * 65536)
|
||||
if neg != 0 { raw = -raw }
|
||||
return value_fixed(raw)
|
||||
}
|
||||
if neg != 0 { ip = -ip }
|
||||
return value_int(ip)
|
||||
}
|
||||
# an optional exponent after a number's digits, applied to a raw Q16.16 value. Exporters
|
||||
# write noise like 7.49e-09 for a zero; a fixed rounds that to 0, which is what it was.
|
||||
function jp_exponent(p: JP, raw0: int) -> int {
|
||||
var raw = raw0
|
||||
if p.i >= p.n or (p.s[p.i] != 'e' and p.s[p.i] != 'E') { return raw }
|
||||
p.i += 1
|
||||
var eneg = 0
|
||||
if p.i < p.n and p.s[p.i] == '-' { eneg = 1; p.i += 1 }
|
||||
else if p.i < p.n and p.s[p.i] == '+' { p.i += 1 }
|
||||
var e = 0
|
||||
while p.i < p.n and p.s[p.i] >= '0' and p.s[p.i] <= '9' {
|
||||
e = e * 10 + (p.s[p.i] - 48)
|
||||
p.i += 1
|
||||
}
|
||||
if e > 12 { e = 12 }
|
||||
var k = 0
|
||||
while k < e {
|
||||
if eneg != 0 { raw = raw / 10 } else { raw = raw * 10 }
|
||||
k += 1
|
||||
}
|
||||
return raw
|
||||
}
|
||||
|
||||
function jp_list(p: JP) -> Val {
|
||||
let out = value_list()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue