The following is some documentation on the custom shaders and material parameters available in PVKII
(Fallback: PVK2_VertexLitGeneric, any parameters for it are available to this as well)
Improved specularity model using Cook and Torrance model with a Beckman distribution. Is far superior at rendering metals and plastics compared to phong, works well in general as well. This only is supported on ps20b and higher hardware. (Will be adding some additional shading models in this that will be managed by a texture channel lookup. I've freed quite a few texture registers. Minnaert for more realistic cloth diffuse lighting in particular)
- Turns on the cook/torrance specular calculations. Is kinda redundant so will be phased out some point. If you didn't want this than might as well be using the PVK2_VertexLitGeneric
with $phong 0
- Can be used to set a global roughness factor for the whole texture. Will override the RTNL lookup if not set to 0 which is helpful for quickly testing different values for authoring the RTNL
- Texture that contains a Roughness map in the red channel, a Albedo tint mask in the green channel, a Reflectance at normal incidence map in the blue channel, and a lightwarp mask in the alpha channel
- How much to boost or weaken the overall specular term
- Fresnel ranges for the specular term
- Enables/Disables the specular being tinted by the base texture. Uses the green channel of the RTNLTexture as a mask
- Color to tint the specular term
Uses the normal phong specularity calculations, but supports the albedo tinting effects for ps20, ps20b, and higher
- Defines a mask texture which is used for tinting the base texture. Red channel is the only channel used in this texture currently. White means fully tint that pixel, black means apply no tinting and inbetween values will interpolate between fully tinting it and using the default pixel color of the base texture map.
- Enables the cheap translucency approximation diffuse lighting code to be run
- The power applied to the subsurface term. A higher power tightens the subsurface term and a lower power makes it more diffuse and spread out.
- This is similar to a rim lighting effect except for the subsurface lighting term
- Ambient translucency light level of the object regardless of the direction to the light for that pixel.
- A texture map where white means the object is thinner in that area and black means the object is thicker in that area. The easiest way to author is to take your model, flip the normals, and then render an Ambient occlusion bake. I've used XNormal to do this as well as I am not familiar with the process in 3d modelling packages.
Weapon Blood Pass
(For use in either of our shaders. Easily setup to fallback to the detail texture method as the same texture is used with an alpha map added, I need to setup the new proxy to handle this though. Currently the old proxy exists for supporting weapons until they get their blood textures updated. You can use debug_blood_pass_shader 1
to force the effect to be on always for testing)
- Enables the blood pass. Only actually renders the pass if the effect strength is greater than 0.
- Diffuse map for the blood. Alpha channel is the effect mask.
- Normal map for the blood. Alpha is specular mask if needed for both envmap and the cook/torrance specular.
- Cubemap texture to use for envmap specular
- Disabled because currently broken
- How strong or weak to boost the envmap effect
- Roughness scalar for the blood specular
- Reflectance at normal incidence scalar for the blood specular
- Tint color for both the envmap and the cook/torrance specular
- How strong or weak to boost the cook/torrance specular
- Specular fresnel ranges for the cook/torrance specular
- Whether to apply standard valve rim lighting or not
- Essentially the exponent similar to phong of the rim lighting
- How strong or weak to make the rim lighting term
Using the blood pass also requires to update the material's proxy to use the new proxy, It manages the internal $BloodEffectStrength
and the $BloodFrame
variable which controls the frame for the base texture and the the normal map:
Using basetexture tinting requires the addition of some proxies to your texture file as follows (It is best to setup this way as the model will then default to the basetintcolor_base if the mapper does not specify a color to use in the map):
"$basetintcolor_choice" "[0 0 0]"
"$basetintcolor_base" "[0.80 0.05 0.05]"