{{htmlmetatags>metatag-media-og:image=(:wiki:pac.png) metatag-keywords=(pac3,replacing,materials,submaterials) metatag-description=(Explanation on how to replace existing Garry's Mod materials/textures in PAC3.) metatag-og:title=(Replacing materials/textures in PAC3.) metatag-og:description=(Explanation on how to replace existing Garry's Mod materials/textures in PAC3.) }} {{tag>tutorial submaterial material}} ====== Replacing materials/textures ====== ===== Using Entity/Model =====
The [[:part:entity]] and [[:part:model]] parts let you change sub materials without any additional parts. Simply create your materials, give them a name and then paste that name into the sub material slot you want to replace. (icon_download) **Download:** {{asset:example:submaterial_entity.txt}}
{{:tutorial:replacing-materials:entity.png?direct}}
===== Using Material Override ===== The **Material** part allows you to replace individual materials on your model by using the material override setting. ==== Usage ==== * Attach a [[:part:Material]] to your model * Click on (...) next to material override * Select the material that you want to replace {{:tutorial:replacing-materials:override.png?direct}} (icon_download) **Download:** {{:tutorial:replacing-materials:material_override.txt}} (icon_warning) This method won't work if you're already using [[#using entity/model| entity/model submaterials]]. ---- ==== Using Submaterials ==== [{{ https://i.imgur.com/k9UbC7R.jpg?236|Texture of Alyx replaced with a custom one.}}] [{{ https://i.imgur.com/yAdWSSe.jpg?236|Default PAC model with replaced material.}}] First create your materials: - Add any of the material parts (:material: **Material**, :material: **Material2D**, :material: **Material3D**) - Tweak the material settings to your liking. - Give the material a name (**''name''** field). Make sure that it is unique. Once that's done, add the **Model** > :submaterial: **Submaterial** part, then: - Go to the **''sub material id''** field. Click on **''...''** and select the material that you want to replace. - Type the **name** of the material that you created into the ''**material**'' field. If you want the :submaterial: **Submaterial** to affect a model different than your entity, simply add it as a child of that model. There is a chance that this will break materials on your entity, to fix that simply add an empty :submaterial: **Submaterial** to your entity and set the **''sub material id''** field to the same value as the one that is affecting the model. In the example below I made two materials: * First one, called **''color''** will change the color. It has **''color2''** variable set to green. * The second one, called **''texture''** will replace the texture on Alyx. It has an edited **.PNG** texture link pasted into **''base texture''** field. Download this example: {{asset:example:submaterial.txt}} ---- ==== Related pages ==== {{topic>tutorial +extracting -test -pt, material}} ----