PBR (Strata shader): Difference between revisions
mNo edit summary |
(→Supported Parameters: Updated list to match actual parameters from shaders.json. Would upload file, however P2CE devs dont want filesharing until mod gets released so not yet) |
||
Line 3: | Line 3: | ||
{{note|Similar unrelated PBR-based shaders are also used in {{tfbranch|4.1}} and {{Source2|4.1}}.}} | {{note|Similar unrelated PBR-based shaders are also used in {{tfbranch|4.1}} and {{Source2|4.1}}.}} | ||
==Supported Parameters== | ==Supported Parameters== | ||
<!-- list and descriptions from P2CE shaders.json --> | |||
===Basics=== | ===Basics=== | ||
{{MatParam|$basetexture|texture| | {{MatParam|$basetexture|texture|Base texture with lighting built in.}} | ||
{{MatParam|$ | {{MatParam|$basetexture2|texture|Blended texture for use with displacements}} | ||
{{MatParam|$flags|int|Flags}} | |||
{{MatParam|$flags_defined|int|Flags_defined}} {{todo|What do flags do?}} | |||
{{MatParam|$flags2|int|Flags}} | |||
{{MatParam|$flags_defined2|int|Flags_defined}} | |||
=== | ===Appearance=== | ||
{{MatParam|$basetexturetransform|matrix|Transforms the texture before use in the material. This does not affect [[lightmaps]] on the surface.}} | {{MatParam|$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}} | |||
{{MatParam|$color2|color|Ditto}} | |||
{{MatParam|$frame|int|Sets which frame to use if $basetexture is animated}} | |||
{{MatParam|$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}} | |||
==Flashlight=== | |||
{{MatParam|$flashlighttexture|texture|Flashlight spotlight shape texture (default is effects/flashlight001)}} | |||
{{MatParam|$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.}} | {{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|$ | {{MatParam|$mraoframe|int|Frame to use if $maraotexture is animated}} | ||
{{MatParam|$ | {{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.}} | ||
{{ | {{MatParam|$mraoframe2|int|Frame to use if $maraotexture2 is animated}} | ||
{{MatParam|$parallax | {{MatParam|$parallax|boolean|Enables parallax mapping on the material.}} | ||
{{MatParam|$ | {{MatParam|$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}} | |||
{{MatParam|$parallaxdepth|float|Defines the depth of the parallax map}} | {{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}} | {{MatParam|$parallaxcenter|float|Defines the center of the parallax map. 0.5 is a good start}} | ||
{{MatParam|$blendtintbymraoalpha|bool|Blend tint by the alpha channel in MRAO texture. Similar to $blendtintbybasealpha for [[VertexLitGeneric|VLG]]}} | |||
==={{p2ce}}Paint=== | |||
{{MatParam|$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}} | |||
{{MatParam|$paintsplatbubble|texture|The normal mapped texture of a single bubble}} | |||
{{MatParam|$paintenvmap|texture|Envmap that is consistent across all painted surfaces}} | |||
===Lighting=== | ===Lighting=== | ||
{{MatParam|$bumpmap|texture|Sets the normal map (new way of setting normalmap)}} | {{MatParam|$bumpmap|texture|Sets the normal map (new way of setting normalmap)}} | ||
{{MatParam|$ | {{MatParam|$bumbframe|int|Frame to use if $bumpmap is animated.}} | ||
{{MatParam|$bumpmap2|texture|Sets the normal map to blend to (new way of setting normalmap)}} | |||
{{MatParam|$bumbframe2|int|Frame to use if $bumpmap2 is animated.}} | |||
{{MatParam|$normaltexture|texture|Normal map texture (deprecated, use $bumpmap)}} | |||
{{MatParam|$emissiontexture|texture|Allows setting an emission texture. Enabled self illumination.}} | {{MatParam|$emissiontexture|texture|Allows setting an emission texture. Enabled self illumination.}} | ||
{{MatParam|$emissionframe|int|Frame to use if $emissiontexture is animated.}} | |||
{{MatParam|$emissiontexture2|texture|Allows setting an emission texture to blend to. Enabled self illumination.}} | |||
{{MatParam|$emissionframe2|int|Frame to use if $emissiontexture2 is animated.}} | |||
{{MatParam|$emissionscale|color|Color to multiply $emissiontexture with}} | |||
{{MatParam|$emissionscale2|color|Color to multiply $emissiontexture2 with}} | |||
{{MatParam|$hsv|color|HSV color to transform $basetexture texture with}} | |||
{{MatParam|$hsv_blend|bool|Blend untransformed color and HSV transformed color}} | |||
===Reflection=== | ===Reflection=== | ||
{{MatParam|$envmap|cubemap|Specular reflections}} | {{MatParam|$envmap|cubemap|Specular reflections}} | ||
{{MatParam|$ | {{MatParam|$envmapparallax|matrix|{{todo|What is this?}} Should be in this format: {{code|<nowiki>[1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1]</nowiki}} | ||
{{MatParam|$envmapframe|int|Frame to use if material specified in $envmap is animated}} | |||
: {{ | {{MatParam|$envmaporigin|vec3|The world space position of the env_cubemap being corrected}} | ||
{{MatParam|$bdrf_integration|texture|Texture to use for {{w|Bidirectional reflectance distribution}}}} | |||
{{MatParam|$ | |||
{{MatParam|$ | |||
===Transparency=== | ===Transparency=== | ||
{{MatParam|$alpha|float|Scales the opacity of an entire material.}} | {{MatParam|$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.}} | {{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.}} | ||
%keywords - A list of keywords separated by commas. Examples of keywords are: architectural,brown,gray,grime,hanger,industrial,metal,modern,shed,urban,wall,floor | %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 10:15, 3 August 2023

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



Supported Parameters
Basics
$basetexture
$basetexture2
$flags
$flags_defined
Appearance
$basetexturetransform
$color
$color2
$frame
$frame2
$srgbtint
Flashlight=
$flashlighttexture
$flashlighttextureframe
PBR
$mraotexture
$mraoframe
$mraotexture2
$mraoframe2
$parallax
$mraoscale
$mraoscale2
$parallaxdepth
$parallaxcenter
$blendtintbymraoalpha
Paint
$paintsplatnormalmap
$paintsplatbubblelayout
$paintsplatbubble
$paintenvmap
Lighting
$bumpmap
$bumbframe
$bumpmap2
$bumbframe2
$normaltexture
$emissiontexture
$emissionframe
$emissiontexture2
$emissionframe2
$emissionscale
$emissionscale2
$hsv
$hsv_blend
Reflection
{{MatParam|$envmapparallax|matrix|$envmapframe
$envmaporigin
$bdrf_integration
Transparency
%keywords - A list of keywords separated by commas. Examples of keywords are: architectural,brown,gray,grime,hanger,industrial,metal,modern,shed,urban,wall,floor