Nose Slimming in Real-Time Shaders Is Just a Continuous Displacement Field
This decomposition — a stable local coordinate frame plus a continuous displacement field — is the reusable skeleton behind most real-time facial reshaping Shaders. Understanding it lets graphics engineers swap out the warp region and weight functions for cheeks, eyes, or jawlines without rebuilding the landmark-to-sampling pipeline from scratch.
A real-time nose-slimming Shader works entirely through inverse texture mapping: output Fragments stay fixed while their Camera Texture read positions shift. Face landmarks supply a nose center, radii, and a rotating local axis pair so the warp always pulls along the face's true horizontal direction, regardless of head tilt or aspect ratio. The nose region is normalized into a standard ellipse, and three multiplied weight functions — horizontal parabolic, vertical Gaussian, and edge smoothstep — produce a continuous displacement field that peaks near the nostrils and decays to zero at the bridge center and ellipse boundary. A nonlinear strength curve makes low settings perceptible without blowing out high values. The final offset is simply `localX * warpWeight * strength * 0.28` projected back along the face X-axis and added to the texture coordinate. The same pipeline — landmark → local space → warp region → continuous field → inverse sampling — generalizes to face slimming, eye enlargement, and chin reshaping.
The algorithm never touches vertex positions or mesh geometry — it is purely a fragment shader remapping of texture reads, which keeps it compatible with any camera pipeline that outputs a texture.
Separating outputCoordinate (for geometry) from textureCoordinate (for sampling) is a design pattern that cleanly decouples the warp's spatial logic from its final color fetch.
The same landmark → local-space → ellipse → continuous-field → inverse-sampling pipeline directly transfers to cheeks, eyes, and jawlines; only the region shape and weight functions change.
Using an ellipse rather than a circle for the warp region isn't cosmetic — the nose's longitudinal structure means horizontal and vertical effective ranges genuinely differ, and two radii prevent pulling the bridge tip or philtrum.
The smoothstep boundary feathering and Gaussian vertical decay are what prevent visible texture seams; a hard cutoff at the ellipse edge would produce creases or streaks instantly.