MarmosetUBER Properties
This article tries to shed some light onto the different shader variables and keywords encountered while implementing the shiny material solution of the Echelon.
Only variables of which some meaning is at least guessable are listed here. The MarmosetUBER shader has a total of 112 variables, most of which are presumed to be hidden behind unknown shader keywords.
Variables
- _BumpMap (Texture). Normal map
- _Cutoff (float) [0,1]. Theorized to configure alpha-map cutout materials but the shader keyword to enable that is unknown. Simply setting this and _EnableCutOff does nothing. Set to 0 by the shininess correction.
- _DetailBumpTex (texture). Theorized to be the detail normal map
- _DetailDiffuseTex (texture). Theorized to be the detail albedo texture
- _DetailIntensities (vector). Theorized to scale the impact of diffuse, bump, and specular detail intensity maps
- _DetailSpecTex (texture). Theorized to be the detail specular intensity map
- _EnableGlow (float) [0,1]. Theorized to also impact the emission intensity but has not been effectively used. Is set to 1 by the shininess correction
- _Enable3Color (float) [0,1]. Theorized to enabled the 3 color interpolation for material customization. The Echelon does not use this. Is set to 1 by the shininess correction. Presumed to enable color customization when the shader keyword UWE_3COLOR is included.
- _EnableCutOff (float) [0,1]. Theorized to enabled alpha-map cutout materials but the shader keyword to enable that is unknown. Simply setting this and _Cutoff does nothing.
- _EnableDetailMaps (float) [0,1]. Theorized to allow repeating detail maps to modulate the appearance.
- _EnableDitherAlpha (float) [0,1]. Theorized to enabled a dithered transparency but the shader keyword to enable that is unknown Simply setting this does nothing.
- _EnableLighting (float) [0,1]. Theortized to allow disabling light reception. Defaults to 1
- _EnableMainMaps (float) [0,1]. Theorized to allow disabling albedo and normal maps. Defaults to 1
- _EnableSimpleGlass (float) [0,1]. Theorized to allow glass rendering. Defaults to 0
- _EnableVertexColor (float) [0,1]. Theorized to allow colors per vertex. Defaults to 0
- _Fresnel (float) [0,1]. Theorized to produce extra fresnel light around the edges (if 0, the material still shows signs of fresnel reflection). Defaults to 0
- _GlowColor (color). Theorized to be multiplied with the emission/illumination texture sample. Presumed effective only if the MARMO_EMISSION shader keyword is declared. Defaults to white.
- _GlowStrength (float) 0+. Controls the intensity of the emission/illumination map during the day. Typically 0 (disabled) or 1.94 (bright). Presumed effective only if the MARMO_EMISSION shader keyword is declared. Reset to 0 when undocking
- _GlowStrengthNight (float) 0+. Controls the intensity of the emission/illumination map during the night. Typically 0 (disabled) or 1.94 (bright). Presumed effective only if the MARMO_EMISSION shader keyword is declared. Reset to 0 when undocking
- _Illum (texture). Emission/illumination map. Presumed RGB only. Presumed effective only if the MARMO_EMISSION shader keyword is declared
- _MainTex (Texture). Albedo texture
- _MarmoSpecEnum (float) 0+. Theorized to declare how specular reflection affects the material. Is set to 2 by the shininess correction
- _SpecColor (color). Theorized to be multiplied to the specular sample retrieved from the environment. Assumed effective only if the MARMO_SPECMAP shader keyword is set. Defaults to white
- _SpecInt (float) [0,1]. Controls the global intensity of the specular reflection. Typically 0 (disabled) or 1 (full). Effective only if the MARMO_SPECMAP shader keyword is declared. Reset to 0 when undocking
- _SpecTex (Texture). Specular reflectivity definition texture. Only its alpha channel is used. Effective only if the MARMO_SPECMAP shader keyword is set
- _Shininess (float) [0,8]. Theorized to be the exponent of the specular sun reflection on the material. Is set to 7.014718 by the shininess correction
- _ZWrite (float) [0,1]. Theorized to allow disable Z-Write during rendering. Since there is a corresponding shader keyword _ZWRITE_ON, it is assumed that that has to be included for this value to take any effect. Defaults to 1
Shader keywords
- MARMO_EMISSION Assumed to enable emission/illumination maps
- MARMO_SPECMAP Enables specular reflections
- UWE_3COLOR Assumed to enable color customization
- _ZWRITE_ON Assumed to enable changing the _ZWrite variable
Color Customization
This chapter is pure theory. The Echelon uses a different much more crude solution but at the time of experimentation, the correct shader keyword was unknown, presumably rendering all experiments useless.
In order to allow color customization, the material needs to include the shader keyword UWE_3COLOR. It then needs to fill the _MultiColorMask texture with supposedly an RGB texture with 1 intensity per channel and finally set _Enable3Color to 1.0. To define the actual colors, fill in _Color, _Color2, and _Color3. You may have to also fill _SpecColor, _SpecColor2, and _SpecColor3 but their purpose is unknown.
How the Echelon does it
A render texture is created for every part that permits texture base customization (body, engine housing, side elements). Whenever a color change is detected, these render textures are updated on the fly using a simple baking shader, which accepts the main and stripe colors, the base texture, and a mask texture. The mask texture then defines how much of either the base or the stripe color is to be applied on a specific texel, the base texture is multiplied to that color. This solution is sufficiently fast but it requires to keep several rendering textures in memory per Echelon, some of which are 4k*4k pixels large and uncompressed. For a sufficiently high-end system, this is not an issue, but on the lower end it might impact rendering performance, particularly if several Echelons are in view.
0 comments