Using fake PBR assets in Pragma

From Pragma
Revision as of 17:24, 18 February 2020 by Silverlan (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Some Source Engine assets use something called "fake PBR" to try and create a PBR-like effect in SFM. This, however, does not work in Pragma or the Cycles renderer and will cause various artifacts.
To still use these assets properly, you will need the original PBR textures of the model (i.e. the metalness, roughness and/or glossiness maps). If you don't have those, you can ask whoever ported the model, they should have them.
Once you have the PBR textures available, you can add them to the VMT materials of the model using the following VMT parameters:

"$metalnesstexture" "path/to/texture"
"$roughnesstexture" "path/to/texture"
"$glossinesstexture" "path/to/texture"
"$emissiontexture" "path/to/texture"

The Source Engine will ignore them, but Pragma will know what to do with them. In addition, fake PBR uses multiple overlaid meshes, which will cause z-fighting in Pragma/Cycles. To fix that, simply open the VMT material files for the duplicate meshes and add the following parameter to them:

"$fakepbr_layer" "1"

This will effectively make them invisible in Pragma.
If you've set all of this up properly, the model should show up in Pragma with full PBR. If you've already loaded the model in Pragma before making these changes, you'll have to clear your cached files first by running the "clear_cache" console command.