feat(render3d): gpu.ludic - the seam for a second graphics API, and what the GPU can do
Render state (depth, blending, culling, colour writes, alpha-to-coverage, depth bias, scissor) and uniforms go through gpu_* / u_* and nowhere else; OpenGL state is cached and only changes reach the driver. Frames are bit-identical to before at the fixed viewpoints. R3D_GFX=gl|vk or gpu_request chooses a backend, falling back to OpenGL with a reason. gpu_caps_probe() asks Vulkan, on Windows, for the 1.3 floor, ray tracing, mesh shaders, the NVIDIA RTX generation, Reflex and HDR colour spaces, for a game's settings to grey out what a machine cannot use; R3D_CAPS pretends to be a given card for tests. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
parent
208cad7ca1
commit
54eeef5f8d
17 changed files with 652 additions and 312 deletions
|
|
@ -190,16 +190,16 @@ function daylight_hand(x: int, y: int, z: int, dx: int, dy: int, dz: int, cone:
|
|||
v3_set(hand_color, r, g, b)
|
||||
}
|
||||
function daylight_bind(prog: int) -> void {
|
||||
u_v3(gl_uniform(prog, "u_hand_pos"), hand_pos)
|
||||
u_v3(gl_uniform(prog, "u_hand_color"), hand_color)
|
||||
u_v3(gl_uniform(prog, "u_hand_dir"), hand_dir)
|
||||
u_f(gl_uniform(prog, "u_hand_cone"), hand_cone)
|
||||
u_v3(gl_uniform(prog, "u_ibl_scale"), day_ibl)
|
||||
u_v3(gl_uniform(prog, "u_moon_dir"), day_moon_dir)
|
||||
u_f(gl_uniform(prog, "u_moon_phase"), day_moon_phase)
|
||||
u_f(gl_uniform(prog, "u_moon_illum"), day_moon_illum)
|
||||
u_f(gl_uniform(prog, "u_moon_haze"), day_overcast)
|
||||
u_f(gl_uniform(prog, "u_daylight"), day_light)
|
||||
u_v3(gl_uniform(prog, "u_fire_pos"), fire_pos)
|
||||
u_v3(gl_uniform(prog, "u_fire_color"), fire_color)
|
||||
u_v3(gpu_uniform(prog, "u_hand_pos"), hand_pos)
|
||||
u_v3(gpu_uniform(prog, "u_hand_color"), hand_color)
|
||||
u_v3(gpu_uniform(prog, "u_hand_dir"), hand_dir)
|
||||
u_f(gpu_uniform(prog, "u_hand_cone"), hand_cone)
|
||||
u_v3(gpu_uniform(prog, "u_ibl_scale"), day_ibl)
|
||||
u_v3(gpu_uniform(prog, "u_moon_dir"), day_moon_dir)
|
||||
u_f(gpu_uniform(prog, "u_moon_phase"), day_moon_phase)
|
||||
u_f(gpu_uniform(prog, "u_moon_illum"), day_moon_illum)
|
||||
u_f(gpu_uniform(prog, "u_moon_haze"), day_overcast)
|
||||
u_f(gpu_uniform(prog, "u_daylight"), day_light)
|
||||
u_v3(gpu_uniform(prog, "u_fire_pos"), fire_pos)
|
||||
u_v3(gpu_uniform(prog, "u_fire_color"), fire_color)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue