fitting-a-look-to-reference-images
Finds the values of a physically based renderer's lighting, atmosphere and post-processing parameters (exposure, tone mapping, sun and sky light, ambient balance, haze and fog, white balance, colour grading) that bring a rendered frame close to the reader's own reference images, when the render's lighting, colour or fog differs from them. Gets still, lossless, unfiltered reference images with their sun position and time of day recorded, diagnoses where each gap comes from before changing anything, measures by region class with each measurement's view geometry, works upstream first, checks a function's form before fitting its parameters, fits many points numerically after a short trial run, stops when a fit does not converge, and judges good enough on the whole frame. Use with three.js WebGPU renderers, or any renderer with tunable look parameters, whenever a look is matched to reference images or photographs by changing lighting, atmosphere or post-processing values.
HuberyLL · 已有静态检查记录
安装与使用
运行命令前先阅读来源与依赖说明。复制命令不会自动安装或执行。
npx skills add HuberyLL/ponlai --skill fitting-a-look-to-reference-images技能说明
name: fitting-a-look-to-reference-images description: Finds the values of a physically based renderer's lighting, atmosphere and post-processing parameters (exposure, tone mapping, sun and sky light, ambient balance, haze and fog, white balance, colour grading) that bring a rendered frame close to the reader's own reference images, when the render's lighting, colour or fog differs from them. Gets still, lossless, unfiltered reference images with their sun position and time of day recorded, diagnoses where each gap comes from before changing anything, measures by region class with each measurement's view geometry, works upstream first, checks a function's form before fitting its parameters, fits many points numerically after a short trial run, stops when a fit does not converge, and judges good enough on the whole frame. Use with three.js WebGPU renderers, or any renderer with tunable look parameters, whenever a look is matched to reference images or photographs by changing lighting, atmosphere or post-processing values.
Fitting a look to reference images
Your reference images show the lighting, colour and atmosphere you aim for, and your frame does not.
This skill finds which parameters cause the gap and fits their values to many measured points. It
sets lighting, atmosphere and post-processing parameters only. Material values and content are
decided elsewhere (the skill building-cinematic-stylised-realism). Why each rule holds:
background.md.
Rules most often broken without notice
- Take each reference image for the fit: lossless, at native resolution, with nothing overlaid on it, and with its time, weather and sun position written down. A flaw in a reference image never shows in the measurements; it shows as a fit that does not converge.
- Diagnose before you change anything. Spend the first part of the work (on a full scene, an hour or two) only measuring: where each gap comes from, and which change can reduce it.
- Every measurement carries its view geometry: the angle between the view and the sun, the sun's elevation, and the region class (sunlit ground, shadow, sky near the sun, distant land, sea). A measurement compared at the wrong geometry makes every fit built on it wrong.
- Work upstream first: exposure and tone mapping, then sun and sky light, then atmosphere and fog, then the large surfaces, then the small ones. Fit the main weather (a clear day) before the others.
- Check the function's form before you fit its parameters. If the reference's curve has a shape that the parameter cannot produce, no value fits.
- Run a short trial before a long fit. A long run that starts from a wrong assumption fails only at its end.
- When a fit does not converge, the method is wrong: stop and report the readings. Do not force parameters past their sensible range to make it converge.
- Never fit a material's values to a reference image. A material fitted to a finished frame absorbs the lighting's errors and breaks when the lighting changes.
- Set nothing aside silently. Write down, with the reason, every gap you leave, every measurement you drop and every parameter you could not move.
The project's facts: the binding
Steps marked "(binding: X)" need facts about the project: its views and how to reach a given sun
position and weather, its tools for measuring regions, where its look parameters are and how to set
them, its thresholds for good enough, and where measured values are recorded. When you reach the
step, read section X of docs/bindings/fitting-a-look-to-reference-images.md. If the project's
AGENTS.md or CLAUDE.md names another file for this skill, that file wins.
If there is no binding, find each fact in the project (its capture and probe tools, the look's tables or settings, its debug handles) and ask the user for what you cannot find, above all the threshold for good enough. When the work ends, offer to write what you found as the binding, one section per step.
Workflow
Copy this checklist and keep it up to date:
- [ ] 0. Get the reference images
- [ ] 1. Match the views
- [ ] 2. Measure by region class
- [ ] 3. Diagnose each gap
- [ ] 4. Plan the order and the acceptance measurements
- [ ] 5. Check the form
- [ ] 6. Short run, then the fit
- [ ] 7. Judge the whole frame
- [ ] 8. Record
0. Get the reference images
If the images are given, skip this step, but check them against it and ask for what is missing.
- Choose sources of the quality you aim for: photographs of the kind of place you are making, or screenshots you take yourself from games or films. Never use images found online: they are recompressed, resized and often colour-graded again.
- Save lossless images at the display's native resolution: PNG, or the screenshot tool's uncompressed copy (many tools save JPEG by default). Use standard dynamic range output with HDR off, and leave brightness and gamma at their defaults. An image saved any other way is not the image a viewer sees.
- Turn off everything overlaid on the image: the user interface, filters and photo-mode looks, vignette, depth of field, film grain, chromatic aberration, motion blur and lens dirt. Keep the source's own tone mapping and colour grading: they are part of its look. Use the source's highest quality settings, with dynamic resolution and upscaling off where it allows.
- Take still images: pause, or use a photo mode with time frozen, so that you can take a view again. Keep a photo mode's field of view and exposure at their defaults, and write down any that you change.
- With each image, write down what step 1 needs: the time of day, the weather, the sun's elevation and its angle to the view (estimated from the shadows when the source does not show it), the settings and the field of view. What you do not write down when you take the image cannot be recovered.
- Take sets, not single images: one view at several hours