Files
kryon/tests/scene_gpu_padding.zi
T
waozi 1bc803b780 Rotate the shadow disk once per fragment; resize opaque scene images natively
The shadow filter evaluated a sine and cosine at each of its five
golden-angle taps. The taps are now a fixed disk, rotated once per
fragment by the noise angle. SceneResizeOpaqueInto resizes an opaque scene
image into the display cache's size with std/resample's Lanczos filter on
hosts that lower to native code, including Android's C99 host; the Android
bundle host keeps the interpreter path. shader_scene_test checks it
against ResizeLanczos and its size limit, also as an Android bundle run by
the portable engine; the room and padding scenes and the Android link
test cover the new material and resize.

Adds the native avatar benchmark (scene_vrm_benchmark.zi with its Moto
runner and report) and the shader-performance receipts it recorded.

Local tests: shader-scene-test, scene-gpu-test, scene-gltf-gpu-test.
2026-11-23 04:37:14 -03:00

32 lines
1.2 KiB
Ziran

// Change only representation padding, leaving every public material field
// identical. Padding is unspecified across native call/compilation contexts.
#import "kryon/scene"
MaterialFillPadding :: (material: *SceneMaterial,pattern: u8) {
saved:=material[0]
bytes:=cast(*u8)material
for at:0..cast(s64)size_of(SceneMaterial)-1 {bytes[at]=pattern}
material.kind=saved.kind
material.color=saved.color
material.roughness=saved.roughness
material.metalness=saved.metalness
material.glow=saved.glow
material.glow_strength=saved.glow_strength
material.opacity=saved.opacity
material.transparent=saved.transparent
material.double_sided=saved.double_sided
material.flat=saved.flat
material.vertex_colors=saved.vertex_colors
material.texture=saved.texture
material.texture_projection=saved.texture_projection
material.texture_filter=saved.texture_filter
material.texture_wrap=saved.texture_wrap
material.texture_scale=saved.texture_scale
material.texture_offset=saved.texture_offset
material.alpha_test=saved.alpha_test
material.exact_color=saved.exact_color
material.ungraded=saved.ungraded
material.shader=saved.shader
material.shader_uniforms=saved.shader_uniforms
material.shader_samplers=saved.shader_samplers
}