Repository navigation
gpu: portable shader nodes, shader library, IBL, GPU skinning, instancing, post passes - #6232
Conversation
A typed Java expression graph, printed to GLSL ES, MSL and HLSL by one emitter, replaces inputs of the engine's own shader through hooks (vertex offset, base colour, normal, metallic, roughness, emissive, discard), so a custom surface keeps lighting, shadows, fog and tone mapping. Per-material uniforms (16 vec4 slots) and textures (units 2-5) plus a clock are bound by the GL, Metal, D3D11 and Linux GLES backends; ShaderEvaluator runs the same graphs on the CPU for the software rasterizer and for gameplay code. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ic sky IBL; soft shadows Material maps compose into the material's ShaderMaterial (getEffectiveShader), so every backend gets them through the existing hooks with no new vertex layout: the tangent frame is derived from the surface normal (ShaderNode.perturbNormal). glTF normal/occlusion/emissive/metallicRoughness textures load onto AnimatedModel parts. PBR ambient now reflects the hemisphere along the roughness-blurred reflection ray with Karis' fitted split-sum BRDF on GLSL, Metal and HLSL. Light.setShadowSoftness widens the 3x3 PCF kernel on all six devices. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…tives.grid, Material.setFogged Water, terrain, foliage, surfaces, toon, FX, liquids and sky built only from public ShaderNode calls, plus six lighting presets. Every factory is emitted through GLSL and evaluated on the CPU in ShaderLibraryTest, and compiled with the Metal compiler locally. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…hader clock; Splat on the library PostProcess gains setGodRays, setChromaticAberration and setFxaa, written once (GlslShaderGenerator.postEffects) and printed into the GLSL, Metal and HLSL composites, with the parameters packed by GraphicsDevice.packPostEffects on all seven devices and the iOS, Windows and Linux natives. GraphicsDevice.drawInstanced and Model.setInstances draw copies of a mesh that shaders tell apart with ShaderNode.instanceId, instanceRandom and instanceColor. SpriteRenderer now advances the clock ShaderNode.time reads. scripts/check-gpu-shaders.sh compiles every library shader and the composite with glslang (GLSL ES 100, and HLSL through SPIR-V) and Metal; PR CI runs it. Splat: soft shadows, wind in its trees and bushes, puddles and grit on the ground, thick glossy paint, FXAA, god rays and a touch of lens fringe. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…lery) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…he 3D chapter Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A material whose ShaderMaterial moves vertices or discards fragments now casts the shadow of what is drawn: every backend builds a depth-only variant of the material's own program (GLSL packed depth, Metal depth-only pipeline with a discard-only fragment, HLSL R32 depth) for the shadow pass. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Light.setShadowCascades(2, farExtent) splits the shadow map into a near and a far square of one atlas. The far cascade is the near view scaled in x and y, so receivers need only the ratio (the fourth shadow parameter) and pick the near square when the point falls inside it. Casters draw once per cascade into their own viewport. gl3dBeginShadowPass takes the atlas width on iOS, Mac, watch, Windows and Linux; inside a Metal shadow pass gl3dSetViewport moves the shadow encoder's viewport instead of recording the frame's. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
EnvironmentMaps bakes a sky or an equirect panorama into a six band roughness atlas (plain 2D RGBA8, clamp, so GLES2/WebGL1 sample it); Environment.setEnvironmentMap switches the lit generators to sample it for ambient and the PBR specular. Bound on unit/slot 6 by the GL, Linux, Metal and D3D devices. Fixes the polar-row blur radius overrunning its weight table. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
GraphicsDevice.createRenderTarget/beginRenderTarget/endRenderTarget draw into an ordinary Texture that later draws sample. GL devices flip clip space Y and the winding inside a target so its texture comes out upright like Metal's and Direct3D's. New natives gl3dCreateRenderTarget, gl3dBeginRenderTarget and gl3dEndRenderTarget on iOS (Metal pass of its own), Linux (shared FBO + depth) and Windows (RTV + DSV per target), with Mac, watch and embedded stubs. GpuRenderTargetScreenshotTest shows it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Ambient occlusion, depth of field and outlines read the scene's depth in the composite pass; a colour lookup strip (ColorLuts) maps the graded colour. The shader text is shared by GLSL, Metal and HLSL. The GL devices render the scene into a depth texture (falling back, with the depth effects off, where ES 2 / WebGL 1 lack one), Metal stores and samples its depth attachment, Direct3D views a typeless depth buffer. Windows now uploads the whole post constant block; it copied 24 floats and dropped the FXAA, aberration and god ray parameters. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…not nested Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…apture Splat shots Splat and Skirmish measured operators from part buffers at a stride of eight floats, which on a GPU-skinned device hold the sixteen-float bind pose, so the framing collapsed and the characters fell out of view. AnimatedModel.getBounds measures the posed model on either path. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…tubs Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Cloudflare Preview
|
|
Developer Guide build artifacts are available for download from this workflow run:
Developer Guide quality checks: |
✅ Continuous Quality ReportTest & Coverage
Static Analysis
Generated automatically by the PR CI workflow. |
✅ ByteCodeTranslator Quality ReportTest & Coverage
Benchmark Results
Static Analysis
Generated automatically by the PR CI workflow. |
|
Compared 210 screenshots: 210 matched. Benchmark Results
Detailed Performance Metrics
ParparVM vs HotSpot (JDK 25): macOS arm64Runner CPU: Apple M1 (Virtual) (baseline Ratios are ParparVM / JDK 25: below 1.00x ParparVM is faster (time) or smaller (RAM). Median of 5 interleaved, paired rounds; every run's output was verified. A ratio more than 20% (time) / 25% (RAM) above its baseline in
Result: no regression |
|
Compared 230 screenshots: 230 matched. Benchmark ResultsDetailed Performance Metrics
ParparVM vs HotSpot (JDK 25): Windows x64Runner CPU: AMD64 Family 25 Model 1 Stepping 1, AuthenticAMD (baseline Ratios are ParparVM / JDK 25: below 1.00x ParparVM is faster (time) or smaller (RAM). Median of 5 interleaved, paired rounds; every run's output was verified. A ratio more than 20% (time) / 25% (RAM) above its baseline in
Result: no regression |
…ples; snapshot queued JS host-call arrays; complete LUT textures on Android/JavaSE GL; seed goldens - JS runtime marshalled fire-and-forget host-call arrays at flush time, so a reused array gave every queued call its last value (all skinned meshes posed by the last joint palette). Arrays are copied when queued. - Android and JavaSE GL uploads left the default mipmapped min filter on a texture with no mipmaps: incomplete, sampled black (the post colour LUT). - Shader gallery test waits for drawn frames instead of a fixed timer. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Compared 12 screenshots: 12 matched. |
…ldens; keep Splat on released API Harbour, RenderTarget, PostDepth and Skinning captured a blank view on the Android emulator legs where the first frame's program compiles outlast the fixed timer; they now poll until two frames have completed, as the gallery does. Splat's e2e build compiles against the published release, which has no shader API yet, so ArenaView goes back to master's materials. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… hello on windows-x64 The guide validator allows nothing but the include inside a source block. The hello suite's ParparVM/JVM time ratio on windows-x64 rose with the six new Gpu tests (CPU-side IBL and noise baking), not with a VM change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Both blocks are parts of a renderer (a material, a GraphicsDevice set-up) and cannot compile as a standalone Playground script. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…r Java 8 Master's pr.yml build-test (8) fails to compile AndroidCameraImpl at startVideoRecording since #6231. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Compared 215 screenshots: 215 matched. Native Android coverage
✅ Native Android screenshot tests passed. Native Android coverage
Benchmark ResultsDetailed Performance Metrics
|
|
Compared 230 screenshots: 230 matched. Benchmark ResultsDetailed Performance Metrics
|
…; Linux goldens; perf baseline
The Metal pipeline recovered the vertex stride from the first "|s" in its
key, which a custom shader ("|sh:") or skinned ("|skin3") material key now
contains ahead of the real "|sNN" segment. The stride parsed as zero, the
descriptor declared position alone and Metal rejected every pipeline that
reads a normal, uv or joints, so shader materials and skinned meshes were
missing on tvOS and iOS Metal. It now searches from the end for "|s" plus a
digit.
The GPU tests' frame gate could wait ~19.6s, past the 10s per-test budget
on HTML5, so a slow scene (GpuPostDepth) was killed before it captured; the
cap is 25 polls on HTML5 and 90 elsewhere.
Seeds the six new Gpu goldens for Linux x64 and arm64 and calibrates the
linux-x64 perf baseline for a runner CPU that had none.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A depth-post frame on HTML5 outlasts the 200ms poll, so each poll queued another render behind it; the backlog held the browser's main thread and no timer fired until the test's 10s budget ran out (GpuPostDepth). The gate now asks for a frame only once the previous request has started one. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts: # docs/developer-guide/languagetool-accept.txt
|
Compared 230 screenshots: 230 matched. Benchmark ResultsDetailed Performance Metrics
ParparVM vs HotSpot (JDK 25): Windows arm64Runner CPU: ARMv8 (64-bit) Family 8 Model D49 Revision 0, MICROSOFT CORPORATION (baseline Ratios are ParparVM / JDK 25: below 1.00x ParparVM is faster (time) or smaller (RAM). Median of 5 interleaved, paired rounds; every run's output was verified. A ratio more than 20% (time) / 25% (RAM) above its baseline in
Result: no regression |
The browser leg renders through a software GPU; a GpuPostDepth frame takes seconds and holds the main thread, so the three frames the gate waits for never fit the 10s HTML5 budget and the test timed out with no capture. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Compared 265 screenshots: 265 matched. |
|
Compared 212 screenshots: 212 matched. Benchmark Results
Detailed Performance Metrics
|
|
Compared 230 screenshots: 230 matched. ParparVM vs HotSpot (JDK 25): Linux x64Runner CPU: AMD EPYC 9V74 80-Core Processor (baseline Ratios are ParparVM / JDK 25: below 1.00x ParparVM is faster (time) or smaller (RAM). Median of 5 interleaved, paired rounds; every run's output was verified. A ratio more than 20% (time) / 25% (RAM) above its baseline in
Result: no regression |
|
Compared 230 screenshots: 230 matched. ParparVM vs HotSpot (JDK 25): Linux arm64Runner CPU: Neoverse-N2 (baseline Ratios are ParparVM / JDK 25: below 1.00x ParparVM is faster (time) or smaller (RAM). Median of 5 interleaved, paired rounds; every run's output was verified. A ratio more than 20% (time) / 25% (RAM) above its baseline in
Result: no regression |
|
Compared 213 screenshots: 213 matched. Benchmark Results
Build and Run Timing
Detailed Performance Metrics
|
|
Compared 253 screenshots: 253 matched. |
… cap Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
#6232 added the test without a tvOS reference, so the tvOS suite fails on every PR with missing_expected. Captured from this PR's tvOS run. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…agent tooling (#6242) * Foldable skins: 3D fold simulation, lockstep recording, designer and agent tooling - Simulator: foldable skins (book, flip, dual screen) with a cover display, drawn in 3D with com.codename1.gpu and animated between postures; 3D device rotation. - Recording: lockstep capture pins an animation clock per frame, so scripted fold/rotation clips are smooth at 60 fps on any machine; Simulate -> Record Device Tour; hidden (windowless) simulator for agents (CN1_SIMULATOR_HIDDEN, cn1.agent.hidden). - Skin Designer: foldable/duo authoring, physical frame units, a fixed corner mask (no outline), cover image as the folded half of the body. - devices.json: curated foldables and Surface Duo data. - Agent skill: promo videos and skins reference, SkinTool.java. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Fix CI: copyright header, Vale adverb, hide the fold button on non-foldable skins The javase screenshot baseline caught a greyed fold button on every ordinary skin; the button is now shown only for a foldable skin. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * tvOS: add the GpuShaderHarbour golden master never got #6232 added the test without a tvOS reference, so the tvOS suite fails on every PR with missing_expected. Captured from this PR's tvOS run. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Taking master's side of the GPU files after #6232 landed lost turf(), canopy() and the instance-colour fixes this branch had added on top, so rbx-view no longer compiled. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>





Codename One scenes can now be written with their own shaders, and they render the same way on every backend: Android, iOS Metal, JavaSE GL, HTML5, Linux and Windows.
What's new
com.codename1.gpu.shader): a typed expression graph printed to GLSL, Metal and HLSL.ShaderMaterialhooks (base colour, normal, roughness, emissive, vertex offset, discard and more) slot into the built-in lit PBR path, so fog, shadows and tone mapping keep working.com.codename1.gpu.shaders): water, terrain, foliage, surfaces, toon, FX, liquids and sky, plusScenePresets.PostProcess.addPass)AnimatedModel.getBounds(): measures a posed model correctly when the device skins on the GPU.Verification
scripts/check-gpu-shaders.shruns the real compilers (glslang, xcrun metal, HLSL) over every emitted program. 268 compiles, clean.Gpu*hellocodenameone test per feature, includingGpuSkinningandGpuPostPass. Their new goldens are seeded from CI.ScrollWheelGestureTest, failed once in the full run and passes alone.Commits
🤖 Generated with Claude Code