This article's documentation is for anything that uses the Strata engine. Click here for more information.

PBR (Strata shader)

From Valve Developer Community
Jump to navigation Jump to search
English (en)Русский (ru)Translate (Translate)
This article or section is a stub. You can help by expanding it.

PBR is a Pixel shader available in Strata Source Strata Source. It uses many different texture maps to create a more accurate simulation of light. Strata Source Strata Source uses a modified version of Thexa4's PBR shader, which is capable of rendering lightmaps on brushes. It can be used on both brushes and models.

Note.pngNote: Similar unrelated PBR-based shaders are also used in Titanfall branch Titanfall branch and Source 2 Source 2.
Note.pngNote: Alien Swarm: Reactive Drop Alien Swarm: Reactive Drop, with Strata Source Strata Source's permission, have ported the shader. ( Commit link )
Note.pngNote: This article may become out of date quite frequently due to Strata's active development. If something is not present here, check the Strata wiki's page.

Supported Parameters

Basics

$basetexture <texture>
Base texture with lighting built in.
$basetexture2 <texture>
Blended texture for use with displacements

Appearance

$basetexturetransform <matrix>
Transforms the texture before use in the material. This does not affect lightmaps on the surface.
$color <color>
Adjusts the color of the texture
$color2 <color>
Ditto
$frame <integer>
Sets which frame to use if $basetexture is animated
$frame2 <integer>
Sets which frame to use if $basetexture2 is animated
$srgbtint <color>
Tint value to be applied when running on new-style srgb parts

Flashlight

$flashlighttexture <texture>
Flashlight spotlight shape texture (default is effects/flashlight001)
$flashlighttextureframe <integer>
Animation frame to use if $flashlighttexture is animated

PBR

$mraotexture <texture>
Defines an MRAO map to use. Needed for the texture to actually use PBR features. Metalness is on the red channel, roughness is on the green, and ambient occlusion is on the blue channel.
$mraoframe <integer>
Frame to use if $maraotexture is animated
$mraotexture2 <texture>
Defines an MRAO map to use for the blended texture. Needed for the texture to actually use PBR features. Metalness is on the red channel, roughness is on the green, and ambient occlusion is on the blue channel.
$mraoframe2 <integer>
Frame to use if $maraotexture2 is animated
$parallax <boolean>
Enables parallax mapping on the material. Needs a heightmap embedded into the alpha channel of the Bumpmap to work
$mraoscale <color>
Specifies the strength of Metalness(R), Roughness(G), and Ambient Occlusion(B) for $mraotexture
$mraoscale2 <color>
Specifies the strength of Metalness(R), Roughness(G), and Ambient Occlusion(B) for $mraotexture2
$parallaxdepth <float>
Defines the depth of the parallax map. Essentially the intensity of the heightmap. 0.10 is a good start.
$parallaxcenter <float>
Defines the center of the parallax map. Essentially how deep the highest point is. This is often used to make the parallax mapping flush with a wall or floor, as if it is not flush it can visually extend past the floor, which can be very distracting. 0.5 is a good starting point.
$blendtintbymraoalpha <boolean>
Blend tint by the alpha channel in MRAO texture. Similar to $blendtintbybasealpha for VLG
$model <boolean>
Enables its use on models. Must be set to work on models.

Portal 2: Community EditionPaint

$paintsplatnormalmap <texture>
The paint splat normal map to use when paint is enabled on the surface
$paintsplatbubblelayout <texture>
The layout texture which defines the distribution of bubbles in the paint
$paintsplatbubble <texture>
The normal mapped texture of a single bubble
$paintenvmap <texture>
Envmap that is consistent across all painted surfaces

Lighting

$bumpmap <texture>
Sets the normal map (new way of setting normalmap)
$bumbframe <integer>
Frame to use if $bumpmap is animated.
$bumpmap2 <texture>
Sets the normal map to blend to (new way of setting normalmap)
$bumpframe2 <integer>
Frame to use if $bumpmap2 is animated.
$normaltexture <texture>
Normal map texture (deprecated, use $bumpmap)
$emissiontexture <texture>
Allows setting an emission texture. Enabled self illumination.
$emissionframe <integer>
Frame to use if $emissiontexture is animated.
$emissiontexture2 <texture>
Allows setting an emission texture to blend to. Enabled self illumination.
$emissionframe2 <integer>
Frame to use if $emissiontexture2 is animated.
$emissionscale <color>
Color to multiply $emissiontexture with
$emissionscale2 <color>
Color to multiply $emissiontexture2 with
$hsv <color>
HSV color to transform $basetexture texture with
$hsv_blend <boolean>
Blend untransformed color and HSV transformed color

Reflection

$envmap <cubemap>
Specular reflections
$envmapframe <integer>
Frame to use if material specified in $envmap is animated

Transparency

$alpha <float>
Scales the opacity of an entire material.
$alphatestreference <float>
Specifies the minimum color value of the alpha channel in which the effect is rounded to 255. A value of ".3" will create a thicker shape while a value of ".7" will create a thinner shape.

See also