多重重要性采样与平衡启发式
Our last note, Light Sampling and the Area Jacobian, put a legal light density on . The one before that, Importance Sampling: Phong Lobe vs Cosine, kept two BSDF pdfs on a single integral, both already in . This time, we're bringing both ideas together on the same kiln mouth.
We have two legal densities estimating one direct-light integral. One is a Phong–Lambert BSDF. The other draws a point uniformly on a rectangle and pushes that area density through the area Jacobian. Each arm—when divided by the density it actually sampled—is strictly unbiased, and each happens to be noisy exactly where the other is quiet. The balance heuristic weights a given sample by its own pdf over the sum of the two:
The variance shifts around, but the estimator itself remains unbiased. If we use equal technique counts, the terms cancel out, leaving the weight exactly as written on the page: . Notice that the light weight still carries . Dropping that , or forgetting the emitter cosine, creates a biased floor—a pitfall we covered thoroughly in the area-Jacobian note, so we won't re-litigate that omission here.
Importance Sampling: Phong Lobe vs Cosine owns the variance photograph for two BSDF pdfs, as well as the split that puts in the pdf and in the BRDF. We're keeping that split and that horizon rule. We aren't going to rematch Phong against cosine, and we aren't reprinting that note's RMSE pair. Light Sampling and the Area Jacobian owns:
We are reimplementing that exact factor here as . Solid Angle and the Rendering Equation owns the projected solid angle that a diffuse term integrates, and the Lambert piece here uses that same signed contour. The disk ratios and the omission floors belong in their own notes.
Say hello to the kiln-mouth glaze shelf. Imagine a rectangular muffle mouth sitting flush in firebrick, with a single pale glaze tile lying flat on a stoneware shelf. We've got two matte pyrometric cones and a wooden rib in there for scale. The camera is inside the kiln, positioned low along the shelf, looking straight at the mouth. (The loft bottle, the metro colonnade, the gallery lacquer sphere, the courtyard atrium, and the night inspection bench are all staying in their respective notes.)

Let's run the hero stats. We're on Mesa 25.0.7 llvmpipe, linear Rec.709, Khronos PBR Neutral (), with seed 20260926. Parameters are , , . Radiance , giving us . The mouth area is . (The bound product you'll see in the metrics table is ).
For the lip : , , and the specular-over-diffuse ratio is . For the miss : , , and the specular-over-diffuse ratio is a tiny . That miss ratio is effectively zero next to the Lambert term.
Now for the winners (the single arm with the smaller RMSE): at the lip, it's bsdf at both and ; at the miss, it's light at both (winner_lip_N64, winner_lip_N1024, winner_miss_N64, winner_miss_N1024).
Look at how the lip RMSE drops from to : the BSDF goes , light goes , and balance goes .
For the miss: BSDF drops , light drops , and balance drops .
Let's check the disk standard error on the variance plate. At the lip, the light arm sits at (our lede 0.308) compared to the BSDF arm's , with balance at . Over at the miss, the BSDF arm sits at compared to the light arm's , with balance at . Right at the lip's mirror hit, we have , , , and . Assertions: 53 pass / 0 fail.
Pin this. The variance plate is our primary teaching figure here. It maps the standard error of those exact draws using a shared scale, authored in sRGB. The ring on the right of the screen is the lip; the left ring is the miss. Notice how the light panel runs hot on the lip ring but quiet on the miss ring. Conversely, the BSDF panel is hotter on the miss ring than on the lip ring. Balance comfortably sits under the hot ring in both places, and just a little over the quiet ring in both places. Keep in mind: the balance heuristic doesn't have to beat the single arm that already perfectly matched the integrand. On this particular run, it doesn't.

What you are seeing
The working space is scene-referred linear Rec.709. We have one kiln, one rectangle, one glaze tile. For the photographs, the display path matches the one from the tone-mapping note: Khronos PBR Neutral, , , , , followed by the IEC 61966-2-1 sRGB OETF applied on the CPU. Remember, Neutral assigns code values; it doesn't author .
Cover — the kiln. This is the balance arm at , plus the named diffuse fill, rendered at . You can see the mouth, brick, shelf, cones, and rib. There are no labels and no digits here. Treat the JPEG strictly as a photograph—it's not the meter.
Three arms — the control. BSDF, light, and balance evaluated at . The mouth, the brick, and the shelf all match across the panels before Neutral is applied. Only the tile pixels actually change with the arm. The cones and the rib are cropped out by these narrow frames, but you can see them whole on the right side of the tile in the cover image.

Variance plate — teaching pin. This maps the per-pixel standard error of the terms that drew the three-arm photograph. It uses one shared scale. The scale maximum is anchored by the hottest tile pixel across all three arms, stderr_scale_max . The lip's light disk mean, , is roughly a third of that maximum. Keep in mind that the maximum is a single pixel, while the disk is an average. Non-tile pixels fall outside the scale entirely, and this plate skips Neutral completely.
Ladder — the RMSE. Here's the relative RMSE plotted against the quadrature , with the lip row on top and the miss row below. BSDF is blue, light is orange, and balance is green. Because is categorical, the four rungs are spaced equally, making the RMSE linear. Each row scales to its own local maximum, meaning a tall mark on the miss row and a tall mark on the lip row represent completely different numbers. We don't print RMSE digits on the chart itself; quote the table below for the actual numbers.

Metrics strip — snapshot. A capture of our metrics table across two columns. If any glyph on that JPEG looks soft or gets clipped, trust the markdown table in the text.

Keep two facts completely separate:
- Photographs (like the cover and the three-arm panels) show the room passed through Neutral, then sRGB. You cannot read , , RMSE, or the disk standard errors off those JPEGs. At , a light-arm firefly can easily shoulder to white under Neutral. The estimator isn't clamped before we form the standard error.
- Instruments (like the variance plate, the ladder, the metrics strip, and the tables) come straight from the CPU double estimator. Always quote the tables.
Two legal arms on one mouth
The rendering equation at a shade point on our tile asks for an integral in steradians. The BSDF arm draws those steradians from a mixture: with probability it uses a cosine hemisphere around the tile normal, and otherwise it uses a Phong lobe around the reflection of the view vector. The light arm, meanwhile, draws a point uniformly on the mouth and converts that area density using the Jacobian. Both arms are estimating outgoing radiance , specular included. The diffuse closed form acts as the ground truth strictly for the Lambert piece. If you try reading a glossy estimator against and call the gap "bias", you're misreading the meter. Down at the lip, the specular is roughly four times the diffuse. Over at the miss, the two agree perfectly.
Lip. The mirror ray cast from hits the mouth exactly at . (Our metrics table prints that hit exactly as ). This sits 80 mm above the sill and 0.22 m from either side edge. Because our Phong lobe of exponent 160 sits right on that hit, most specular samples land directly on the emitter. The mouth covers . A lobe with this tight an exponent concentrates on a cap of order , making the mouth about eight times larger than that cap. As a result, a uniform area draw usually misses the peak entirely, but occasionally lands right inside it. Those rare, lucky hits? Those are your fireflies. The BSDF arm is already aimed at the peak, which is why its variance stays lower. In the photograph, this failure mode looks like speckling on the light panel right across the lower lip of the reflected mouth.
Miss. Cast the mirror ray from and it misses the mouth entirely. The actual hit prints as , missing past the left edge and dropping below the sill. The largest value we find anywhere on the rectangle is , sitting roughly off the mirror axis. This view is notably more grazing than the other: at the miss, compared to at the lip. Numerically, the specular integral here is zero. All we have left is the Lambert term, spread cleanly across the whole mouth. However, the mixture still burns of its samples on a lobe that never even touches the emitter. A cosine sample hits the mouth with probability , which works out to about at this point. The light arm, by contrast, draws the mouth flawlessly on every single sample. Because the Lambert integrand varies so smoothly across the rectangle, that arm runs incredibly quiet. In the photograph, this failure mode shows up as grain on the lit tile exactly where the highlight slid off the mouth.
Balance. On every sample, the weight is just that sample's pdf divided by the sum of the two pdfs. If a light sample manages to land directly inside the lobe—where is enormous—it gets heavily down-weighted. That mechanic is exactly what cuts out the lip firefly. Right at the mirror hit, the light sample gets throttled to , while the BSDF sample, which was already aiming where the arm needed it to, stays dominant at . Conversely, if a BSDF sample hits the mouth way out on the Lambert flank—where represents the density faithfully covering the emitter—it gets down-weighted in the other direction. Wherever one pdf hits zero, the other weight simply becomes 1. Off the mouth entirely, the integrand is already zero anyway. The combined estimator remains unbiased as long as each technique is unbiased on its own, and the weights cleanly partition unity wherever the integrand is nonzero.
Notice that balance comfortably sits below the worse single arm at both points, across every single rung from all the way to , and sits inside both disks on the variance plate. It might sit above the better arm, and on this run, it actually does in those exact places. At the lip, the BSDF arm wins. At the miss, the light arm wins. The balance series for the lip tracks the BSDF arm (hovering just above it) while staying well below the light arm. The miss's balance series tracks the light arm the exact same way.
All three arms are entirely legal. Neutral is applied on every panel of the three-arm photograph because none of these represents a broken weight.
The balance weight
One shade point , one outgoing direction toward the eye, one rectangle.
| symbol | meaning | unit |
|---|---|---|
| shade point on the tile | ||
| point on the mouth | ||
| , tile toward the mouth | unitless | |
| direction from toward the eye | unitless | |
| tile normal, | unitless | |
| mouth normal, , into the room | unitless | |
| unitless | ||
| unitless | ||
| mouth area | ||
| on the mouth, else 0 | ||
| unitless | ||
| Phong exponent, 160 on the hero | unitless | |
| Lambert weight, Phong weight | unitless | |
| , | unitless | |
| constant one-sided mouth radiance | linear Rec.709 | |
| mouth integrand | linear Rec.709 | |
| outgoing radiance from the mouth | linear Rec.709 | |
| projected solid angle of the mouth | ||
| the two densities | ||
| integrand evaluations in one estimate | count | |
| , the count of each technique inside balance | count |
Just to clarify the vectors: uses the direction from the mouth pointing toward the tile. uses the direction from the tile pointing toward the mouth. If we used one shared dotted into both normals, we'd end up flipping a sign. Fortunately, both cosines are positive for every mouth point across both instrument points. The printed minima are at the lip and at the miss, alongside at the lip and at the miss.
BSDF. This is Lambert plus a Lafortune Phong lobe aligned around . It's achromatic, using the exact same split we detailed in the importance-sampling note.
Our locked values for the run are , , and . That puts and . Our metrics table prints these explicitly as and .
Notice that is the BRDF constant, while is the pdf constant. At , they only differ by , so testing a white furnace at our hero exponent won't easily catch a swap bug. The ratio serves as an algebraic check. If you want a furnace that actually exposes a swap, run it at . At that exponent, the mean is against , exposing a relative gap of about .
Sampling the BSDF arm acts as a single technique. We draw . If , we draw from the cosine hemisphere (, ). Otherwise, we draw from the Phong lobe around (, ). The contribution is then divided by the full mixture . It's critical that the balance weight sees that marginal density—if we just divided by the individual component density, we'd be building a completely different estimator. If , the integrand goes to 0, the sample still counts, and isn't renormalized. That's our importance-sampling horizon rule at work. At both of our locked points, the lobe axis sits above the horizon, so both horizon fractions safely print as 0.
Light density. Assuming the mouth sits in the front half-space and the ray actually hits the rectangle:
Otherwise, . This is simply our area-Jacobian factor. A sample missing the rectangle contributes exactly 0 because there. The area draw itself, using , looks like this:
Integrand, mouth only. (The analytic fill sits completely outside these three arms).
when the ray successfully hits the mouth and both cosines are positive. Otherwise, .
The light-arm term gives us two ways to write the exact same quantity:
That emitter cosine in the numerator is just the geometry term. It's the Jacobian undone, not a second copy of it. If you throw in an extra , or forget the , the Lambert reduction breaks immediately. We rely on that failure as a check. It doesn't get a frame. The measured omission floors from the inspection-bench note are not the result of this note.
Balance, equal counts. For any technique taking samples, the general weight is . Because this note gives both techniques the exact same count , those counts gracefully cancel out:
Everywhere on the support of , both densities are strictly positive at our locked points. Because the mouth sits in the front hemisphere, the cosine piece of stays positive, and is positive on the mouth. Right there, . The lip-direction pair sums perfectly to 1 within our check.
Off the mouth entirely, . If a BSDF sample misses, it gets , but its integrand is already 0. Conversely, any direction where and simply gets . The weights cleanly partition unity anywhere the integrand has a chance to be nonzero.
For stable evaluation (used whenever ): just use . It yields the exact same number as the raw ratio.
Three arms, budget . We're looking at . By "budget", we mean strictly the number of integrand evaluations. Evaluating the other pdf to build a balance weight doesn't count as a second sample. We don't give the single arms extra samples to pay for calculating that pdf.
That is absolutely required. If you put a in front of each balance sum, you accidentally cut the estimator in half. The technique split is purely deterministic: the first draws come from the BSDF stream, and the first come from the light stream.
Fill, computed after the arm, diffuse only. The Phong term never sees it. Because both instruments keep the mouth fully in the front hemisphere, we get:
When you look at the ladder and the signed means, they're comparing the mouth integral strictly against the quadrature . The fill is not inside those numbers. The photographs add this one analytic term—the exact same term across every arm. Matte surfaces fall back to the analytic Lambert expression using their own albedo in place of , and they never take a Phong sample. Fill radiance sits at , with .
Truth. The diffuse piece is just the signed four-corner projected solid angle. Vertex order inherently handles the sign. Our run prints at both points.
As for the specular piece, there is no tidy four-corner form for this specific Phong model. The absolute truth of , specular included, is computed via a tensor-product Gauss–Legendre rule across the mouth's parameter square, using cells with order 40 in each cell. The metrics table refers to this as gauss_legendre_8x40. A lighter rule agrees with it to within a relative on at both points. The diffuse-only quadrature agrees with the contour to within a relative . The published you see here is the heavy order-40 value.
Why . The Phong mass is concentrated tightly on a cap of order . At the lip, the mouth is several times larger than that cap, so area samples mostly miss the peak, while Phong samples aimed right at the inset hit comfortably land on the mouth. Down at the miss, evaluating over the whole rectangle is utterly negligible compared to the Lambert term, which is exactly what the miss specular/diffuse ratio is telling us. If we used an exponent wide enough to cover this mouth, it would stop the light arm from fireflying entirely. We're using one exponent, so there is no exponent plate.
Error. We use independent prefixes, seeded at 20260926 via SplitMix64, mapping the top 53 bits directly to . Stream 0 opens with , , . The estimate at is simply the prefix. We measure error on Rec.709 (coefficients , , ) directly against the quadrature:
The draws are IID. The statistic we actually need to see fall is the RMSE across the prefixes. A single prefix of a heavy-tailed light arm can wiggle wildly while the overall estimator remains completely unbiased.
Standard error on the variance plate, pulled from the same draws as the three-arm photograph. For a single arm, the sample variance of the Rec.709 terms uses , giving us . For balance, we pull terms from each technique, with each term already multiplied by its respective balance weight, yielding:
The two techniques are strictly kept separate. They aren't treated as one giant population of numbers, and the variance isn't divided by a second time. Since fill is a constant on a given pixel, it sits outside this accumulator. The quoted disk figures are simply the mean of that per-pixel standard error evaluated inside a 12 mm radius.
The kiln mouth
World in meters, up, right-handed. The only emitter in the scene is the muffle mouth: bounded by plane , , , with an outward normal of . That gives a width of , height of , and . It's one-sided, so emits nothing. Exposure is set to .
The eye is just the reflection construction that maps the lip's mirror ray cleanly onto the chosen hit, making the inset an identity.
| value | |
|---|---|
| eye | |
| target | |
| vertical FOV |
| lip | miss | |
|---|---|---|
| specular / diffuse | ||
Because is achromatic, and share a single scalar across all channels with . The mouth easily dominates the fill at both sample points. The glaze tile is the only Phong surface in the entire scene, and its top surface sits at . Both of our instruments—and the 12 mm disks drawn around them—lie flush on that top surface. Everything else (the shelf, cones, rib, firebrick, and floor) is purely matte. The cones and rib sit strictly on the camera side of both instruments, so a line segment drawn from either instrument straight to the mouth will never intersect them. The estimator runs completely unoccluded. Corners facing away from the mouth are dark simply because the back wall sits exactly on the mouth's own plane, and our fill is just a constant Lambert ambient. Nothing bounces. There are no contact shadows beneath the cones.
The distance ratios sit at for the lip and for the miss. That tells us the Jacobian isn't just a constant across this mouth. But to be clear, they aren't an omission floor, and we aren't plotting one here.
The ladder
Lip, relative RMSE against :
| BSDF | light | balance | |
|---|---|---|---|
| 16 | |||
| 64 | |||
| 256 | |||
| 1024 |
Miss, against :
| BSDF | light | balance | |
|---|---|---|---|
| 16 | |||
| 64 | |||
| 256 | |||
| 1024 |
Look at how every series cleanly falls at every rung. Each value is more than five times higher than its matching value. Our check was simply that it falls at every rung and drops by a factor of at least three. We didn't set a hard numeric RMSE target in advance—the table you see is just the raw result.
If you divide the printed keys, light over BSDF at the lip runs about at and about at . Over at the miss, BSDF over light is roughly at and at . The same dynamic, even without those exact numeric factors, holds true at and : the light arm is consistently the worse one at the lip, the BSDF arm is the worse one at the miss, and balance comfortably tucks itself below whichever arm is failing. The winners are exactly the literals bsdf, bsdf, light, light.
Notice that balance stays above the better arm on every single rung. At the lip at , it's against the BSDF arm's . At the miss at , it hits against the light arm's superior . That gap to the worse arm is precisely what the weight is designed to close.
The lip light arm is our heavy tail. Just a few lucky area samples end up carrying the lobe. Its RMSE plummets from down to —dropping faster than the BSDF arm—but it's still definitively the worse of the two at . The miss BSDF arm is our other heavy tail, and it remains the worse arm even at the top of the ladder.
Signed means at :
| arm | lip | miss |
|---|---|---|
| BSDF | ||
| light | ||
| balance |
The unbiasedness check we use is with . If there were a bias floor, the absolute mean would land on the same scale as the RMSE. Every arm at both sample points comfortably clears the gate. The largest absolute mean at the lip is from the balance arm, sitting at about a third of its RMSE. The largest at the miss is the BSDF arm, hovering just under a quarter of its RMSE.
Here are the disk means of the standard error, the exact numbers drawn on the teaching pin:
| disk | BSDF | light | balance |
|---|---|---|---|
| lip | |||
| miss |
Quote the metrics. Do not quote the beauty photographs as meters.
CPU double, before Neutral. Seed 20260926. Beauty display is Khronos PBR Neutral, , with constants not re-fit. The RMSE series are the tables in the previous section.
| item | value |
|---|---|
| seed / / | 20260926 / 32 / 16, 64, 256, 1024 |
| on the three-arm and variance plates / on the cover | 64 / 1024 |
| / / | 160 / 0.34 / 0.28 |
| / | 0.5483870967741935 / 0.4516129032258064 |
| stream 0, first three uniforms | 0.7466817377103402, 0.669510631620856, 0.5708748435191999 |
| RGB / | (7.5, 4.8, 2.2) / 5.186299999999999 |
| RGB / | (0.012, 0.014, 0.018) / 1.3863600000e-02 |
| exposure / Neutral | 1.00 / , , , |
| eye | (0.1453673781693574, 1.505862424473805, 1.453673781693575) |
| target / vertical FOV | (0, 1.18, 0.28) / 46° |
| lip / miss | (0.04, 0.90, 0.40) / (−0.28, 0.90, 0.28) |
| mouth / / | [−0.22, 0.22] / [1.05, 1.64] / 0.2595999999999999 m² |
| lip / miss | 0.3212572527424995 / 0.2742559005975028 sr |
| lip / miss | 1.666136489898425 / 1.422373377268829 |
| lip / miss | 0.1803182235985176 / 0.1539368726619603 |
| lip / miss | 0.8922731625666653 / 0.1539368726945163 |
| specular / diffuse lip / miss | 3.948324937768523 / 2.114893779357608e-10 |
| panel / fill lip / miss | 42.61218441186641 / 35.78152895218164 |
| lip / miss | 2.06098792642672 / 2.89530225013162 |
| lip / miss | 0.4966085446506598 / 0.4366167162249477 |
| on the mouth, miss | 0.8789249543972235 |
| / at the lip hit | 11.65879108669897 / 0.956701082414125 |
| / at the lip hit | 0.9241645851315697 / 0.07583541486843028 |
| winners, lip / | bsdf / bsdf |
| winners, miss / | light / light |
| disk stderr lip, BSDF / light / balance | 0.1197899661872358 / 0.3079049113038804 / 0.1312898735904618 |
| disk stderr miss, BSDF / light / balance | 0.0772988573354273 / 0.01309165077371938 / 0.01779797833390362 |
stderr_scale_max |
0.9246898237889386 |
| horizon fraction, lip / miss | 0 / 0 |
| fixture S, | 0.002397921970815975 sr |
| furnace, , mean | 0.619901030295896 against |
| Lambert reduction, max | 0.002711173413998751 |
| ground truth | gauss_legendre_8x40 |
| asserts | 53 pass / 0 fail |
A few shortenings are strictly for the eye. Lip light disk standard error 0.308 translates to . Mouth area 0.2596 is actually the bound product . Keep in mind, none of these quick visual shortenings replace the full precision table.
Honesty gaps
- The actual meter is the CPU double contour, the double Gauss–Legendre rule, and the double estimator. The room we render for the photograph uses float32. The metrics table isn't read off a JPEG. We keep in double precision because a float32 evaluation of that power would aggressively underflow on the lobe shoulder, heavily biasing the lip. A mouth pixel reads back before Neutral even touches it. The framebuffer is perfectly linear. One front-facing shelf pixel cleanly agrees between the CPU double Lambert value and the float32 shading to a relative on . Our build's linear reading of the hero pixel nearest the lip is the balance sample at , against an analytic Lambert stand-in at . Those two readings are not keys in our metrics table.
- Neutral might easily shoulder an light-arm firefly right to white. We do not clamp the estimator before forming the standard error. The absolute size of the firefly is simply the standard error on the variance plate. We aren't making claims about energy after Neutral is applied. The constants are exactly from the tone-mapping note: , , , , and they are not re-fit.
- The variance plate maps float standard error, authored in sRGB. It shares a single scale anchored at . If we used a per-panel autoscale, it would still technically pass the disk inequalities, but it would fundamentally be the wrong plate. The disk means are strictly averages, while the scale maximum is drawn from one single tile pixel.
- Balance sits below the worse arm and above the better arm. At the lip, it tracks the BSDF series. At the miss, it tracks the light series. The weight handles the mixture exactly as designed, but this is not a claim that balance somehow beats the arm that already perfectly matched the integrand.
- The integral is completely unoccluded. Because the back wall is coplanar with the mouth, it doesn't see the emitter at all. Corners stay dark because the fill is a constant Lambert ambient and absolutely nothing bounces. We intentionally omitted specular fill: if we put a Phong lobe over a constant dome, we'd add a highlight that isn't the mouth. You won't find a contact shadow under a cone, and there is no visibility term.
- A single prefix is not a monotone statistic. The locked meter relies on RMSE over . The lip light arm has a notoriously heavy tail. A single walk of length 1024 can wiggle wildly while the underlying weight remains perfectly correct.
- The Lambert residual is the band evaluated at a final count of 16384. We have
lambert_reduction_max_abs_mean_rel. The check uses at the lip across eight replicates, treating the contour as truth. The printed number is the largest absolute mean relative error of the three arms at that final count. On these specific replicates, the cosine arm acts as a hit-or-miss draw, with sitting around a tenth. The absolute mean relative error was at 512 and at 4096—both landing outside —while the light arm stayed perfectly quiet. The fall from a prefix of 32 down to a prefix of 512 serves as a separate check, and it safely holds. If you drop , add an extra , or build a balance average that mistakenly puts in front of each sum, you will miss the band by a massive margin. The count of 16384 is just the sample count behind this single residual; it's not a beauty rung and certainly not a second ladder. - The white furnace runs at , not the hero exponent. Mean against . Fixture S, with , acts as the on-axis contour. To be clear, neither test constitutes a frame.
- The JPEG is simply 8-bit display-referred. Everything that matters—, , RMSE, signed means, and standard errors—lives directly inside the double estimator and in the table above. The room is drawn via a single fragment shader on llvmpipe. We make zero GPU, wavefront, or frame-time claims here.
What this run can claim
| item | value |
|---|---|
GL_VERSION |
4.5 (Core Profile) Mesa 25.0.7-2+deb13u1 |
GL_RENDERER |
llvmpipe (LLVM 19.1.7, 256 bits) |
| OSMesa | core 3.3 request |
| FBO color | RGBA32F, and , nearest |
GL_FRAMEBUFFER_SRGB |
disabled |
| MSAA | disabled |
| RNG | SplitMix64, seed 20260926. Top 53 bits to . Not a sin-hash |
| Neutral | 1.00 |
| Estimator | CPU double. The shader draws the analytic room. The CPU overwrites tile pixels. |
Can claim: On this specific OSMesa / llvmpipe build, a CPU double estimator successfully drew a Phong–Lambert mixture and a uniform area on a single unoccluded rectangle, accurately converted the area draw using the legal Jacobian, and neatly combined the two with the balance weight using equal technique counts. At both locked points, all three arms' relative RMSE successfully fell from to against the quadrature , and the balance RMSE securely sat below the worse single arm at every single rung. At the lip, the BSDF arm won at and at . Over at the miss, the light arm won at both. The variance plate cleanly shows the per-pixel standard error of those terms at on one shared scale, placing the lip light disk at . The cover genuinely shows the balance estimator at , backed by the named diffuse fill, under Neutral . The run proudly prints 53 pass / 0 fail.
Cannot claim: Any GPU, wavefront, ray-tracing core, or frame-time budget. The meter absolutely never reads the shader's tile pixels back as . We claim nothing regarding energy after Neutral. You cannot safely measure anything by sampling the JPEG of the cover or the three-arm plate. We make no claims about interreflection or shadows cast under cones. We do not claim that one prefix acts monotone, or that balance magically beats the better arm. Finally, this weight hasn't been ranked against a power heuristic, VNDF, or a complex multi-light survey, and we definitely didn't evaluate in float32.
For this specific run: 53 pass / 0 fail. We rigorously checked the geometry, the signed contour, the Gauss–Legendre agreement, the lip-direction pdf, and both balance weights before treating the photographs as meters. The RMSE successfully fell on every arm at both sample points. The disk inequalities consistently hold on one shared scale, and the horizon fraction safely reports 0 at both points. At its final count, the Lambert band prints exactly .
Out of scope
Tweaking a power of , including targeting a point marked , creates a completely different weight. Balance in this context strictly refers to the weight proportional to . Adding a second mouth, an environment map, a mesh light, or a three-strategy balance that tears cosine and Phong into totally separate arms is strictly out of scope. We intentionally use one rectangle because it already forces the two single arms to fail in distinct, useful places.
We're keeping occlusion, a cone casting shadows on the tile, multi-bounce, Russian roulette, and any path longer than the direct mouth out of bounds. The half-vector Jacobian, Smith , VNDF, GGX, and Fresnel all stay out as well. We can easily write a balance weight for a Phong lobe aligned around simply because that lobe is already formulated as a density in .
Pitting Phong directly against cosine as competing arms, tracking firefly counts, and running an exponent sweep stay firmly in the importance-sampling note. Cosine only shows up here as a basic component inside . Dropping , omitting the emitter cosine, reviewing the equal- histogram, and discussing the centroid shortcut all live in the area-Jacobian note. The Jacobian's only role here is serving as the legal .
w_i = p_i / (p_bsdf + p_light) # n_bsdf = n_light, so n_i cancels
p_bsdf = pi_d * (n·ω)/π + pi_s * (s+1)/(2π) (R·ω)_+^s
p_light = (1/A) * r^2 / cos_y # on the mouth, else 0
f_r = kd/π + ks * (s+2)/(2π) (R·ω)_+^s # s+1 is the pdf; s+2 is the BRDF
ell / p_light = f_r * Li * cos_x * cos_y * A / r^2
Lhat_bsdf = (1/N) sum ell / p_bsdf
Lhat_light = (1/N) sum ell / p_light
Lhat_bal = (1/n) sum w_bsdf * ell / p_bsdf
+ (1/n) sum w_light * ell / p_light # n = N/2
E = Li * Omega_perp # diffuse truth, signed contour
Lo = Gauss-Legendre 8x40 # mouth integral, specular included
Lo,Y lip = 0.8922731625666653
winner lip = bsdf # N=64 and N=1024
winner miss = light
stderr lip, light arm = 0.3079049113038804 # disk mean, N=64; lede 0.308
asserts = 53 pass / 0 fail
beauty 00, 01 = sRGB_OETF(Neutral(e * Lo)) # e=1.00
variance plate = authored sRGB of float stderr
Pin the cover as the kiln evaluated at balance, . Pin the variance plate as our teaching figure. Pin the three-arm photograph to show two legal densities evaluated at a single . Pin the ladder to track the RMSE. That's two legal densities on one mouth. The balance weight successfully shifts the variance, and the estimator stays perfectly unbiased.