3D: Common Shaders

///3D: Common Shaders

Common Shaders


General Structure of a Mesh

Make sure, that you visualise it as tree diagramme.

Note that there is a hierarchical order, similar to shoulder -> arm -> hand -> finger.
In theory, your mesh could be sorted differently, but most meshes look like this. If you see slight variations, don’t worry too much,
the system behind is the same.

The top level is most commonly a BSFadeNode (static bodies) or a Ninode (Skinned rigged meshes) or a BSLeafAnim/tree node (plants).
The BSX Flag below is for activating the collision. The bhkCollision object is the mesh of the collision.

The first sublevel has the Nitrishape, which is the “body” of the mesh. There can be as many as you want.

Each Nitrishape then has a second sublevel, which contains a NirtiShape Data tab and the LightingShaderProperty.
This is where we set up the way the mesh is rendered. Here, we set the shader type and the shader flags and controllers.

If you double click on the BSLightingshaderProperty, you find the third sublevel, the TextureSet, which contains your texture slots.
For detailed information on DDS formate texture files, please click here.
For detailed information on texture sets/texture slots of shaders, click here.


Meshes can be rendered in Skyrim according to their BSLightingShaderProperty (this article) or the BSEffectProperty (more here).

Most commonly used BSLightingShaderProperties are Default shader type (“0”) and Environment Map shader type (“1”).
You set your mesh shader property type in BSLightingshaderproperties. Note that each Nitrishape can only have one shader type and a small range of optional shader flags and use specific controllers(see below).

But, if needed, you can simply use multiple Nitrishapes combined on top of each other. As an example, it might make sense to split your mesh into subsections by material (metal, leather) and export each as a different Nitrishape (first sublevel) into the same mesh. Consider a leather armour for instance. I would suggest having an organic leather/cloth part (which usually absorbs light to a high degree and would use the default shader type) and the metal elements (which would reflect light stronger and profit from cube maps used in the environment map shader type).


Available Shader Flags, Controller Settings, and Texture Slots


Here you can see the available shader types of a BSLightingshaderproperty:

They also need specific shader flags to be set. Some are essential, others optional. These are all the available Shader Flags for Skyrim:


Commonly used in Skyrim are Default shader type (“0”) and Environment Map shader type (“1”). Green shows you those who are essential for exporting a default type mesh successfully, the minimum to be set. Pink are those commonly used additional options for Lighting, environment mapping or weighting (rigging), glow effects. There are more advanced features like multilayer parallax, but the intention of this short tutorial is, to give people a quick and solid introduction into the rendering settings for meshes used in Skyrim, which are unlike the more recent PBR Systems. You set your mesh shader property type in BSLightingshaderproperties. Note that each Nitrishape can only have one shader type and a small range of optional shader flags and use specific controllers (properties seen below).

The standard for the Glossiness value is 100. It ranged between 0 and 999.
Specular Strenght ranges from 0 to 10 but 2 would already be very strong,  1 being the default.
Refraction Strenght ranges from 0 to 1. 1 being absolute transparency.
Alpha also does transparency but in a different way.
Emissive Colour and Specular Colour are the RGB values that are shining or reflecting when looking straight at the mesh.
UV Scale is the scaling size of the UV map. You can right click on your mesh in the render window and chose textures / UV map and manually edit it, rotate and scale it.

You can find some more information regarding the shaders and the controller settings here. (PDF text)

They have their own unique requirements. They need specific Texture Slots to be filled, depending on their character.


Most Common Shader Types


Default Shader Type

use:
Assets with colour, height, and specularity.
common examples:
rocks, clothes, furniture, stones, plants, sometimes metals if specularity is done in a way that can pretend metallic reflections.
necessary slots:
1) base colour/diffusal map
2) normal map with specularity in alpha channel (optional)
necessary flags:
those who are marked green above under shader flags, for export; and additionally what you need
(vertex paint, specularity for example, if you learned how to apply these)

Example picture above, and shader settings of another example below.

The textures: 1) diffusal (base colour) in slot 1, and 2) normal map with optional specularity in alpha channel in slot 2 of the BSTextureSet.

Environment Map Shader Type

use:
Assets with colour, height, and specularity and additional shininess or gloss
common examples:
Metals, Chitin, Ore, Armours, Glass, Mirrors, Ice (more stable and consistent with ENBs than parallax)
necessary slots:
1) base colour/diffuse map
2) normal map with specularity in alpha channel (optional)
3) environmental/cube map (slot 5) (DTX1, see DDS Texture files for details)
optional: a material (m) map, that sets reflection (a bit like an additional specularity map with lower brightness, greyscale, see below)
necessary flags:
SLSF1_Environment_Mapping
SLSF2_Glow_Map disabled
controllers:
Environmental Map Scale; 1 is normal intensity, less is lower intensity, greater is higher intensity

above:

  1. Dwemer armour only with slot 1 and slot 2 (diffuse and normal)
  2. Dwemer armour with additional m map in slot 6.
  3. Dwemer armour with additional cube map on top of that in slot 5.

Example of BSLightingshaderproperties controller settings. The ice profits from a detailed normal map with spec map and the resulting specularity and gloss can be set only by these. A ice cubemap is used in slot 5, but no material map in slot 6.

Example Texture Set, with diffuse (Slot 1), normal map (Slot 2) with specularity in the alpha channel, additionally one of the vanilla cube maps would be used (Slot 5) and the material (Slot 6) which is kind of an extra specularity with low brightness controlling reflections.

I personally restrain from extensive use of multilayer parallax. It can give a great illusion of refraction or deepness and detail, but it can also be very volatile when being rendered with various ENBs (CTDs or simply wrong renders), and it could potentially conflict with other mods if we talk about vanilla assets being overhauled. On top of that, there is the performance issue for Skyrim Legendary Edition. However, for specific mods, small areas or personal use they might be very appealing. might be updated later.

Learn more, join our community!

Arcane University (also for non-members!)

Welcome to the Arcane University! We are a collaborative effort of Beyond Skyrim aiming to help people learn the various aspects that play into mod creation, like scripting, level design or 3d modelling to just name the major ones. If you are interested in learning one of these or just want to help out others achieve their goal, feel free to join us on our Discord server and begin your journey. Previous knowledge is not required, only that you are willing and eager to learn. Below you can find some work that students of the Arcane University made during their time with us. By honing your skills you can eventually graduate, those students may choose to work on one of the various Beyond Skyrim teams or the Atronach Forge, our cross-province content creation hub. So it is a good chance to get involved with the project and learn a few handy things along the way. Hope to see you soon!

By | 2018-09-14T12:30:49+00:00 September 12th, 2018|3D, Tutorials|0 Comments

About the Author: