About this mod
In-depth tutorial and playable resource for creating a mesh with MultiLayer Parallax.
- Permissions and credits
I have also included a playable resource, some example meshes (vanilla gemstones) that you could take a look at for reference or to use as a base. Please install as normal with a mod manager.
So...
What is MultiLayer Parallax?
(Not to be confused with parallax mapping.)
MultiLayer Parallax (MLP) is a shader type that takes two textures and visually layers and refracts them so one appears to be inside the other. This results in a really neat effect, and can be used to add depth and sparkle to gems, glass, and other shiny things.
A diamond with multilayer parallax.
Shader Structure
MultiLayer Parallax is a specific shader type that requires a certain setup to function. To add MLP to your mesh, you need two nodes. The BSLightingShaderProperty node, and to it attached a BSShaderTextureSet.
Basic structure of a MLP mesh.
Typical MLP BSLightingShaderProperty setup.
In order for MLP to be activated, you need to select MultiLayer Parallax for the Skyrim Shader Type, and Multi_Layer_Parallax in the Shader Flags 2 dropdown. Both must be selected, or the shader won't work!
Switching to the MultiLayer Parallax shader will add four new inputs at the bottom of the shader:
Parallax Inner Layer Thickness - Thickness of the simulated first layer.
Parallax Refraction Scale - Supposed to change the amount of refraction, but doesn't seem to do much... Must be a number between 0-1.
Parallax Inner Layer Texture Scale - Tiling size of the inner layer diffuse texture.
Parallax Envmap Strength - Strength of the environment map fake reflections.
Texture Set Structure
The texture node is set up similarly to an Environment Map shader, with a few key differences. You will probably recognize a few of these, and they generally work as expected. MLP textures work like a sandwich of a transparent outer diffuse, and an opaque inner diffuse. It is important for the outer diffuse to have some transparency or you will not see the effect.
Typical BSShaderTextureSet setup.
The following texture slots are useable, and the necessary ones are starred:
Slot 1: Outer diffuse* - A transparent surface texture, the more transparent the texture the stronger the effect. A fully opaque diffuse will have no effect.
Slot 2: Normal map - Outer reflections, where light hits on the surface.
Slot 3: Subsurface scattering - Fake subsurface scattering. Doesn't seem to make much of a difference.
Slot 5: Environment/Cubemap* - Fake detailed outer reflections.
Slot 6: Environment mask - A greyscale mask of where the cubemap reflections are rendered, with black being no reflections and white being a full effect.
Slot 7: Inner layer diffuse* - The inner layer base color, what the inside of the MLP mesh looks like. Opacity should be around 90%.
Slot 8: Inner layer depth - The apparent distance between the inner and outer layer, a greyscale texture where black is closest and white is furthest. The difference doesn't appear significant, though.
Interactions and Caveats
Skyrim is a bit of a finicky beast, if you tweak one thing, you might inadvertently create a problem somewhere else. I don't think there's much you can do in a shader node to outright break Skyrim, but there are certain things that may cause unwanted effects on the same mesh as a MLP shader.
MLP on a sapphire that uses fully saturated, high value vertex colors as a diffuse.
Vertex colors are one of these things. When used with MultiLayer Parallax, they can obscure the effect if you're not careful. The stronger the saturation and lower the value of a vertex's color, the harder it will be to see the inner parallax. This can however be used to create interesting effects if used properly, like fake ambient occlusion, or to conceal parts of a mesh. Note that MLP is still somewhat visible if the vertex colors are fully saturated, but still high value.
MLP on an amethyst with a typical 4845 alpha flags and a slightly more opaque diffuse.
Transparency is another tricky thing with MLP. I'm assuming you use 4844/4845 as your default transparent texture flags in order to translate texture alpha to mesh transparency. This effect applies to the whole mesh, and ignores the second diffuse. You can modify your diffuse to be more opaque, as I did in this screenshot, but you lose a lot, if not all, of the effect
Using the Alpha input in the BSLightingShaderProperty also seems to be buggy, transparency changing drastically at any number below 1.
It gets worse when you add refraction to the mix. MLP and refraction don't play nice, so you end up with the refraction flickering on and off. It's very hard to get a picture of, but I've included a mesh of an emerald with MLP, transparency, and refraction that you can bring into the game and see these issues for yourself.
When to use MultiLayer Parallax?
I started looking into MultiLayer Parallax because I was curious if it could be a viable, accessible alternative to the complex glass refraction process typically used by modders. It has its pros and cons, as does refraction, and does certain effects better or worse.
From left to right: vanilla ruby, transparent and refracting ruby, Multilayer Parallax ruby
Refraction looks best on thin glassy objects that you want to be able to see through, like bottles or glasses. MLP looks best on thicker glass, gemstones, and environmental ice, because it gives an illusion of depth and complexity, at the cost of transparency. This doesn't mean you can't use MLP on bottles or refraction on glaciers, it would just be a little more difficult to get it looking realistic in game.
Using vertex colors to mimic transparency on a MLP'd potion bottle.
One thing to note is like with any texturing, what your mesh looks like in NifSkope and what it looks like in Skyrim may vary drastically. MLP especially can look very different in game, so it's important to test your mesh in game to make sure everything looks how you want it to.
Multilayer parallax gemstones on a table.
References and Resources
Gemstones Remade by wSkeever - Inner layer texture and initial inspiration
Praedy's Soul gems by PraedythXVI - More examples of MLP in use
BSLightingShaderProperty Basics by Imsumdave - In-depth NifSkope shader reference
The Arcane University - Resources and support
This tutorial and all its containing assets are released under the CC BY-SA creative commons license. This means if you use any of these assets, please remember to credit me (and wSkeever if you use their inner layer texture).
I hope you found this tutorial useful, and please let me know if you have any questions, or if any of this information is incorrect. Thanks, and happy modding!