...
| Specular | Roughness | Picture | Notes |
|---|---|---|---|
| 0.3 | 0.05 | Generally a bit "wet" but not quite good enough | |
| 1.0 | 0.00001 | A metallic mess (note setting Roughness to 0.0 seems to recalculate it as if it wasn't set) |
Using One Shader in Multiple Materials But With Variance
By adding the following line to your shader file ...
| Code Block |
|---|
float fMyNewParameter; |
...and by adding the following line to your material file ...
| Code Block |
|---|
parameter float fMyNewParameter 5.0 |
You can pass the named parameter to the shader. If you then write into your shader for something to happen based on that parameter, you can use the same shader with multiple material files, and have the material file modify how the shader functions.
As an example, let's say you have a texture slide shader, but you want to modify the slide speed. You can supply parameter float fSlideSpeedMod 5.0 in your material and then apply the value in uniform fSlideSpeedMod to the slide speed calculation.
This method does not require nwscript, so would work on materials applied to things you cannot target with nwscript, like tile meshes.
Warning: if you supply a parameter name matching an already used uniform name, you will likely crash the shader to hot pink.