SurfaceGGX

From New World Interactive Wiki
Jump to: navigation, search


SurfaceGGX is our own custom model shader that was developed for Day of Infamy. It is also available in Insurgency but this version may be outdated and isn't actively supported.

It supports physically based input maps and works in a similar fashion to modern physically based shaders.

Texture channel layout

Metalness

For this shading model of SurfaceGGX you have to configure the $phongexponenttexture texture as follows.

You will also have to enable $metal to make the shader use the Green channel.

Channel/Info Data
Red Gloss (Roughness Inverted)
Green Metalness Inverted
Blue Sub surface scattering mask (Note: asperity/fuzz scattering and detail normals use the inverse of this mask)
Format DXT1

Specular/Gloss

For this shading model of SurfaceGGX you have to configure the $masks texture as follows.

You will also have to enable $pbr to make the shader use the $masks texture and enable the Specular/Gloss shading model.

Channel/Info Data
RGB Specular
Alpha Gloss
Format DXT5

Available material parameters

Name Type Default value Description
$basetexture Texture
$basetexturetransform Matrix
$bumpmap Texture
$metal Switch
$phongexponenttexture Texture
$roughnessmultiplier Scalar
$pbr Switch
$masks Texture
$fuzz Switch
$fuzzmultiplier Scalar
$subsurfacescattering Switch
$diffusionweights Vector (RGB)
$diffusionweights2 Vector (RGB)
$detail Texture
$detailframe Integer
$detailscale Scalar
$detailnormal Texture
$detailnormalblendfactor Scalar
$detailblendfactor Scalar
$detailtexturetransform Matrix
$detailroughnessinvertmix Scalar
$detailroughnessmultiplier Scalar
$detailroughnessblendfactor Scalar
$alphatest Switch
$alphatestreference Scalar
$treesway Switch
$treeswayheight Scalar
$treeswaystartheight Scalar
$treeswayradius Scalar
$treeswaystartradius Scalar
$treeswayspeed Scalar
$treeswayspeedhighwindmultiplier Scalar
$treeswaystrength Scalar
$treeswayscrumblespeed Scalar
$treeswayscrumblestrength Scalar
$treeswayscrumblefrequency Scalar
$treeswayfalloffexp Scalar
$treeswayscrumblefalloffexp Scalar
$treeswayspeedlerpstart Scalar
$treeswayspeedlerpend Scalar

Examples

American character skin

"SurfaceGGX"
{
	"$basetexture" 			"models\player\american\american_flesh_01"	
	"$bumpmap" 			"models\player\american\american_flesh_01_normal"
	"$phongexponenttexture"		"models\player\american\american_flesh_01_exp"
		
	"$detail"			"vgui/white"
	"$detailblendfactor"		"0"
	"$detailscale"			"2"
	
	"$detailnormal" 		"models/player/skin_detail_nm"
	"$detailnormalblendfactor"	"0.5"
	
	"$subsurfacescattering"		"1"
	
	"$roughnessmultiplier"		"1.1"
	
	"$fuzz"				"1"
	"$fuzzmultiplier"		"0.2"
	
	"Proxies"
	{
		"CauseOfDeath"
		{
			"resultVar"	"$detail"
		}
	}
}

American character clothes

"SurfaceGGX"
{
	"$basetexture"			"models\player\american\american_clothes"
	"$bumpmap" 			"models\player\american\american_clothes_normal"
	"$phongexponenttexture"		"models\player\american\american_clothes_exp"
		
	"$detail"			"vgui/white"
	"$detailblendfactor"		"0"
	"$detailscale"			"2"
	
	"$metal"			"1"
	"$roughnessmultiplier"		"1.15"
	
	"$fuzz"				"1"
	"$fuzzmultiplier"		"0.15"
	
	"Proxies"
	{
		"CauseOfDeath"
		{
			"resultVar"	"$detail"
		}
		
		"PlayerMaterialProxy"
		{
		}
	}
}