← RIVXAn executable representation experiment

What survives the bake?

Keep the pixels, keep the surface lighting, or keep the scene. Change one thing and see exactly what the captured representation can still do.

Custom WebGL2 + CPU surface bakeCompare the actual portable .riv →
Choose what the image must reveal

A richer inverse scene.

Keep the surface known, or recover its roughness, relief, colour and pattern contrast together with the light.

Material studies

Relief perturbs the shading normal, not the silhouette. Check a surface scalar below to make it an unknown. Unchecked values stay shared by prediction and target; categorical material and texture family stay known. Procedural textures need no image downloads.

Try a change:Preparing the first capture…
01

Frozen image

A single projected appearance

Pixels
The capture stays fixed.

Camera, light and surface color have already become pixels. None of the scene controls changes this image.

Camera fixedLight fixedColor fixed
02

Surface light bake

Lighting stored in object coordinates

3 charts
Camera and surface color remain editable.

Three real texture charts retain diffuse irradiance over both spheres and the floor. A new camera reprojects them; a new light cannot update them.

Camera liveLight fixedColor live
03

Retained scene

Geometry and light evaluated again

Live
All three scene controls remain editable.

The same analytic intersections and lighting run for the new state. Object identities also supply the surface coordinates and fitting regions.

Camera liveLight liveColor live

All three start from the same state. Move the light first: the live shadow moves, while the captured lighting stays attached to its surfaces.

From an image to a useful derivative

Which pixels change when the light moves?

The signed view measures linear luminance change per radian of light motion. The same forward model fits the selected light and surface scalars from the two visible spheres.

Numerical work measured while fitting
Recover more than the light 2 fitted scalars

Angle and power are always fitted. Choose additional unknowns; each selected control gets its own target value.

This fits up to six scalars in this calibrated synthetic scene, not an unrestricted texture reconstruction. Pattern contrast is one coefficient of a fixed object-space texture. Bump relief changes shading normals, not geometry. Switch off slow transitions to see the same solver without the showcase delay.

I

Current prediction

Current live lighting

∂

Signed light sensitivity

Central finite difference · ∂Y / ∂θ

DecreasesNear zeroIncreases
T

Target image

A second evaluation of the same scene

Actual optimization · selected scalarsReady to fit

The target settings are used only to synthesize the target image. The solver receives its sampled colors and estimates the light from their residuals.

Linear RGB MSE—
Visible sphere samples
The RIVX connection · choose the deliverable

Export what the fit recovered.

The current camera view, recovered light and material shade a small surface mesh. Its projected facets become ordinary Rive paths with solid fills, drawn by the official runtime. The host keeps the model editable; the downloaded .riv keeps this fixed drawing.

Preparing ordinary Rive…

Drag this Rive view to orbit. Camera, light and material edits rebuild its actual paths and fill colours automatically; a lighter mesh supplies feedback during interaction, then refines at rest. Standby means the latest drawing is being prepared. Export saves the current fixed 2D vector drawing: no images, shaders, scripts, hidden 3D or inverse solver. The browser retains the editable scene; the portable .riv retains its visible result.

Retained data, fitting method and limits
What was actually retained

A bake is a choice of dependencies.

The image stores the final view. The surface bake stores illumination before multiplication by surface color: two 128 × 128 sphere charts and a 256 × 256 floor chart. Turning off editable color also locks the captured color parameter. These are real RGBA8 textures, with scalar irradiance encoded over [0, 4].

The retained scene keeps two spheres, one floor, an orbiting point light and Lambertian material colors. Illumination includes inverse-square falloff, hard sphere visibility and a constant ambient term. There is no specular, glass, indirect-light transport or native RIVX file parser in this controlled study.

What the derivative means

Sensitivity is local. Fitting needs evidence.

The middle image evaluates [Y(θ + h) − Y(θ − h)] / 2h before tone mapping. Cyan decreases and orange increases; brightness uses a fixed compressive display scale. A hard shadow boundary is discontinuous, so its finite-difference band depends on the chosen step. This is a numerical sensitivity view, not an analytic visibility derivative.

The solver uses damped Gauss–Newton steps, finite-difference Jacobians and backtracking on sampled, visible sphere pixels. The material study first surveys light angles and fits power from the residuals to find a useful starting basin. Camera, geometry, discrete material family and texture frequencies remain known. Roughness, bump amplitude, colour mix and a texture contrast coefficient can join angle and power as unknowns. Each accepted endpoint lowers the objective; the smooth motion between endpoints is presentation, not an extra solver step. The floor is excluded from the loss.

This connects the material studies in LTC Light Studio and RadianceLab with the image-matching perspective of Inverse Render Lab: which lighting produced this image? The focused scene uses the same compact GGX response on CPU and GPU. It is a browser adaptation, not a port of either full renderer.

For a whole texture, one view is not enough to separate reflectance, lighting, normals and exposure reliably. A useful next step is a low-dimensional texture basis plus regularization and additional views or illuminations. This study fits one contrast coefficient; it does not learn every texel or infer unknown geometry.

The solver follows the same residual-vector and damped Gauss–Newton approach investigated in Inverse Render Lab. The small GGX CPU/GLSL pair is implemented here as a controlled adaptation; this is not the research renderer or its full visibility derivative.

Implementation and scope notes