Shaders:IvandPBRShader
Ivand's PBR shader's install instructions
What you will need:
- Latest maintenance engine. Grab it here: https://springrts.com/dl/buildbot/default/maintenance/
- Custom unit shader gadget. Every mod has a bit different code, check if your game has it, if not copy from somewhere else. ZK variant: https://github.com/lhog/Zero-K/blob/pbrCUS_v1/LuaRules/Gadgets/api_custom_unit_shaders.lua
- PBR shader: https://github.com/lhog/Zero-K/blob/pbrCUS_v1/ModelMaterials/Shaders/pbr.lua
- PBR meta-material definitions: https://github.com/lhog/Zero-K/blob/pbrCUS_v1/ModelMaterials/10_pbr.lua
- model definition with PBR extension: https://github.com/lhog/Zero-K/blob/pbrCUS_v1/Objects3d/unit.dae.lua (replace "unit" by your actual unit model's name)
- unitDef file (ZK style, you might prefer your own): https://github.com/lhog/Zero-K/blob/pbrCUS_v1/units/unit.lua
- model and textures (not on github, provide your own). Make sure texture filenames and channel mappings are specified correctly in unit.dae.lua
If this all sounds too complicated from the first sight, you can just clone this demo branch: "git clone -b pbrCUS_v1 https://github.com/lhog/Zero-K.git". It's all in there except for textures and .dae file
Texture Preparation
For efficient file size usage, your different maps must be disposed in separate channels of up to three images. All images and channels are optional and will reset to a default value or appearance if missing. Follows a proposal for this channel layout, yet bear in mind this can be rearranged in the model.ext.lua config file. Upspring has a built-in menu option to assemble images from separate channels in any desired configuration.
- Texture1: Diffuse/Color (r, g, b) + Teamcolor (a)
- Texture2: Occlusion (r) + Roughness (g) + Metallic (b) + Emissive (a)
- Texture3: Normal (r, g, b) + Clipping (a)
PS.: Clipping is currently unsupported in this shader.