Class ProjectedDecalDefinition
Namespace: ValveResourceFormat.Renderer.Decals
Assembly: Renderer.dll
What a projected decal looks like and how large it is. Register one with ProjectedDecalSystem.Register(ProjectedDecalDefinition). Whether its textures are files of their own or parts of an atlas only changes ProjectedDecalDefinition.TextureRect.
public sealed record ProjectedDecalDefinition : IEquatable<ProjectedDecalDefinition>Inheritance
object ← ProjectedDecalDefinition
Implements
IEquatable<ProjectedDecalDefinition>
Properties
AdditiveAmount
Gets how much of the surface an emissive decal leaves visible under it, from 0 to 1.
public float AdditiveAmount { get; init; }Property Value
float
AlphaCutoffSoftness
Gets the alpha range the cutoff edge is softened over, for a decal whose alpha is a cutoff.
public float AlphaCutoffSoftness { get; init; }Property Value
float
BlendMode
Gets how the decal is blended.
public ProjectedDecalBlendMode BlendMode { get; init; }Property Value
ColorTexture
Gets the color texture, with opacity in alpha.
public required string ColorTexture { get; init; }Property Value
string
CutoffAngle
Gets the angle in degrees between the surface and the projection past which the decal is cut off, or null to fade it along the box depth instead.
public float? CutoffAngle { get; init; }Property Value
float?
CutoffAngleSoftness
Gets the angle in degrees the cutoff fades over.
public float CutoffAngleSoftness { get; init; }Property Value
float
Depth
Gets how far the decal box reaches through the surface, in world units.
public float Depth { get; init; }Property Value
float
DepthFade
Gets the fraction of the box depth the decal fades in over.
public float DepthFade { get; init; }Property Value
float
DepthOffset
Gets how far the box centre sits out of the surface, in world units.
public float DepthOffset { get; init; }Property Value
float
DepthVariance
Gets the most the depth varies by, in world units.
public float DepthVariance { get; init; }Property Value
float
EmissiveColor
Gets the linear color an ProjectedDecalBlendMode.Emissive decal is multiplied by.
public Vector3 EmissiveColor { get; init; }Property Value
FadeDuration
Gets the seconds the fade takes.
public float FadeDuration { get; init; }Property Value
float
FadeStartTime
Gets the seconds a decal stays before it starts to fade.
public float FadeStartTime { get; init; }Property Value
float
Features
Gets the shader features that are on, by the names decal materials give them, such as F_TRIPLANAR_MAPPING. The decal shader decides what each does, and ignores those it lacks.
public IReadOnlySet<string> Features { get; init; }Property Value
IReadOnlySet<string>
Height
Gets the height of the decal in world units.
public float Height { get; init; }Property Value
float
HeightScale
Gets how far the height texture displaces, in texture space.
public float HeightScale { get; init; }Property Value
float
HeightTexture
Gets the height texture, which turns on parallax occlusion mapping.
public string? HeightTexture { get; init; }Property Value
string?
HeightVariance
Gets the most the height varies by on its own, in world units.
public float HeightVariance { get; init; }Property Value
float
NormalTexture
Gets the normal texture: a hemi-octahedral normal in red and green, roughness in blue.
public string? NormalTexture { get; init; }Property Value
string?
OcclusionTexture
Gets the texture with ambient occlusion in red and metalness in green.
public string? OcclusionTexture { get; init; }Property Value
string?
ParallaxLodThreshold
Gets the mip level past which parallax is skipped.
public int ParallaxLodThreshold { get; init; }Property Value
int
ParallaxMaxSamples
Gets the parallax steps taken where the surface is viewed at a grazing angle.
public int ParallaxMaxSamples { get; init; }Property Value
int
ParallaxMinSamples
Gets the parallax steps taken where the surface is viewed head on.
public int ParallaxMinSamples { get; init; }Property Value
int
Roughness
Gets the roughness used without a normal texture.
public float Roughness { get; init; }Property Value
float
SizeVariance
Gets the most the width and height vary by together, in world units.
public float SizeVariance { get; init; }Property Value
float
TextureRect
Gets the part of every texture the decal uses: the minimum corner in xy and the maximum in zw, each from 0 to 1. The whole texture by default, a smaller rectangle for a decal kept in an atlas.
public Vector4 TextureRect { get; init; }Property Value
Width
Gets the width of the decal in world units.
public float Width { get; init; }Property Value
float
Methods
FromMaterial(GameFileLoader, string, string?)
Reads a definition from a projected decal material.
public static ProjectedDecalDefinition? FromMaterial(GameFileLoader fileLoader, string materialPath, string? sequenceName = null)Parameters
fileLoader GameFileLoader
Loads the material, and the color texture when a sequence is named.
materialPath string
The material.
sequenceName string?
A sequence of the color texture's sprite sheet. The decal then uses that part of the texture, at the size and with the fade times the sequence gives.
Returns
The definition, or null when the material or the sequence is missing, or the material is not on a supported decal shader.
WithSheetSequence(GameFileLoader, string)
Narrows the decal to one sequence of the color texture's sprite sheet, taking the part of the texture its first frame covers, and the size and fade times its parameters give.
public ProjectedDecalDefinition? WithSheetSequence(GameFileLoader fileLoader, string sequenceName)Parameters
fileLoader GameFileLoader
Loads the color texture.
sequenceName string
The name of the sequence.
Returns
The narrowed definition, or null when the texture has no such sequence.

