Source Filmmaker

Source Filmmaker

375 ratings
PBR Shader
18
11
7
5
5
4
2
   
Award
Favorite
Favorited
Unfavorite
Script
Tags: SFM
File Size
Posted
Updated
1.402 MB
Feb 22 @ 8:14am
Feb 23 @ 8:18am
4 Change Notes ( view )

Subscribe to download
PBR Shader

Description
This plugin adds a true PBR shader to SFM. No more hacky, manual setups with multiple layers of materials are needed!

Based on the PBR shader made by the Zombie Master: Reborn[github.com] team.

What is PBR?
PBR is a rendering method that simulates the physical behavior of light in the real world. Different materials like metal, wood, etc react consistently to the environment under a PBR setup. This is the most standard setup for materials in modern game engines.

This PBR shader supports albedo, MRAO (metalness, roughness, ambient occlusion), emission, specular and parallax mapping textures.

Installation
Make sure you have installed Plugin Loader and ran its patch script once.
(Scripts > ficool2 > Plugin Loader)

You also need to make sure you are subscribed to Shader Loader.
This plugin should automatically work when you download it in SFM, and then restart.

You can use the example model to see if you installed PBR correctly: https://exit.yueirsjskjl.cf/sharedfiles/filedetails/?id=3671444926

Authoring
The shader name is PBR. The shader supports both models and brushes, and has the following parameters:

$basetexture - Albedo map
$bumpmap - Normal map
$mraotexture - Texture with metalness in R, roughness in G, ambient occlusion in B. Will default to the default texture dev/pbr_mraotexture if none is provided
$emissiontexture - Emissive texture; is a color texture, not a mask
$speculartexture - Specular F0 RGB map, overrides metalness from the MRAO texture

$model (0/1) - Whether the material is on a model or not. You must set this to 1 on models!

$metalnessFactor - Metalness factor. Default is 1
$roughnessFactor - Roughness factor. Default is 1
$aofactor - Ambient occlusion factor. Default is 1
$ssaofactor - SFM's SSAO factor. Default is 1

$Parallax (0/1) - Use Parallax Occlusion Mapping
$ParallaxDepth - Depth of the Parallax Map
$ParallaxCenter - Center depth of the Parallax Map

$color - Albedo tint ($color2 is not used here)

$alphatest (0/1) - Enables binary transparency
$alphatestreference - Specifies the minimum color value of the alpha channel in which the transparency is rounded to opaque. A value of ".3" will create a thicker shape while a value of ".7" will create a thinner shape

Example PBR sphere model that demonstrates the setup: https://exit.yueirsjskjl.cf/sharedfiles/filedetails/?id=3671444926

Important
If you are uploading an model on the workshop that uses this shader, please add this addon as a dependency, as the PBR shader will not work without this plugin installed.
You can do this by going into Add/Remove Required Items on the page and adding this plugin in the list.

Known Issues
PBR models do not render in HLMV (yet).

Includes
addons\shader_zmrpbr_v3.dll
addons\shader_zmrpbr.vdf
materials\dev\pbr_mraotexture.vtf
shaders\fxc\pbr_vs30.vcs
shaders\fxc\pbr_ps30.vcs

Code
This plugin is open sourced at https://github.com/ficool2/sfm_pbr
Popular Discussions View All (2)
2
May 24 @ 2:49am
"you need to restart" Message or something
Vic
0
Mar 20 @ 12:21pm
Artwork
RJL
145 Comments
May 31 @ 5:41am 
just a waste of time trying to download it
May 29 @ 6:09am 
Seems to be broken.

Installed prerequisites per instructions without issue. Example sphere loads as a wireframe instead of a textured model, console reads "Error: Material uses unknown shader 'PBR'", which means there's something obviously not working.
May 21 @ 3:33pm 
why is it not working? I followed the video instructions and that didnt work, so I tried the third section of deleting engine dll and that didn't work either. how do I get it to work?
May 16 @ 8:18am 
There's an updated version in the SFM Discord where it features the SSS that most people asked
May 16 @ 3:16am 
yea came back to this page and there's already a bit of a war in the comments

anyway since this is abandoned (which everyone knew) for anyone waiting for SSS to be added that won't happen
May 8 @ 5:15pm 
@Vantablack

With respect I'm not totally sure how someone would write a guide for you specifically.

You asked whether a yes or no question (is it a model) should be answered with a Floating Point number (4294967296 or more possible answers), an Integer (65536 or more possible answers) or a Boolean (2 possible answers of Yes or No).

This is in addition to $model being a Valve made parameter. It is not unique to the PBR shader so you aren't even complaining to the right people.

Genuinely how is anyone supposed to respond to this without insulting your intelligence?
May 8 @ 10:35am 
just because it works fine on your end, it doesn't mean that it works for everyone, and there is a very clear reason for this. take @Mecha_Animations for example, as well as the countless other people who voiced their issues in the comment section. do they suck at reading as well, @Executable? or is that just your ego speaking? how come there are so many people facing issues with this, but a small group of others who got it working act like the rest of us are stupid?

this guide is very incomplete and brief. simple as. how else do you explain that the script straight up does not work for so many people? it's perfectly normal and valid to be asking questions. Some of the comments here come across as people acting superior for getting a difficult script to work, and I am sure that this is not the case, but would it hurt to just be a bit more patient?
May 8 @ 10:29am 
@Sybilregal The description *does not* mention what type of parameter that is. 0/1 does not tell me much, and my only other option is to search through the entire Valve Wiki for what 0/1 could mean. I never touched bool, so there was no way for me to know how it relates to 0/1. I get that this is applied to VMTs. but the instructions are not specific enough, and you'd understand why if you'd read about my complaints further into the texts I sent
May 8 @ 10:25am 
@BlueFlytrap right. *what* type of parameter is it? float? int? bool? this is never explained
May 7 @ 9:21am 
i know this is completely abandoned and straight up everyone made the guy who did it leave the internet or sfm, but i have tried everything with to no avail, every time i try to run the script,console keeps finding the error on the python script and won't let me run it, saying "must be a unicode, not str". Even after i un-installed and re-installed it, after going through the Python file, and just restarting SFM alot of times; its not working. I am officially lost on what i can do to fix this, and going through any tutorials and though how other people fixing it: i cannot find the right answer for this issue.