HighContrastSettings class final

A high-contrast look with outlines, for players who see little contrast or little detail — N9.

Three changes to the finished picture, and one to what a game marks. The texture detail inside each surface is flattened to the surface's mean; the result is drained toward grey and pushed apart in tone; every edge the geometry has is drawn as a line; and every node with a MeshNode.outlineColor is ringed in that colour, with a share of it laid over the node itself. The grey world is what makes the rings mean something: colour is left on exactly the things a game said matter.

The flattening is guided by the geometry, not the picture, which is the choice that makes it remove texture rather than shape. An edge-preserving filter on colour — bilateral, Kuwahara — has to call the mortar between two stones an edge, because in colour it is one, so the detail it was meant to remove is exactly what it keeps. Asking the surface buffer instead, a neighbour is averaged in when it is on the same surface — near the same depth, facing the same way — and left out when it is not. Texture lives within a surface and shape between surfaces, so a cross bilateral filter guided this way keeps the second and drops the first, for twenty-five taps of two textures and no threshold on colour at all.

Off by default, and switched on by a game rather than by this engine: it is an accommodation a player asks for, and flutter3d_game's highContrastOf is where the asking is read — the platform's own high-contrast flag as the fallback, the player's switch over it.

It costs the frame its multisampling, for ViewportShadingSettings' reason: the look reads the surface buffer, and attaching that takes the sample count off the scene pass. On a device that cannot attach the buffer at all the look still drains and pushes the tone, and has no edges to draw.

Constructors

HighContrastSettings({bool enabled = false, double flatten = 1.0, double flattenSpacing = 1.0, double contrast = 1.5, double saturation = 0.25, double depthEdge = 0.04, double normalEdge = 0.2, double outlineWidth = 1.0, LinearColor? outlineColor, double roleWidth = 3.0, double roleFill = 0.3})
The look off; the other defaults are what it starts from when enabled is switched on.
const

Properties

contrast → double
The gain on tone about mid grey: one leaves it, above one pushes light and dark apart.
final
depthEdge → double
How far depth may bend before it is another surface, as a share of the depth per tap.
final
enabled → bool
Whether the look is drawn. False is the default and an exact no-op: neither pass runs, and nothing reads a node's outline colour.
final
flatten → double
How much of each surface's mean replaces each pixel, nought to one.
final
flattenSpacing → double
How far apart the flattening's five-by-five taps are, in pixels.
final
hashCode → int
The hash code for this object.
no setteroverride
normalEdge → double
How far apart two normals must be to count as an edge, as one minus their cosine: 0.2 is about thirty-seven degrees.
final
outlineColor → LinearColor?
The outline's colour, or null for black. Linear, like every colour the engine takes; the line is drawn on the finished picture, so it is encoded to the display there and comes out the colour picked.
final
outlineWidth → double
How far the outline's taps reach, in pixels; nought draws no outline.
final
roleFill → double
How much of a marked node's colour is laid over the node itself, nought to one. Not nought by default: a ring alone around a small thing far away is a few pixels, and the fill is what makes it findable.
final
roleWidth → double
How wide the ring round a marked node is, in pixels, up to four; nought draws none.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
saturation → double
How much of each pixel's colour is kept, nought to one, after it is drained toward its own luma. Low by default, so the colour left in the frame is the colour a game marked.
final

Methods

copyWith({bool? enabled, double? flatten, double? flattenSpacing, double? contrast, double? saturation, double? depthEdge, double? normalEdge, double? outlineWidth, LinearColor? outlineColor, double? roleWidth, double? roleFill, bool clearOutlineColor = false}) → HighContrastSettings
A copy with the given fields replaced. A clear… flag resets that nullable field to null, which passing null cannot say.
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.
override