SurfaceModel#
A surface model: how a surface is drawn and lit, and the parameters its built-in shader reads (engine code: a Slang file + this declaration). Named for what it can make, not for one look. A project shader datablock is built on one (see Shader); materials hold its values. Parameters are per material and lay out the shader's Material block in declaration order (one float4 each, named like the parameter; see MaterialBlock); Settings are per shader (the type), such as shell counts, and reach the shader in the Draw block's settings (at most four).
public sealed record SurfaceModel(string Id, string Name, IReadOnlyList<ShaderParameter> Parameters, IReadOnlyList<ShaderParameter> Settings)Record properties#
| Property | Type | Access | Constructor default |
|---|---|---|---|
Id | string | get; init; | required |
Name | string | get; init; | required |
Parameters | IReadOnlyList<ShaderParameter> | get; init; | required |
Settings | IReadOnlyList<ShaderParameter> | get; init; | required |
Members: Aliases · All · Distortion · Domain · Find · Liquid · Lit · Parameter · Setting · Strands · Streaks · Transmission · Unlit · Volume
Aliases#
public IReadOnlyList<string> Aliases { get; init; }Initial value: Array.Empty<string>()
Earlier IDs this model answers to (projects keep loading unchanged).
All#
public static IReadOnlyList<SurfaceModel> All { get; }Initial value: new[] { Lit, Unlit, Strands, Transmission, Liquid, Streaks, Volume, Distortion }
Distortion#
public static readonly SurfaceModel Distortion;A world-anchored effect's screen refraction. Strength is in output pixels; it changes colour sampling, not physics.
Domain#
public SurfaceDomain Domain { get; init; }Initial value: SurfaceDomain.Mesh
Find#
public static SurfaceModel? Find(string? id);The model for an ID or one of its aliases.
Liquid#
public static readonly SurfaceModel Liquid;Open liquid (sea, lake, pool, puddles): a surface (a fine plane) moved by Gerstner waves and ripples, drawn after the opaque scene, reading the depth behind it: shallow tint, deep scattering, refraction fading at the shore, foam where it is thin, Fresnel reflection and a sun glint; ripples from the interaction field.
Lit#
public static readonly SurfaceModel Lit;Any opaque physically based surface: metallic-roughness GGX with image-based lighting, shadows, ambient occlusion and shoreline wetness.
Parameter#
public ShaderParameter? Parameter(string name);Setting#
public ShaderParameter? Setting(string name);Strands#
public static readonly SurfaceModel Strands;Anything made of many fine strands over a surface (fur, grass, moss, velvet): the mesh drawn again as stacked shells along its normals, each keeping the procedural strands that reach it. Lit with wrapped diffuse, SH ambient darkened toward the roots and two shifted strand highlights.
Streaks#
public static readonly SurfaceModel Streaks;The look of Streaks effect elements (sparks, embers, tracers): emission from the particle's temperature (blackbody color, brightness ∝ T⁴ relative to the glow temperature) mixed with a flat tint, times intensity, added to the HDR image as analytic motion-blurred capsules (Shaders/Models/Streaks.slang). Effect domain only.
Transmission#
public static readonly SurfaceModel Transmission;Light passing through a surface (clear, frosted or colored glass, bubbles, ice): drawn after the opaque scene, it refracts a mip-blurred copy of what is behind it (depth 0 = a thin shell), tints it with depth (Beer-Lambert) and reflects the scene's environment or its own; thin-film interference and a wobble.
Unlit#
public static readonly SurfaceModel Unlit;Color as authored, without lighting or shadows: UI and signs in 3D, emissive shapes, stylized art. It still passes through exposure and tonemapping like everything in the 3D view, and it casts shadows.
Volume#
public static readonly SurfaceModel Volume;The look of scattering media (smoke, dust, steam; Splats now, Medium later): absorbs by its extinction, scatters the sun forward or back by its anisotropy (Henyey-Greenstein) and the sky evenly, with a scattering color (albedo), and may glow from temperature (blackbody). Detail noise in each puff's own frame breaks up its density. Drawn into the reduced-resolution volume buffer (Shaders/Models/Volume.slang). Effect domain only.
Related types#
ShaderParameter · SurfaceDomain
Source#
- SurfaceModel.cs