ParityScene enum

Builds the shared comparison scene on device.

Returns the scene and the camera to view it through; the caller supplies the renderer, because that is the part that differs. Which of the engine's features a comparison scene exercises.

One fixture per feature rather than one that does everything, because a grid that disagrees tells you that the backends differ and a fixture tells you where. Shadows and bloom in the same picture would have made "the atlas is wrong" and "the glow is wrong" the same number.

Inheritance
Available extensions

Values

plain → const ParityScene

Two lit spheres. Shading, geometry, uniforms — the smallest thing that can disagree.

directionalShadow → const ParityScene

The same, with a directional shadow onto a floor. The shadow pass, its map, and the lighting shader's lookup into it.

pointShadow → const ParityScene

A point light with the cube atlas, which is six faces per light and the most machinery of anything here.

bloom → const ParityScene

A bright sphere and bloom on, which is the post chain: threshold, downsample, upsample, composite.

pointShadowMap → const ParityScene

The cube atlas itself, composited instead of the lit image.

Splits the point-shadow question in two. If the atlas matches and the lit scene does not, the pass is right and the lookup is wrong; if the atlas does not match, the pass never got that far. One number cannot say which, and guessing between them is how an afternoon goes.

pointShadowStaticMap → const ParityScene

The static half of the cube atlas, composited instead of the lit image.

The split above was one short, and that cost six attempts. There are two cube atlases — the movers, redrawn every frame, and the things that never move, drawn once at load — and PointShadowDistance samples both and keeps the nearer occluder. pointShadowMap shows only the first. So a backend whose static atlas was empty passed the atlas fixture, failed the lit one, and every explanation offered for it was about the lookup, which was fine.

That is exactly what was happening in WebGL, and the note on the skipped fixture said "the atlas is right" for six attempts on the strength of a number that was measuring the other atlas.

sky → const ParityScene

The procedural sky behind the spheres.

Its own pass, its own stage pair, and the one place in this engine written against a target it did not match: the sky is fed through vertex attributes because its uniform blocks do not arrive on Impeller, and a stale translation once had the browser drawing a sky from the month before while nothing could see it.

imageBasedLighting → const ParityScene

Two physical spheres lit by a prefiltered environment and nothing else.

The direct light is off, so what the picture is made of is the cube and the roughness chain — the whole of image-based lighting in one number. It exercises what a backend finds hardest to get right quietly: a cube sampler, a mip chain uploaded level by level, and a level count that is also the "is there one" flag.

torchNearWall → const ParityScene

A point light a hand's breadth off the wall it lights, in a room.

Every other point-shadow fixture here puts the lamp in open space, a couple of metres from the two spheres and the floor, where one face of the cube map covers everything the light reaches and the static atlas holds a single small caster. A torch in a dungeon is the opposite of all three: it hangs 0.35 m off a wall, so the surface it lights leaves that face within a metre of the flame and continues into the four faces around it; the room around it — floor, ceiling, the wall behind the camera — is static geometry filling every one of those faces; and what the player is looking at is the wall the light is attached to, at a grazing angle, which is the hardest thing a shadow lookup is ever asked.

This is the fixture the crypt needed and did not have. The software backend cannot stand in for it: point shadows there change nothing in a scene of this shape — a frame drawn with them and one drawn without come back pixel for pixel identical — so the only comparison that can see this is one GPU backend against the other.

torchesRunningOut → const ParityScene

The same room with eight torches for six rows: two of them keep lighting and cast nothing.

It was built when Renderer.kShadowedLights was four: four rows, six lights, and which four got them decided per frame, so the fixture asked whether the two backends agree about which row each light reads on a frame where the answer has just changed. Raising the constant to six gave every torch a row and took that question out of the picture without anyone editing this scene — for a while the name was the only thing here still claiming there was any contention.

Eight puts it back. Two lights are denied a row, both backends have to deny the same two, and the six that hold rows have to agree about which row each of them is reading. Every other point-shadow fixture has one light, so a bug in how rows are written or read independently shows up only here.

The two that go without are not the last two in scene order, and that is the property to preserve if these positions are ever touched. Priority is range / distance to the camera, every torch here has the same range, and _torchStandoffs places them so the ranking is nothing like the order a level author wrote them down in. A fixture where the two agree passes with the allocator stubbed out to a constant.

look → const ParityScene

The plain scene with the composite look turned all the way up.

Grading, vignette, grain and chromatic aberration are the last thing that happens to a frame, they happen on every pixel, and they are the newest thing in the post chain. The grain is a hash of the pixel rather than of the clock, which is what makes this comparable at all.

Properties

hashCode int
The hash code for this object.
no setterinherited
index int
A numeric identifier for the enumerated value.
no setterinherited
name String

Available on Enum, provided by the EnumName extension

The name of the enum value.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Constants

values → const List<ParityScene>
A constant List of the values in this enum, in order of their declaration.