A fast 2D and 3D game engine — TypeScript SDK, C++/WebAssembly core, visual editor. Ship one project to web, desktop, WeChat MiniGames, playable ads, and native Android / iOS.
TypeScript 2d-game-engine3d3d-game-engineandroidcppecsgame-editorgame-enginegamedeviostypescriptwebassemblywebglwebgpuwechat-minigame
feat(character): hair takes the Principled highlight when it has an anisotropy, and an imported card with one is set to it
yhh76734d067925
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 039de4782..ebf12763b 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -16,6 +16,7 @@ published separately; it ships inside the editor.### Added+- **Hair with Blender's highlight.** The Hair shader takes the Principled shader's highlight when u_anisotropy is above zero: GGX stretched along the strand as Blender stretches it, with u_specular as the specular factor. A hair card imported with an anisotropy (KHR_materials_anisotropy, which Blender exports from its Principled anisotropy) is set to it, so the broad sheen across a fringe that Blender draws is drawn in the same place.- **Hair shadows and diffuse.** A hair material draws the sun's shadow of hair as hair. The Hair shader gains u_hairShadow, how much light a layer of strands takes per world unit along it (declared with the new `#pragma hairshadow`), and while it is above zero the frame adds a cascade fitted to the hair alone as the first in the sun's list: cards a few millimetres apart fell inside one texel of a cascade spread over the view, so the layers could not shadow each other, and the face under a fringe is now shadowed at the hair's resolution too. The light left after a depth of hair falls off with that depth, from the nearest card to this one, as a deep shadow map reads it, with a card's own surface left out so it does not shadow itself. A hair material imported from a glTF is set to a density of 400. The Hair shader has u_strandDiffuse, how much of the diffuse is the strand's own Kajiya-Kay term against a surface's N dot L, and a hair material imported from a glTF sets it to 0. At the old 0.6 a card turned edge-on to the light still took a third of it, so every lock was lit to one tone and the gaps between locks never went dark; with the Principled shader's diffuse they do. With the lamp highlight at a tenth and the tinted second lobe at half what they were, the top of the hair comes out within about six percent of Blender's render of the same frame on both backends, where it was half again as bright.- **Hair drawn as locks.** The Hair shader can draw a card's strands as locks: u_clumpCount sets how many across its width, u_clumpTone how much lighter or darker one is than the next, u_clumpShift how far each lock's highlight is pushed along the strand so it breaks from lock to lock, and u_clumpGap how dark the seam between locks is; 0 leaves the card as authored. A hair material imported from a glTF is set to seven locks, so cards cut from one strand texture no longer read as a combed plate. Against Blender's render of the same frame the top of the hair comes out within about ten percent in every channel, where it was half again as bright.- **Hair that reads as hair.** The Hair shader has a lobe gain, u_lobeGain, for how much of the strand highlight a lamp draws apart from the reflection of the environment, and an imported hair material now sets it with the rest from what the source states: the specular factor as the environment's Fresnel, the roughness factor, a quarter of the lamp highlight, and a third of the shader's own strand shift and second highlight so the cards read as locks of hair and not plates. Against Blender's render of the same frame the hair comes out with a sheen on each lock and dark gaps between them, where it was a flat red plate.@@ -53,6 +54,7 @@ published separately; it ships inside the editor.### Fixed+- **Energy in lit materials, and soft sun shadows as wide as the sun.** Lit materials keep the light a rough surface reflects and pass on what it does not. The environment's specular came from Karis' analytic fit, 21% low for a metal at roughness 0.5 and up to 80% off at a grazing view; it is now a fit to the integral itself (tools/gen-dfg-fit.py, worst 3%). The light a rough metal loses to bounces between its microfacets is returned (Fdez-Aguera's multiple-scattering term, and the same ratio on a lamp's highlight), where a metal at roughness 0.9 under a white sky came out at half of Blender's brightness. The diffuse under a dielectric's specular is reduced by what the specular reflects, as in the Principled shader. And a lamp's highlight takes Smith's height-correlated masking at alpha = roughness squared in place of the Schlick k = (r + 1)^2 / 8 remap, which left a rough metal's rim a quarter dark. In the render lab six spheres under a white sky now match Blender within 0.5% at every roughness, and flat cards of five albedos within 0.002, on both backends. A sun with a size casts a penumbra as wide as Blender's. The disc a penumbra was averaged over stopped at 8 texels of the map, which held a sun's soft edge to sixteen texels: with a fine cascade that is less than the sun throws, and the render lab measured an edge 60% as wide as Blender's. The disc now reaches 24 texels, its spiral of taps is turned point by point so the wider disc grains rather than bands, and each blocker tap forgives only as far as it stands from the point, so a box standing on a floor stays shadowed to its foot.- **Mip chains on WebGPU.** On the WebGPU backend, a mesh without a material, a sprite and a particle are sampled through their texture's mip chain, as they always were on WebGL2: their WGSL read level 0 alone, so anything drawn smaller than its texture shimmered into stripes and moire there and not on the other backend. A compressed (KTX2) texture also keeps every level of its chain on WebGPU: the upload stopped at the first level whose side is not a multiple of four, which left a 1240x1268 hair atlas with level 0 alone. In the render lab a card of fine strands seen small now reads the same on both backends.- **Cut-outs at a distance.** A cut-out seen from far enough away that its texture is smaller than a texel a pixel lets through as much as its texture covers. Its alpha was sharpened to a texel around the cutoff at every distance, and once the mips had averaged fine strands and the gaps between them to one value above the cutoff, the whole card turned solid: a hair card at arm's length drew as a plate. Where the texture is minified the mip-averaged alpha is now the coverage under multisampling, and the cutoff moves to a per-pixel threshold without it. In the render lab a card of fine cut-out strands lets through within 3% of what Blender does, where it let through nothing; the shader helper is cutoutCoverage, and u_time.w carries the scene's multisampling.- **Faces speckled with dirt in shadow.** The high quality profile's shadow cascades are now 1024 texels on a 4096 atlas (they were 512 on 2048). At 512 a cascade's texel is several millimetres across a close character, so a brow, a hairline or a lash card sitting a fraction of a millimetre above the skin fell inside one texel of it and the shadow speckled the face with dirt; at 1024 the face is clean. Medium and low are unchanged.diff --git a/docs/astro/src/content/docs/graphics/materials.mdx b/docs/astro/src/content/docs/graphics/materials.mdxindex 5185ade0b..84adc2ae5 100644--- a/docs/astro/src/content/docs/graphics/materials.mdx+++ b/docs/astro/src/content/docs/graphics/materials.mdx@@ -71,7 +71,7 @@ texture), the diffuse light is Kajiya-Kay (a strand is lit by how far the lighthighlights along the strand, shifted against each other by `u_shiftMap` (`u_shiftAmount`, `u_shiftTile`): a white one near the surface and a colouredone under it (`u_secondaryTint`). `u_roughness` sets how tight the lines are, and `u_lobeGain` how much of the highlight a lamp draws apart from the reflection of the environment (`u_specular`). `u_clumpCount` draws a card's strands as that many locks across its width, each lighter or darker than the next (`u_clumpTone`), with its own break in the highlight (`u_clumpShift`) and a shadowed seam (`u_clumpGap`); 0 leaves the card as authored. Light comes through the strands from behind (`u_translucency`),`u_sharpen` keeps the fine strands a card is covered in from washing out at a slant, and `u_rootDark` darkens the roots by the occlusion map.-`u_strandDiffuse` is how much of the diffuse is that strand diffuse against a surface's N dot L (0 is the Principled shader's, which goes dark where a card turns from the light). `u_hairShadow` is how much light a layer of strands takes, per world unit along the light: above zero the frame fits a shadow cascade to the hair alone, the first in the sun's list, so cards a few millimetres apart are told apart, and the light left after a depth of hair falls off with that depth, as a deep shadow map reads it. `u_alphaCutoff` cuts a card out by its texture's alpha, feathered by alpha-to-coverage under MSAA, and the card then casts its own shape into shadow maps. `u_tipSoftness` adds the soft outer band: where the alpha falls from the cutoff down by that much, a second blended pass draws the strand's tip fading out, sorted with the other blended draws, so tips do not stair-step under coverage (0 leaves it out). The card's own shape goes into shadow maps too, not the rectangle it is drawn on. A hair model is usually cards or ribbons, not strands; this shader gives the shading of a strand to what the geometry gives it.+`u_anisotropy` above zero swaps the two strand highlights for the Principled shader's: GGX stretched along the strand by that anisotropy (Blender's), with `u_specular` as the specular factor, which is what a card exported from Blender with an anisotropy is imported with. `u_strandDiffuse` is how much of the diffuse is that strand diffuse against a surface's N dot L (0 is the Principled shader's, which goes dark where a card turns from the light). `u_hairShadow` is how much light a layer of strands takes, per world unit along the light: above zero the frame fits a shadow cascade to the hair alone, the first in the sun's list, so cards a few millimetres apart are told apart, and the light left after a depth of hair falls off with that depth, as a deep shadow map reads it. `u_alphaCutoff` cuts a card out by its texture's alpha, feathered by alpha-to-coverage under MSAA, and the card then casts its own shape into shadow maps. `u_tipSoftness` adds the soft outer band: where the alpha falls from the cutoff down by that much, a second blended pass draws the strand's tip fading out, sorted with the other blended draws, so tips do not stair-step under coverage (0 leaves it out). The card's own shape goes into shadow maps too, not the rectangle it is drawn on. A hair model is usually cards or ribbons, not strands; this shader gives the shading of a strand to what the geometry gives it.**Eye** (`builtin:eye`) builds an eye from two maps and a few numbers. `u_depthMap` is white over the iris and the dome of the cornea, and `u_irisNormalMap` holds that dome's normals (import both with sRGB off). The view ray is bent into the cornea (`u_ior`) and carried down to the iris (`u_irisDepth`), so the iris moves behind the surface as the eye turns. The iris itself is drawn from `u_irisColor` to `u_irisColor2` with fibres, a dark limbal ring (`u_limbal`) and a pupil (`u_pupilSize`), against the white (`u_scleraColor`), which is lit with light that wraps past the terminator (`u_scleraWrap`). The cornea is a near-mirror (`u_corneaRoughness`, `u_specular`), so every light and the sky show as a catchlight. The lids shade the eye: `u_lidMap` is an authored occlusion map (white where the eye is open), and `u_lidShadow` darkens, and fades the cornea's reflections, where the surface faces up (from `u_lidStart`, a dot with the world's up, to straight up), which is the upper lid on an upright head. A painted eye texture on the mesh multiplies the result.diff --git a/docs/astro/src/content/docs/zh-cn/graphics/materials.mdx b/docs/astro/src/content/docs/zh-cn/graphics/materials.mdxindex fc3078876..1875181f6 100644--- a/docs/astro/src/content/docs/zh-cn/graphics/materials.mdx+++ b/docs/astro/src/content/docs/zh-cn/graphics/materials.mdx@@ -51,7 +51,7 @@ std140 uniform 块,于是 CPU 能按名字设置、并安全地送到 GPU。一**皮肤**(`builtin:skin`)不模糊画面。光进入皮肤又在不远处出来,会让弯曲表面的受光一侧变软,这里按颜色分开做:漫反射光取自比表面自己的法线更软的法线,红色最软(`u_blurRed`、`u_blurGreen`,是法线贴图的 mip 层级),所以毛孔和高光保持清晰。明暗交界线被染暖(`u_sssColor`、`u_sssWrap`),薄的或曲率大的地方会透光(`u_translucency`、`u_thinness`:耳朵、鼻翼、手指),高光是两层(`u_specular`、`u_lobe2`、`u_lobe2Roughness`),另有一层很淡的绒毛光照亮边缘(`u_fuzz`)。打开 `u_subsurface` 还会把它标记给[次表面散射](/docs/zh-cn/graphics/post-processing/#次表面散射)特效,在更大的尺度上扩散剩下的光,代价是会模糊画面。`u_preIntegrate` 让明暗交界线之后的环绕光按颜色分开(红色最远),并在表面急转的地方变宽,所以鼻翼和耳朵边缘会透出光,而平坦的脸颊保持清晰;`u_curvature` 是每个世界单位内多快的转折算作急转。`u_detailMap` 是平铺在表面上的第二张细法线图(`u_detailTile`),用来补烘焙贴图没有足够像素表现的毛孔和皮纹:它按 `u_detailStrength`(0 表示不用)叠在高光读取的锐利法线上,不叠在柔和的漫反射法线上。导入时关闭 sRGB,并把环绕方式设为重复。它对每个像素做三次光照计算,所以适合镜头里的角色皮肤,不适合一群人。-**头发**(`builtin:hair`)把发丝当发丝来打光。`u_lobeGain` 决定灯光画出多少发丝高光(环境反射则只由 `u_specular` 决定)。`u_strandDiffuse` 决定漫反射里发丝自己的那部分占多少(0 就是 Principled 着色器的漫反射,发片背向光时会变暗)。`u_hairShadow` 是光沿着射线穿过一层发丝被吸收的密度:大于 0 时,帧会给头发单独拟合一个阴影级联(排在太阳级联的最前面),相隔几毫米的发片才分得开,穿过的头发越厚透过的光越少,和深度阴影图的读法一样。`u_clumpCount` 把一张发片的发丝画成横向若干束:束与束明暗不同(`u_clumpTone`)、高光各自错开(`u_clumpShift`)、束间有一道阴影缝(`u_clumpGap`);0 表示保持贴图原样。`u_flowMap` 说明发丝朝哪个方向(红、绿是贴图上的一个方向),漫反射是 Kajiya-Kay(发丝被光照亮的程度取决于光离它的走向有多远),高光是两条沿发丝的窄高光,由 `u_shiftMap` 把它们错开(`u_shiftAmount`、`u_shiftTile`):一条白的靠近表面,一条带颜色的在下面(`u_secondaryTint`)。`u_roughness` 决定线条有多紧。光会从发丝背面透过来(`u_translucency`),`u_sharpen` 让发片上密布的细发丝在斜着看时不被冲淡,`u_rootDark` 按遮蔽图把发根压暗。`u_alphaCutoff` 按贴图的 alpha 把发片抠出形状,在 MSAA 下由 alpha-to-coverage 柔化边缘,`u_tipSoftness` 增加柔和的外缘:alpha 从裁剪值往下降这么多的范围内,由第二遍混合绘制把发丝尖端渐隐地画出来,和其他混合绘制一起排序,所以发梢不会在覆盖率下出现阶梯(0 表示不用)。发片投进阴影图里的也是这个形状,而不是它所在的矩形。头发模型通常是发片或发带而不是真正的发丝;这个着色器把发丝的明暗给了几何本身给不了的部分。+**头发**(`builtin:hair`)把发丝当发丝来打光。`u_lobeGain` 决定灯光画出多少发丝高光(环境反射则只由 `u_specular` 决定)。`u_anisotropy` 大于 0 时,两道发丝高光换成 Principled 着色器的高光:沿发丝方向按这个各向异性(Blender 的定义)拉长的 GGX,`u_specular` 作为镜面系数;从 Blender 导出、带各向异性的发片导入后就是这样设置的。`u_strandDiffuse` 决定漫反射里发丝自己的那部分占多少(0 就是 Principled 着色器的漫反射,发片背向光时会变暗)。`u_hairShadow` 是光沿着射线穿过一层发丝被吸收的密度:大于 0 时,帧会给头发单独拟合一个阴影级联(排在太阳级联的最前面),相隔几毫米的发片才分得开,穿过的头发越厚透过的光越少,和深度阴影图的读法一样。`u_clumpCount` 把一张发片的发丝画成横向若干束:束与束明暗不同(`u_clumpTone`)、高光各自错开(`u_clumpShift`)、束间有一道阴影缝(`u_clumpGap`);0 表示保持贴图原样。`u_flowMap` 说明发丝朝哪个方向(红、绿是贴图上的一个方向),漫反射是 Kajiya-Kay(发丝被光照亮的程度取决于光离它的走向有多远),高光是两条沿发丝的窄高光,由 `u_shiftMap` 把它们错开(`u_shiftAmount`、`u_shiftTile`):一条白的靠近表面,一条带颜色的在下面(`u_secondaryTint`)。`u_roughness` 决定线条有多紧。光会从发丝背面透过来(`u_translucency`),`u_sharpen` 让发片上密布的细发丝在斜着看时不被冲淡,`u_rootDark` 按遮蔽图把发根压暗。`u_alphaCutoff` 按贴图的 alpha 把发片抠出形状,在 MSAA 下由 alpha-to-coverage 柔化边缘,`u_tipSoftness` 增加柔和的外缘:alpha 从裁剪值往下降这么多的范围内,由第二遍混合绘制把发丝尖端渐隐地画出来,和其他混合绘制一起排序,所以发梢不会在覆盖率下出现阶梯(0 表示不用)。发片投进阴影图里的也是这个形状,而不是它所在的矩形。头发模型通常是发片或发带而不是真正的发丝;这个着色器把发丝的明暗给了几何本身给不了的部分。**眼睛**(`builtin:eye`)用两张贴图和几个数值做出一只眼睛。`u_depthMap` 在虹膜和角膜穹顶上为白色,`u_irisNormalMap` 是这个穹顶的法线(两张都要以关闭 sRGB 的方式导入)。视线在角膜处折射(`u_ior`)再下行到虹膜(`u_irisDepth`),所以眼球转动时虹膜在表面后面移动。虹膜本身由 `u_irisColor` 到 `u_irisColor2` 绘制,带纤维纹理、深色角膜缘(`u_limbal`)和瞳孔(`u_pupilSize`),衬在眼白(`u_scleraColor`)上,眼白的光会绕过明暗交界线(`u_scleraWrap`)。角膜近似镜面(`u_corneaRoughness`、`u_specular`),所以每盏灯和天空都会变成一个眼神光。眼睑会给眼睛投下阴影:`u_lidMap` 是手绘的遮蔽图(眼睛睁开处为白色),`u_lidShadow` 会在表面朝上的地方(从 `u_lidStart` 即与世界上方向的点积起,到正上方)变暗并淡化角膜的反射,在头部直立时这就是上眼睑。网格上画的眼睛贴图会与结果相乘。diff --git a/pipeline/src/assets/modelImport.ts b/pipeline/src/assets/modelImport.tsindex c511b1f6c..e051a6672 100644--- a/pipeline/src/assets/modelImport.ts+++ b/pipeline/src/assets/modelImport.ts@@ -746,6 +746,13 @@ function characterProperties(shading: CharacterShading, material: ImportedMateri// The Principled shader's diffuse, which goes dark where a card turns from the light (the strand's own diffuse keeps it lit edge-on and flattens the locks), and// a density of hair for the light to pass through, with the cascade the frame fits to it: what Blender gets from tracing the layers.properties.u_strandDiffuse = 0; properties.u_hairShadow = HAIR_SHADOW_DENSITY;+ // A card the source gave an anisotropy (KHR_materials_anisotropy, which Blender exports from its Principled anisotropy) keeps the+ // highlight it was authored with: Principled's GGX stretched along the strand, the specular factor as F0 = 0.04 x it. The strand lobes+ // above are what a card without one gets.+ if (material.anisotropy !== undefined && material.anisotropy > 0) {+ properties.u_anisotropy = material.anisotropy;+ properties.u_specular = material.specular ?? 1;+ }// Cards cut from one strand texture read as combed plates; drawing them as a few locks, each a little lighter or darker with its own break in the highlight// and a shadowed seam, gives the layers the depth Blender gets from hundreds of overlapping cards.properties.u_clumpCount = 7; properties.u_clumpTone = 0.4; properties.u_clumpShift = 0.5; properties.u_clumpGap = 0.55;diff --git a/sdk/src/character/characterShaders.ts b/sdk/src/character/characterShaders.tsindex 54a8d0939..7001f2d16 100644--- a/sdk/src/character/characterShaders.ts+++ b/sdk/src/character/characterShaders.ts@@ -38,6 +38,9 @@ const HAIR = `#pragma shader "Hair"// How much of the diffuse is the strand's own (Kajiya-Kay: how far the light is from along the strand, with a soft wrap) against a surface's N dot L: 0 is the Principled// shader's diffuse, which goes dark where a card turns from the light; more keeps a card lit edge-on, which flattens locks into one tone.#pragma param u_strandDiffuse float default(0.6) range(0,1) ui(slider)+// Above zero, the highlight is the Principled shader's instead of the two strand lobes: GGX stretched along the strand by this anisotropy+// (Blender's), with u_specular as the specular factor (F0 = 0.04 x it). A card authored in Blender with an anisotropy shades as it did there.+#pragma param u_anisotropy float default(0) range(0,1) ui(slider)// A negative bias on the colour's mip level keeps the fine strands a hair card is covered in from washing out at a slant, which they do at once.#pragma param u_sharpen float default(-0.8) range(-3,1) ui(slider)// How much darker the roots are than the tips: the occlusion map's red, pushed.@@ -136,13 +139,14 @@ void main() {}SurfaceExt ext = surfaceExtNone(N);ext.aniso = vec4(T, 0.0);- ext.misc = vec4(0.046, max(u_lobeGain, 0.001), u_shiftPrimary + noise, u_shiftSecondary + noise);- ext.strand = vec4(u_strandDiffuse, 0.0, 0.0, 0.0);+ float principled = step(1e-4, u_anisotropy);+ ext.misc = vec4(mix(0.046, 0.04 * u_specular, principled), max(u_lobeGain, 0.001), u_shiftPrimary + noise, u_shiftSecondary + noise);+ ext.strand = vec4(u_strandDiffuse, u_anisotropy, 0.0, 0.0);ext.scatter = vec4(base.rgb * u_secondaryTint.rgb * 1.6, 0.35);ext.trans = vec4(u_translucency, 0.25, 0.0, 0.0);vec3 viewDir = viewDirection(P);g_hairShadow = u_hairShadow;- vec3 lit = applyLightingSurface(base.rgb, N, P, viewDir, 0.0, u_roughness, u_specular, ao, ext);+ vec3 lit = applyLightingSurface(base.rgb, N, P, viewDir, 0.0, u_roughness, mix(u_specular, 1.0, principled), ao, ext);fragColor = vec4(lit, alpha);#ifdef ES_GBUFFERfragSurface = vec4(packNormal(normalize(N)), u_roughness, 0.75);@@ -229,13 +233,14 @@ fn packNormal(n : vec3f) -> vec2f {}var ext = surfaceExtNone(N);ext.aniso = vec4f(T, 0.0);- ext.misc = vec4f(0.046, max(mc.u_lobeGain, 0.001), mc.u_shiftPrimary + noise, mc.u_shiftSecondary + noise);- ext.strand = vec4f(mc.u_strandDiffuse, 0.0, 0.0, 0.0);+ let principled = step(1e-4, mc.u_anisotropy);+ ext.misc = vec4f(mix(0.046, 0.04 * mc.u_specular, principled), max(mc.u_lobeGain, 0.001), mc.u_shiftPrimary + noise, mc.u_shiftSecondary + noise);+ ext.strand = vec4f(mc.u_strandDiffuse, mc.u_anisotropy, 0.0, 0.0);ext.scatter = vec4f(base.rgb * mc.u_secondaryTint.rgb * 1.6, 0.35);ext.trans = vec4f(mc.u_translucency, 0.25, 0.0, 0.0);let viewDir = viewDirection(P);g_hairShadow = mc.u_hairShadow;- let lit = applyLightingSurface(base.rgb, N, P, viewDir, 0.0, mc.u_roughness, mc.u_specular, ao, ext);+ let lit = applyLightingSurface(base.rgb, N, P, viewDir, 0.0, mc.u_roughness, mix(mc.u_specular, 1.0, principled), ao, ext);#ifdef ES_GBUFFERvar frag : FragOut;frag.color = vec4f(lit, alpha);diff --git a/tools/releaseNotes.mjs b/tools/releaseNotes.mjsindex aa428b7e8..b86d7030f 100644--- a/tools/releaseNotes.mjs+++ b/tools/releaseNotes.mjs@@ -70,6 +70,10 @@ export const NOTED = {{"note":"On the WebGPU backend, a mesh without a material, a sprite and a particle are sampled through their texture's mip chain, as they always were on WebGL2: their WGSL read level 0 alone, so anything drawn smaller than its texture shimmered into stripes and moire there and not on the other backend. A compressed (KTX2) texture also keeps every level of its chain on WebGPU: the upload stopped at the first level whose side is not a multiple of four, which left a 1240x1268 hair atlas with level 0 alone. In the render lab a card of fine strands seen small now reads the same on both backends."},'fix(render): a cut-out seen small lets through as much as its texture covers, instead of closing into a sheet':{"note":"A cut-out seen from far enough away that its texture is smaller than a texel a pixel lets through as much as its texture covers. Its alpha was sharpened to a texel around the cutoff at every distance, and once the mips had averaged fine strands and the gaps between them to one value above the cutoff, the whole card turned solid: a hair card at arm's length drew as a plate. Where the texture is minified the mip-averaged alpha is now the coverage under multisampling, and the cutoff moves to a per-pixel threshold without it. In the render lab a card of fine cut-out strands lets through within 3% of what Blender does, where it let through nothing; the shader helper is cutoutCoverage, and u_time.w carries the scene's multisampling."},+ 'fix(render): lit materials keep the energy a rough surface reflects, and a sun with a size casts a penumbra as wide as it throws':+ {"note":"Lit materials keep the light a rough surface reflects and pass on what it does not. The environment's specular came from Karis' analytic fit, 21% low for a metal at roughness 0.5 and up to 80% off at a grazing view; it is now a fit to the integral itself (tools/gen-dfg-fit.py, worst 3%). The light a rough metal loses to bounces between its microfacets is returned (Fdez-Aguera's multiple-scattering term, and the same ratio on a lamp's highlight), where a metal at roughness 0.9 under a white sky came out at half of Blender's brightness. The diffuse under a dielectric's specular is reduced by what the specular reflects, as in the Principled shader. And a lamp's highlight takes Smith's height-correlated masking at alpha = roughness squared in place of the Schlick k = (r + 1)^2 / 8 remap, which left a rough metal's rim a quarter dark. In the render lab six spheres under a white sky now match Blender within 0.5% at every roughness, and flat cards of five albedos within 0.002, on both backends. A sun with a size casts a penumbra as wide as Blender's. The disc a penumbra was averaged over stopped at 8 texels of the map, which held a sun's soft edge to sixteen texels: with a fine cascade that is less than the sun throws, and the render lab measured an edge 60% as wide as Blender's. The disc now reaches 24 texels, its spiral of taps is turned point by point so the wider disc grains rather than bands, and each blocker tap forgives only as far as it stands from the point, so a box standing on a floor stays shadowed to its foot."},+ 'feat(character): hair takes the Principled highlight when it has an anisotropy, and an imported card with one is set to it':+ {"note":"The Hair shader takes the Principled shader's highlight when u_anisotropy is above zero: GGX stretched along the strand as Blender stretches it, with u_specular as the specular factor. A hair card imported with an anisotropy (KHR_materials_anisotropy, which Blender exports from its Principled anisotropy) is set to it, so the broad sheen across a fringe that Blender draws is drawn in the same place."},'fix: serialize binaryen optimization on windows': { internal: 'Uses one optimizer worker after wider builds reproduced heap corruption with four; release optimization flags stay unchanged.' },'feat: add budgeted 2d and 3d particle scene collisions': { note: 'Budgeted particle scene collisions.' },'feat(editor): add particle collision authoring and diagnostics': { note: 'Budgeted particle scene collisions.' },