Skip to content

Cpt-Hazama/GMod-PBR-Modules

Repository files navigation

GMod PBR Modules

Required files for my mods to work properly. This is the latest PBR setup for Source engine that allows 1:1 PBR.

Warning

x64 version of GMod is unsupported, you must use the default, pre-release, or dev branches to use this shader.

Source Code

Link

Installation

Place in /GarrysMod/garrysmod/ folder

Also, make sure 'r_PhysPropStaticLighting' is set to '0', otherwise when props "sleep" they will turn black. You can make this default to 0 by adding it to your autoexec.cfg in your /cfg/ folder

If you experience any crashing, then download this version of the module by Yurie: https://yurie.thigh-high.club/r5xhxb5x.zip

Developer Usage

If everything is installed correctly, you can use the PBR shader in your VMTs. This PBR shader allows for MRAO (Metalness, Roughness, Ambient Occ.) styled design.

You can add this to your mod to ensure users will attempt to install the module: https://github.com/Cpt-Hazama/PBR-Module-Check

"PBR"
{
    	"$basetexture"              		"models/cpthazama/mgr/mg_ray/em0200000"
	"$bumpmap"				"models/cpthazama/mgr/mg_ray/em0200000_n"
	"$mraotexture"				"models/cpthazama/mgr/mg_ray/em0200000_mrao"
	"$emissiontexture"			"models/cpthazama/mgr/mg_ray/em0200000_g"
	"$speculartexture"			"models/cpthazama/mgr/mg_ray/em0200000_s"

	"$model"				"1"
	"$surfaceprop"      			"metal"
}

Note that you must have $model 1 enabled for anything that isn't a brush! Otherwise it will not load the texture.

New parameters:

  • $AlphaTestReference (0/1) - 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
  • $MRAOTexture (Texture or "dev/pbr_mraotexture") - Texture with metalness in R, roughness in G, ambient occlusion in B. Will default to the default texture if none is provided
  • $EmissionTexture (Texture) - Emissive texture; is a color texture, not a mask
  • $SpecularTexture (Texture) - Specular F0 RGB map, overrides metalness from the MRAO texture
  • $UseENVAmbient (0/1) - Use the cubemaps to compute ambient light, seems to cause a static lighting effect at certain angles in some areas
  • $Parallax (0/1) - Use Parallax Occlusion Mapping
  • $ParallaxDepth (Float) - Depth of the Parallax Map
  • $ParallaxCenter (Float) - Center depth of the Parallax Map

VTF Stuff:

  • Diffuse/Emission - DXT5
  • MRAO/Specular - DXT1
  • Normal - BGRA8888

Examples

In-Game Screenshots

20220717234226_1 20220707005942_1 20230215212551_1 20230216042225_1 20230126004906_1 20230123224112_1 unknown-24 unknown-29

MRAO Example

RGB image R (Metalness) image

G (Roughness) image

B (Ambient Occlusion) image

Credits

  • Zombie Master Reborn Team - Creating the latest PBR modules for Source
  • Cpt. Hazama - Organizing and providing the files for users to easily obtain/use

About

Required files for my mods to work properly

Resources

Stars

Watchers

Forks

Packages

No packages published