S&box Wiki
Home
/
Edit Guide to Materials
View
Edit
History
No Category
Developer Overview
The Project System
Publishing To Asset Party
Getting Started With Hammer
Mapping Basics
Mapping Entities
Advanced Mapping Techniques
Getting Started with Modeldoc
Animgraph & Animation
Physics
Modeldoc Nodes
Advanced Modelling
UI Basics
Styles & Stylesheets
Razor Templates
Game Menus
Materials
Built In Shaders
Shaders
Shader Reference
Sounds & Audio
Particles
Getting Started
Making Games
Input
Networking
Physics
Rendering
Editor & Tools
VR
Misc
Playing Guides
Console Commands & Variables
Dedicated Server
Log in to edit
Guide to Materials
<cat>Material.Intro</cat> <title>Guide to Materials</title> # A beginners guide to materials This contains all of the basic information about materials. This guide assumes you've already [created a material](Importing_and_creating_assets#creatingassets) or [imported a material](Importing_and_creating_assets#materials). ## Texture naming conventions The following texture naming conventions are typically used - they're not required, but highly recommended, since they allow the game to recognise your textures automatically when making materials. | Texture type | name | | ---------------- |:----------------:| | base color / diffuse / albedo | name_color | | texture mask¹ | name_mask | | normal map | name_normal | | roughness / glossiness map² | name_rough | | metallic map³ | name_metal | | ambient occlusion map³ | name_ao | | blend mask⁴ | name_blend | | height map⁵ | name_height | | transparency / translucency / opacity map| name_trans | | self illumination / emissive map| name_selfillum | | freedom of motion map | name_freedom | ¹ Used as a Tint Mask for coloring in Hammer mostly.\ ² The glossiness map is the inverse of the roughness map, so the image needs to be inverted before using it.\ ³ Make sure to enable the respective texture in the left PBR menu.\ ⁴ pretty much a texture mask to help make the blend between two textures nicer.\ ⁵ Can be used in the Complex shader when the `Parallax Occlusion` Render option is ticked. <warning>Make sure your base image texture files are to the power of 2, meaning its width and height in pixels are one of these sizes: 128, 256, 512, 1024, 2048, 4096. You have to do this or your textures will not work. It is recommended to never go higher than 4096 for performance reasons, try to keep most textures within the 256 - 2048 range, 2048 pixels for every 128 hammer units tends to look and perform best</warning> ## What shader should you use? You can click the button in the top left corner of the material editor to change shaders. <upload src="aa125/8dad937d2a18667.png" size="89604" name="image.png" /> The following shaders are included by default - for most purposes you'll either want **Complex** or **Simple**. | Shader | Use/Description | | ------------- |:-------------:| | Blendable | This is for when you want to make a material to be used in a map, it can blend between 4 materials aka layers in one go, e.g. for a dirt and road, it will smoothly blend between without custom textures or modelling trickery needed | Complex | This is similar to simple although gives more options for what you can adjust and do, like more texture input types and so on, so if simple does not have the option you need complex most likely will | | Eyeball | Generic eyeball shader for your characters| | Glass | Standard glass shader that will do the job in most cases. | | Projected Decals | here is where you would make your decals, unlike others trans map does not make its translucent on the material, stays white, but it is translucent in-game don't worry | | Simple | This is your go to shader, if its for a simple job like a basic material with only a couple of texture maps, then this shader will do the job for you | | Skin | Shader for skin/flesh materials. | Sky | This is for skyboxes, it accepts parallax style skybox textures in either 4x3 cube or 2x1 equirectangular format (2048x1536 or 2048x1024) | | Static Overlay | Shader for rendering static overlays placed in Hammer. | Water | Fancy Water for s&box | <note> TODO: This list is incomplete </note> ## Adding Textures Lets say for now you only need the simple shader, lets have a look at it. There are three ways to add textures: 1. Drag your texture from any **Asset Browser Instance**: <upload src="a768a/8da610fdf848fe5.gif" size="371851" name="9a1b8d5482.gif" /> 2. Click the **Magnifying Glass** next to the folder path field and open a **Asset Browser** popup window. 3. Click the folder icon next to the magnifying glass and open your File Explorer. <upload src="b3675/8db80377e30facc.png" size="15840" name="01PzmlG.png" /> In some cases, you will need to enable shader features on the left in order to use specific textures - for example, **Ambient Occlusion** or **Metalness** textures. <upload src="b3675/8db80378cabb484.png" size="294125" name="u91rlQo.png" /> ## Saving and compiling <key>CTRL</key> + <key>S</key> will save your material to disk. If things aren't looking right, click **File**, **Force Compile to Disk** in order to force the material to re-compile.
S&box Wiki
Development
Developer Overview
6
Editor Overview
General FAQ
System Requirements
The s&box wiki
Troubleshooting
Useful Links
The Project System
4
Adding Assets
Creating a Game Project
Project Settings Window - Games
Project Types
Publishing To Asset Party
2
Uploading assets
Uploading projects
Hammer
Getting Started With Hammer
3
Getting Started With Hammer
Making Your First Map
Mapping Resources
Mapping Basics
7
Cordons
Hotspot Materials
Selection Sets
Standard Mapping Dimensions
Tool Materials
Tools Visualisation Modes
Using Entities That Require a Mesh
Mapping Entities
2
Creating a Door
Light Entities
Advanced Mapping Techniques
8
Collaborating With Prefabs and Git
Instances
Prefabs
Quixel Bridge Plugin
Tilesets
Tilesets-Advanced
Tilesets-Proxies
VIS Optimizations
Models & Animation
Getting Started with Modeldoc
7
Automatic Model Setup
Breakpieces
Creating a Model
Guide to Models
Importing Rust Weapons
LODs
ModelDoc FAQ & best practices
Animgraph & Animation
4
Animations without Animgraph
AnimEvents, AnimGraph Tags, Attachments
Animgraph
Delta Animations
Physics
3
Cloth Physics
Collisions, Physics & Surface Types
Jiggle Bones
Modeldoc Nodes
1
Custom ModelDoc nodes
Advanced Modelling
6
Bodygroups
Citizen
First Person
IKChains and Stride Retargeting
Morphs
Vertex Normals
User Interface
UI Basics
6
Custom Fonts
Embedding Websites
Enabling Pointer Events
Events and Input
UI Basics
UI with Components
Styles & Stylesheets
1
Video Backgrounds
Razor Templates
4
A Razor Overview
Aliases and SetProperty Attributes
Generic Components
Templates
Game Menus
1
Making a Custom Pause Screen
Materials & Shaders
Materials
5
Guide to Materials
Material Attributes
Material Resources
Texture Settings
Using Dynamic Expressions
Built In Shaders
2
Foliage Shader
Glass Shader
Shaders
4
Compute Shaders
Constant Buffers
Material API
Shading Model
Shader Reference
5
Anatomy of Shader Files
Getting rid of Tex2D macros
Shader Reference
Shader States
Texture Format Cheat-Sheet
Other Assets
Sounds & Audio
4
Guide to Sounds
Sound Events
Sound Occlusion
Soundscapes
Particles
5
Creating animated sprites
Creating your first particle effect
Understanding Particle Editor
Using custom sprites
Using particle systems from C#
Coding
Getting Started
5
Cheat Sheet
Learning Resources
Setting up Rider
Setting up Visual Studio
Setting up Visual Studio Code
Making Games
2
Components
GameObjects
Input
4
Commands
ConVars
Input System
Speech Recognition
Networking
7
Auth Tokens
Http Requests
Lobby System
Networked Types
Networking Basics
RPCs
WebSockets
Physics
5
Collisions
Hitboxes
Joints
Traces
Triggers
Rendering
3
Render Tags
RenderHooks
Scenes
Editor & Tools
5
Guide to Widgets
Hammer API
Hammer Gizmos
Hotload Performance
Widget Docking
VR
3
Getting Started
VR Input
VR Overlays
Misc
10
Asset Types
Attributes and Component Properties
Backend API
Code Accesslist
CPU Performance Profiling
DisplayInfo
package/find
Setting Up A Navigation Mesh
Threaded Tasks
TypeLibrary
Playing
Playing Guides
3
Default Keybinds
Proton
s&box on macOS (Experimental)
Console Commands & Variables
1
Launch Arguments
Dedicated Server
1
Dedicated Servers