PBR (Strata shader): Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(Created page with "{{Language subpage}}{{Shader|PBR|engine={{strata|4.1}}, {{tfbranch|4.1}}, and {{Source2|4.1}}}} It uses many different texture maps to create a more accurate simulation of lig...")
 
mNo edit summary
Line 1: Line 1:
{{Language subpage}}{{Shader|PBR|engine={{strata|4.1}}, {{tfbranch|4.1}}, and {{Source2|4.1}}}} It uses many different texture maps to create a more accurate simulation of light.
{{Language subpage}}{{Shader|PBR|engine={{strata|4.1}}, {{tfbranch|4.1}}, and {{Source2|4.1}}}} It uses many different texture maps to create a more accurate simulation of light.
{{Todo|Finish adding shader parameters}}
==Supported Parameters==
===Basics===
{{MatParam|$basetexture|texture|Defines an albedo texture.}}
{{MatParam|$surfaceprop|string|Links the surface to a set of physical properties (footstep sounds, bullet penetration {{confirm}}, etc)}}


{{Todo|Add the shader parameters}}
==Adjustment==
{{MatParam|$basetexturetransform|matrix|Transforms the texture before use in the material. This does not affect [[lightmaps]] on the surface.}}


===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.}}
{{MatParam|$model|boolean|Specifies whether or not this texture is used on a model.}}
{{MatParam|$speculartexture|texture|Enables use of colored F0 (specular map), overrides metalness from MRAO texture.}}
{{confirm|Which games use $useparallax and which ones use $parallax? Are they the same?}}
{{MatParam|$parallax|only={{Strata}}|boolean|Enables parallax mapping on the material.}}
{{MatParam|$useparallax|float|Ditto{{confirm}}}}
{{MatParam|$parallaxdepth|float|Defines the depth of the parallax map}}
{{MatParam|$parallaxcenter|float|Defines the center of the parallax map. 0.5 is a good start}}
===Lighting===
{{MatParam|$bumpmap|texture|Sets the normal map (new way of setting normalmap)}}
{{MatParam|$normaltexture|texture|Sets the normal map (for backwards compatibility)}}
{{MatParam|$emissiontexture|texture|Allows setting an emission texture. Enabled self illumination.}}
===Reflection===
{{MatParam|$envmap|cubemap|Specular reflections}}
{{MatParam|$envmapcontrast|normal|Controls the [[Wikipedia:Contrast (vision)|contrast]] of the reflection. 0 is natural contrast, while 1 is the full squaring of the color (i.e. color*color).
: {{note|Will not work when Phong is enabled.}}
: {{tip|Use higher contrasts to diminish relatively darker areas and increase "hot spots".}}}}
{{MatParam|$envmapsaturation|RGB matrix|Controls the color saturation of the reflection. 0 is greyscale, while 1 is natural saturation. R, G and B can be de/oversaturated respectively using <code>"[r g b]"</code>
: {{note|In the Shadercode for {{src13|2}} and {{as|2}} the parameter is defined as a float parameter. However it will be used as a vec3 and the Shader expects and uses it as such.}}
: {{note|Will not work when [[Phong]] is enabled on models.}}
: {{bug|{{css}} Works only on models.}}}}
{{MatParam|$envmaptint|RGB matrix|Controls the intensity of the reflection's [[RGB|red, green and blue]] color channels. Any positive number can be used. Default is <code>"[1 1 1]"</code>, which means 100% intensity. {{note|You ''must'' use quotemarks, as there are space characters within the value.}} {{tip|This command is often used to dim the brightness of a specular reflection without the overhead of an <code>$envmapmask</code>.}}}}
{{MatParam|$useenvambient|boolean|Makes the reflections use the lowest mip level of the cubemap for ambient light instead of the ambient cubes. Can cause artifacts with moving props.}}
==Transparency==
{{MatParam|$alpha|float|Scales the opacity of an entire material.}}
{{MatParam|$alphatest|bool|Specifies a mask to use to determine binary opacity.}}
{{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.}}
{{MatParam|$translucent|bool|Specifies that the material should be partially see-through.}}
%keywords - A list of keywords separated by commas. Examples of keywords are: architectural,brown,gray,grime,hanger,industrial,metal,modern,shed,urban,wall,floor
==See Also==
==See Also==
*[[Physically Based Rendering]]
*[[Physically Based Rendering]]
*[[Adding PBR to your mod]]
*[[Adding PBR to your mod]]
*[[Adapting PBR Textures to Source]]
*[[Adapting PBR Textures to Source]]

Revision as of 17:22, 4 July 2023

English (en)Русский (ru)Translate (Translate)
Shader-ball.png

PBR It uses many different texture maps to create a more accurate simulation of light.

Todo: Finish adding shader parameters

Supported Parameters

Basics

$basetexture $surfaceprop

Adjustment

$basetexturetransform

PBR

$mraotexture $model $speculartexture

Confirm:Which games use $useparallax and which ones use $parallax? Are they the same?

$parallax $useparallax $parallaxdepth $parallaxcenter

Lighting

$bumpmap $normaltexture $emissiontexture


Reflection

$envmap $envmapcontrast $envmapsaturation $envmaptint $useenvambient

Transparency

$alpha $alphatest $alphatestreference $translucent

%keywords - A list of keywords separated by commas. Examples of keywords are: architectural,brown,gray,grime,hanger,industrial,metal,modern,shed,urban,wall,floor

See Also