ViewportShadingSettings class final

Shading read out of the surface buffer instead of out of the materials — gfx-43n, gfx-44n and gfx-45n.

What this replaces is a traversal, and that is the point. A normals view built by walking the subject and swapping every material has to remember what it swapped and put it back; the modeller's own docstring documents what happens when the remembering fails. The scene pass already wrote a world normal and a view-axis depth into its second attachment, so every mode here is arithmetic on a buffer that exists — nothing is modified and there is nothing to restore.

It costs the frame its multisampling, and that is said here rather than found later: reading the surface buffer attaches the second colour attachment, attachments in one target must agree on sample count, so a frame with a mode on is a frame the scene pass did not multisample. FrameResult.antiAliasing.msaaDeclined reports it.

Constructors

ViewportShadingSettings({ViewportShading mode = ViewportShading.off, double amount = 1.0, double ambient = 0.25, double depthEdge = 0.05, double normalEdge = 0.15, double outlineWidth = 1.0, double curvatureGain = 4.0, double cavity = 1.0, Vector3? lightDirection})
const

Properties

ambient → double
How much ambient sits under the studio light in ViewportShading.clay.
final
amount → double
How much of the shaded result is mixed over the lit picture.
final
cavity → double
How much of the concave half is darkened, 0 to 1 — the cavity in a cavity map.
final
curvatureGain → double
The gain on the curvature estimate, which is a screen-space divergence and therefore a small number before it is scaled.
final
depthEdge → double
How far apart in metres two depths must be to count as an edge.
final
hashCode → int
The hash code for this object.
no setterinherited
lightDirection → Vector3?
Which way the clay light points, or null for over the camera's shoulder.
final
mode → ViewportShading
Which mode. ViewportShading.off is the default and an exact no-op.
final
normalEdge → double
How far apart two normals must be, as one minus their dot product: 0.15 is about thirty-two degrees.
final
outlineWidth → double
How wide the outline's neighbour taps reach, in pixels.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

copyWith({ViewportShading? mode, double? amount, double? ambient, double? depthEdge, double? normalEdge, double? outlineWidth, double? curvatureGain, double? cavity, Vector3? lightDirection}) → ViewportShadingSettings
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