Difference between revisions of "Arcane University:NetImmerse Format/BSLightingShaderProperty"

The Beyond Skyrim Wiki — Hosted by UESP
Jump to: navigation, search
(move from nif page)
 
(rewrite. wip)
Line 1: Line 1:
[[File:BSshadertypes01.png|right]]  
+
{{Trail|Nif implementation}}
 +
The '''BSLightingShaderProperty''' is the most common type of [[AU:NetImmerse Format#Shader properties|shader property]] used in Skyrim. It defines the attributes of the material which is used for shading the mesh. It is suitable for most tangible objects. For objects which require more elaborate blending effects, a [[AU:NetImmerse Format/BSEffectShaderProperty|BSEffectShaderProperty]] may be better.
  
Here you can see the available shader types of a BSLightingShaderProperty. They also need specific shader flags to be set and specific texture maps. Some are essential, others optional. These are all the available Shader Flags for Skyrim:
+
== Shader Types ==
 +
There are several overall shader types which you can choose from. They are ordered here and in NifSkope generally from most common to least common. Each one uses the textures in its child block BSTextureSet slightly differently. Some of the data which is used in common across different shader types is outlined below:
  
[[File:BSshadersFlagsExport.png]]
+
* '''Glossiness''': Inverse width of the specular highlight. Higher values are narrower, lower values are wider.
 +
* '''Specular Color''': The color of the specular highlight.
 +
* '''Specular Strength''': Multiplier on specular highlight intensity. Values between 0.25 and 1 are typical.
 +
* '''Refraction Strength''': Ranges from zero to 1.{{nt|Needs testing for exact behavior}}
 +
* '''Alpha''': Overall opacity of the TriShape, zero being fully transparent, and one being fully opaque. Can be buggy, so use an alpha property instead whenever possible.
 +
* '''Emissive Color''': Color of any glow effects. If the shader type is not "Glow Shader," it will make the whole mesh glow.
 +
* '''Emissive Strength''': Multiplier on glow intensity.
 +
* '''UV Scale''' is the scaling size of the UV map. You can right-click on your mesh in the render window and choose textures > UV map and manually edit it, rotate, and scale it.
  
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).
+
=== Default ===
 +
The default shader is the most commonly used. It is good for most solid objects which do not require any additional shading effects. Shapes using the default shader should have a diffuse texture and combined normal/specular texture.
  
[[File:BScontrollers01.png]]
+
=== Environment Map ===
 +
[[File:EnvShader1.png|thumb|upright=2|Dwarven armor comparison]]
 +
The environment map shader is also quite common. It provides a method of simulating reflectivity by using a prerendered environment texture as the reflection. This is applied additively to the mesh. It is commonly used for metals, ore, and ice. Shapes using the environment map shader should have diffuse, combined normal/specular, environment, and environment mask textures. The environment mask texture is used to define how strongly the cubemap is blended per texel. The environment map shader is incompatible with glow mapping, so if you have a mesh for which you want to use both effects, you have to split it into parts, or overlay a partially transparent mesh. Be sure the Environment Map shader flag is set, and the Glow Map shader flag is ''not'' set.
  
* The standard for the '''Glossiness''' value is 100. It ranged between 0 and 999.
+
Values:
* '''Specular Strength''' ranges from 0 to 10 but 2 would already be very strong,  1 being the default.
+
* '''Environment Map Scale''': Multiplier on environment map intensity. Values between 0.25 and 2 are typical.
* '''Refraction Strength''' 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.
 
  
The 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 armor 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).
+
=== Glow Shader ===
  
====Default Shader====
+
=== Parallax ===
  
* Name: Default Shader Type (0)
+
=== Face Tint ===
* used for: Assets with color, 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: Slot1) base color/diffuse map AND Slot2) 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)
 
  
[[File:DefaultShaderExample01.jpg]]
+
=== Skin Tint ===
[[File:DefaultShaderExample02.png]]
 
  
A House as an example and the shader flags and lighting properties.
+
=== Hair Tint ===
  
[[File:DefaultShaderExample03.png]]
+
=== Multilayer Parallax ===
[[File:DefaultShaderExample04.png]]
 
  
The texture set of a default shader set, consisting of a diffuse and normal map.
+
=== Eye Envmap ===
  
====Environmental Shader====
+
== Shader Flags ==
 
+
[[File:BSshadersFlagsExport.png]]
* Name: Environment Map Shader Type (1)
 
* used for: 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: Slot 1) base color/diffuse map AND Slot 2) normal map with specularity in alpha channel (optional) AND environmental/cube map (slot 5) (DTX1, see DDS Texture files for details) AND optional: an environment mask (_m or _em), that sets which areas are reflective (Slot 6)
 
* 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.
 
 
 
[[File:envShader1.png]]
 
 
 
Dwemer armour only with slot 1 and slot 2 (diffuse and normal); Dwemer armour with additional m map in slot 6; Dwemer armour with additional cube map on top of that in slot 5.
 
 
 
[[File:EnvShader2.png]]
 
 
 
Ice: Example of BSLightingshaderproperties controller settings. The ice profits from a detailed normal map with a spec map and the resulting specularity and gloss can be set only by these. An ice cubemap is used in slot 5, but no material map in slot 6.
 
 
 
[[File:EnvShader3.png]]
 
 
 
A typical metal texture set for Skyrim: the rendering will make the diffuse appear much brighter. A lot of detail is being baked into the diffuse. Finally, the sword appears silver-metallic in the game engine.
 
 
 
For how to work on the material map for the roughness and metallic shine, see https://www.youtube.com/watch?v=DWs9rDpA5tQ
 

Revision as of 20:53, 30 November 2025

< Arcane University:Nif implementation

The BSLightingShaderProperty is the most common type of shader property used in Skyrim. It defines the attributes of the material which is used for shading the mesh. It is suitable for most tangible objects. For objects which require more elaborate blending effects, a BSEffectShaderProperty may be better.

Shader Types

There are several overall shader types which you can choose from. They are ordered here and in NifSkope generally from most common to least common. Each one uses the textures in its child block BSTextureSet slightly differently. Some of the data which is used in common across different shader types is outlined below:

  • Glossiness: Inverse width of the specular highlight. Higher values are narrower, lower values are wider.
  • Specular Color: The color of the specular highlight.
  • Specular Strength: Multiplier on specular highlight intensity. Values between 0.25 and 1 are typical.
  • Refraction Strength: Ranges from zero to 1.Template:Nt
  • Alpha: Overall opacity of the TriShape, zero being fully transparent, and one being fully opaque. Can be buggy, so use an alpha property instead whenever possible.
  • Emissive Color: Color of any glow effects. If the shader type is not "Glow Shader," it will make the whole mesh glow.
  • Emissive Strength: Multiplier on glow intensity.
  • UV Scale is the scaling size of the UV map. You can right-click on your mesh in the render window and choose textures > UV map and manually edit it, rotate, and scale it.

Default

The default shader is the most commonly used. It is good for most solid objects which do not require any additional shading effects. Shapes using the default shader should have a diffuse texture and combined normal/specular texture.

Environment Map

Dwarven armor comparison

The environment map shader is also quite common. It provides a method of simulating reflectivity by using a prerendered environment texture as the reflection. This is applied additively to the mesh. It is commonly used for metals, ore, and ice. Shapes using the environment map shader should have diffuse, combined normal/specular, environment, and environment mask textures. The environment mask texture is used to define how strongly the cubemap is blended per texel. The environment map shader is incompatible with glow mapping, so if you have a mesh for which you want to use both effects, you have to split it into parts, or overlay a partially transparent mesh. Be sure the Environment Map shader flag is set, and the Glow Map shader flag is not set.

Values:

  • Environment Map Scale: Multiplier on environment map intensity. Values between 0.25 and 2 are typical.

Glow Shader

Parallax

Face Tint

Skin Tint

Hair Tint

Multilayer Parallax

Eye Envmap

Shader Flags

BSshadersFlagsExport.png