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

PBR (Strata shader): Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
mNo edit summary
No edit summary
 
Line 9: Line 9:
<!-- list and descriptions from P2CE shaders.json -->
<!-- list and descriptions from P2CE shaders.json -->
===Basics===
===Basics===
{{MatParam|$basetexture|texture|Base texture with lighting built in.}}
{{MatParamDef|$basetexture|texture|Base texture with lighting built in.}}
{{MatParam|$basetexture2|texture|Blended texture for use with displacements}}
{{MatParamDef|$basetexture2|texture|Blended texture for use with displacements}}


===Appearance===
===Appearance===
{{MatParam|$basetexturetransform|matrix|Transforms the texture before use in the material. This does not affect [[lightmaps]] on the surface.}}
{{MatParamDef|$basetexturetransform|matrix|Transforms the texture before use in the material. This does not affect [[lightmaps]] on the surface.}}
{{MatParam|$color|color|Adjusts the color of the texture}}
{{MatParamDef|$color|color|Adjusts the color of the texture}}
{{MatParam|$color2|color|Ditto}}
{{MatParamDef|$color2|color|Ditto}}
{{MatParam|$frame|int|Sets which frame to use if $basetexture is animated}}
{{MatParamDef|$frame|int|Sets which frame to use if $basetexture is animated}}
{{MatParam|$frame2|int|Sets which frame to use if $basetexture2 is animated}}
{{MatParamDef|$frame2|int|Sets which frame to use if $basetexture2 is animated}}
{{MatParam|$srgbtint|color|Tint value to be applied when running on new-style srgb parts}}
{{MatParamDef|$srgbtint|color|Tint value to be applied when running on new-style srgb parts}}


===Flashlight===
===Flashlight===
{{MatParam|$flashlighttexture|texture|Flashlight spotlight shape texture (default is effects/flashlight001)}}
{{MatParamDef|$flashlighttexture|texture|Flashlight spotlight shape texture (default is effects/flashlight001)}}
{{MatParam|$flashlighttextureframe|int|Animation frame to use if $flashlighttexture is animated}}
{{MatParamDef|$flashlighttextureframe|int|Animation frame to use if $flashlighttexture is animated}}


===PBR===
===PBR===
{{MatParam|$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.}}
{{MatParamDef|$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.}}
{{MatParam|$mraoframe|int|Frame to use if $maraotexture is animated}}
{{MatParamDef|$mraoframe|int|Frame to use if $maraotexture is animated}}
{{MatParam|$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.}}
{{MatParamDef|$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.}}
{{MatParam|$mraoframe2|int|Frame to use if $maraotexture2 is animated}}
{{MatParamDef|$mraoframe2|int|Frame to use if $maraotexture2 is animated}}
{{MatParam|$parallax|boolean|Enables parallax mapping on the material. Needs a heightmap embedded into the alpha channel of the Bumpmap to work}}
{{MatParamDef|$parallax|boolean|Enables parallax mapping on the material. Needs a heightmap embedded into the alpha channel of the Bumpmap to work}}
{{MatParam|$mraoscale|color|Specifies the strength of Metalness(R), Roughness(G), and Ambient Occlusion(B) for $mraotexture}}
{{MatParamDef|$mraoscale|color|Specifies the strength of Metalness(R), Roughness(G), and Ambient Occlusion(B) for $mraotexture}}
{{MatParam|$mraoscale2|color|Specifies the strength of Metalness(R), Roughness(G), and Ambient Occlusion(B) for $mraotexture2}}
{{MatParamDef|$mraoscale2|color|Specifies the strength of Metalness(R), Roughness(G), and Ambient Occlusion(B) for $mraotexture2}}
{{MatParam|$parallaxdepth|float|Defines the depth of the parallax map. Essentially the intensity of the heightmap. 0.10 is a good start.}}
{{MatParamDef|$parallaxdepth|float|Defines the depth of the parallax map. Essentially the intensity of the heightmap. 0.10 is a good start.}}
{{MatParam|$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.}}
{{MatParamDef|$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.}}
{{MatParam|$blendtintbymraoalpha|bool|Blend tint by the alpha channel in MRAO texture. Similar to $blendtintbybasealpha for [[VertexLitGeneric|VLG]]}}
{{MatParamDef|$blendtintbymraoalpha|bool|Blend tint by the alpha channel in MRAO texture. Similar to $blendtintbybasealpha for [[VertexLitGeneric|VLG]]}}
{{MatParam|$model|bool|Enables its use on models. ''Must'' be set to work on models.}}
{{MatParamDef|$model|bool|Enables its use on models. ''Must'' be set to work on models.}}
==={{p2ce}}Paint===
==={{p2ce}}Paint===
{{MatParam|$paintsplatnormalmap|texture|The paint splat normal map to use when paint is enabled on the surface}}
{{MatParamDef|$paintsplatnormalmap|texture|The paint splat normal map to use when paint is enabled on the surface}}
{{MatParam|$paintsplatbubblelayout|texture|The layout texture which defines the distribution of bubbles in the paint}}
{{MatParamDef|$paintsplatbubblelayout|texture|The layout texture which defines the distribution of bubbles in the paint}}
{{MatParam|$paintsplatbubble|texture|The normal mapped texture of a single bubble}}
{{MatParamDef|$paintsplatbubble|texture|The normal mapped texture of a single bubble}}
{{MatParam|$paintenvmap|texture|Envmap that is consistent across all painted surfaces}}
{{MatParamDef|$paintenvmap|texture|Envmap that is consistent across all painted surfaces}}


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


===Reflection===
===Reflection===
{{MatParam|$envmap|cubemap|Specular reflections}}
{{MatParamDef|$envmap|cubemap|Specular reflections}}
{{MatParam|$envmapframe|int|Frame to use if material specified in $envmap is animated}}
{{MatParamDef|$envmapframe|int|Frame to use if material specified in $envmap is animated}}


===Transparency===
===Transparency===
{{MatParam|$alpha|float|Scales the opacity of an entire material.}}
{{MatParamDef|$alpha|float|Scales the opacity of an entire material.}}
{{MatParam|$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.}}
{{MatParamDef|$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==
==See also==

Latest revision as of 11:50, 23 August 2025

English (en)Русский (ru)Translate (Translate)

Stub

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 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

Base texture with lighting built in.
Blended texture for use with displacements

Appearance

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

Flashlight

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

PBR

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.
Frame to use if $maraotexture is animated
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.
Frame to use if $maraotexture2 is animated
Enables parallax mapping on the material. Needs a heightmap embedded into the alpha channel of the Bumpmap to work
Specifies the strength of Metalness(R), Roughness(G), and Ambient Occlusion(B) for $mraotexture
Specifies the strength of Metalness(R), Roughness(G), and Ambient Occlusion(B) for $mraotexture2
Defines the depth of the parallax map. Essentially the intensity of the heightmap. 0.10 is a good start.
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.
Blend tint by the alpha channel in MRAO texture. Similar to $blendtintbybasealpha for VLG
Enables its use on models. Must be set to work on models.

Portal 2: Community EditionPaint

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

Lighting

Sets the normal map (new way of setting normalmap)
Frame to use if $bumpmap is animated.
Sets the normal map to blend to (new way of setting normalmap)
Frame to use if $bumpmap2 is animated.
Normal map texture (deprecated, use $bumpmap)
Allows setting an emission texture. Enabled self illumination.
Frame to use if $emissiontexture is animated.
Allows setting an emission texture to blend to. Enabled self illumination.
Frame to use if $emissiontexture2 is animated.
Color to multiply $emissiontexture with
Color to multiply $emissiontexture2 with
HSV color to transform $basetexture texture with
Blend untransformed color and HSV transformed color

Reflection

Specular reflections
Frame to use if material specified in $envmap is animated

Transparency

Scales the opacity of an entire material.
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