Shaders Information

What is a shader?

Shaders are what determines the appearance of all objects in sansar, each shader is capable of different looks and effects, some make items glow, others make them follow the camera and some even have the ability to make items morph and textures animate!

Sansar has a predefined set of shaders and you must choose from these when making assets for avatars and edit world mode, below is a list of every shader in sansar and what they are capable of try to pick the lightest shader possible for the item you are creating.

Every shader has Map slots that accepts a image texture, Most maps accept PNG and JPEG, Displacement accepts PNG or EXR, sansar shaders uses the PBR Metallic+Roughness workflow and is OpenGL Normal. See Materials information for more.

Selecting a shader

In Edit mode - Right clicking a object or opening the structure menu if a asset contains multiple objects and right clicking the meshname from there then selecting 'Materials' from the drop down will open the materials Settings menu

In Lookbook - During the import of a item select the 'Materials Settings' Button at the bottom of the import menu

Each material slot on a asset can have a different shader allowing objects to have multiple different effects and texture sets on them, each material slot and shader you have on a object will increase the impact on performance try to keep these as low as possible.

The following shaders and settings can be applied to objects retroactively during Edit mode and can be changed and previewed while changing settings, currently you must set everything up during the import process for avatar items in lookbook. It is highly recommended to test your settings in edit mode as you can see the changes live.

Shader weights

Shaders in Sansar fall into the following weight categories, according to their potential impact on performance:

  • Feather weight - Lowest performance impact. Use these shaders as much as you like.

  • Light weight - Moderate performance impact. Use these shaders in specific cases to achieve a desired effect, but try to avoid applying them to objects that don't require them.

  • Heavy weight - Substantial performance impact. Use these shaders sparingly! If overused, these shaders can cause a significant drop in performance.

Shader Notes

  • Alpha mask shaders should not be used for transparent assets such as water or glass. The alpha mask threshold and softness values are used to remove artifacts and jagged edges from the opaque portions of the masked texture. Alpha masks are meant to create areas of 100% or 0% transparency and nothing in between. Instead, use Transmissive + Emissive, Transparent, or Transparent + Multibump when intermediate transparency is needed.

  • All shaders have the ability to be tinted, located at the bottom of each shaders menu is a eye dropper button and number fields for sRGB this is additive to the Albedo's color map, for best results using a greyscale map will yield matching tint colour but is not necessary.

  • Some of the settings can be adjusted via scripting live in runtime see Shader Scripting for more

  • Displacement is a new addition in its early release (Oct 2023) and has static and animated forms, it is not intended to replace Normal Map detail as assets would be too high poly for this to be effective, it is however able to manipulate mesh within the edit mode without the original upload files. see the Displacement guide for more.


Standard

  • Light weight

  • A basic, high performance, general shader. Suitable for most Assets, texture is only visible on one side.

  • Has static displacement

  • UV scale + UV rotate

Standard Two Sided

  • Light weight

  • Slightly heavier than the Standard shader, but suitable for single-sided planes that can be viewed from both sides.

  • Has static displacement

  • UV scale + UV rotate

Standard + Alpha Mask

  • Light weight

  • Allows fully transparent and opaque areas on a surface. Useful for details on objects such as hair, leaves, or chain-link fences, texture is only visible on one side.

  • Mask Threshold + Softness

  • Has static displacement

  • UV scale + UV rotate

Standard Two Sided + Alpha Mask

  • Light weight

  • Allows both sides of an alpha shader's texture to render. Use cases include grass, bushes, or chain-link fences that are visible from both sides.

  • Mask Threshold + Softness

  • Has static displacement

  • UV scale + UV rotate

Standard + Emissive

  • Heavy weight

  • Similar to the Standard shader, but additionally allows portions of the texture to glow. Examples include texture with glowing lights, such as a car with glowing headlamps.

  • Because emissive lighting affects scene lighting, emissive shaders should be used sparingly.

  • Accepts a Emissive Map and contains a intensity slider

  • Has static displacement

  • UV scale + UV rotate

Standard Two Sided + Emissive

  • Heavy weight

  • A Two sided version of the Standard + Emissive, texture is visible from both sides and shading of textures is affected differently

  • Accepts a Emissive Map and contains a intensity slider

  • Has static displacement

  • UV scale + UV rotate

Billboard

  • Feather weight

  • A surface with a single emissive or alpha texture that always faces the camera, regardless of viewing angle. Can use UV animation such as UV scrolling, or stepped frames such as a sprite sheet.

  • Has the following editable properties:

    • Brightness: Controls how brightly the emissive map glows.

    • Flipbook - Frame: Choose which frame the step animation begins on.

    • Flipbook - Step Rate: Defines the number of frames per second to animate. Television and movies most often animate at 24 frames per second. If you set this value to 0, the textures will not animate and shows only the first frame.

    • Flipbook - Loop: Toggle to restart the flip book at the first frame after the number of frames in ‘Loop’ have been displayed. Useful when the number of frames in a flip book cannot be evenly divided across two or more rows of a texture.

    • Flipbook - UV Frames: When equally divided into rectangular frames, define the number of frames your texture contains from left to right (X) and top to bottom (Y). For example, a 10-frame animation that has two rows of five frames would have an X value of 5.0 and a Y value of 2.0.

    • UV Scroll - Rate: For scrolling animation only; define the speed at which you would like the texture to scroll over the surface of the object in the X and Y directions.

    • Lollipop: Causes the surface to face the camera on the horizontal axis only; does not turn to face the camera vertically.

    • ClampUV - Stops flip book frames repeating incorrectly and fits them to the face.

Standard + Detail

  • Light weight

  • Similar to the Standard shader, but includes a secondary detail normal map and roughness that have X Y and Z (strength) scale. This allows close-up, repeatable details to be displayed, or used to adjust the secondary maps independently from the first set. Useful for including details such as clothing threads, divots on golf balls, or wood grain.

  • Has static displacement

  • UV scale + UV rotate

  • Secondary detail map scaling

Standard Two Sided + Detail

  • Light weight

  • Similar to Standard + Detail, but renders textures on both sides. Useful for inspection of close-up objects that can function as 2D assets, such as a piece of paper.

  • Has static displacement

  • UV scale + UV rotate

  • Secondary detail map scaling

Standard + Detail + Alpha Mask

  • Light weight

  • Allows close-up detail inspection of objects that also have transparent and opaque sections of the texture, such as plant leaves.

  • Mask Threshold + Softness

  • Has static displacement

  • UV scale + UV rotate

  • Secondary detail map scaling

Standard Two Sided + Detail + Alpha Mask

  • Light weight - but this is the heaviest compared to the previous Detail shaders

  • Similar to Standard + Detail + Alpha Mask, but allows both sides of a asset to display the texture.

  • Alpha Mask Threshold + Softness

  • Has static displacement

  • UV scale + UV rotate

  • Secondary detail map scaling

Subsurface + Detail

  • Heavy weight

  • This is a performance-intensive, specialty shader that should be used only as needed.

  • Allows a different color to shine through a texture's diffuse colors. Bright areas of the surface begin to inherit the bleed tint colors. Useful for surfaces such as skin, stones such as jade or quartz, or other assets that display a subsurface color when exposed to bright light.

  • Bleed Distance: How strongly the subsurface color appears when a light shines directly on the surface.

  • Bleed Tint: The subsurface color that appears in bright light.

  • Has static displacement

  • UV scale + UV rotate

  • Secondary detail map scaling

Subsurface + Detail + Alpha Mask

  • Heavy weight

  • Similar to Subsurface + Detail, but additionally allows transparent areas.

  • Performance-intensive, and should only be used when absolutely necessary for a specific object.

  • Bleed Distance: How strongly the subsurface color appears when a light shines directly on the surface.

  • Bleed Tint: The subsurface color that appears in bright light.

  • Has static displacement

  • UV scale + UV rotate

  • Secondary detail map scaling

  • Alpha Mask Threshold + Softness

Standard + Detail + Emissive

  • Heavy weight

  • Allows detail and emissive textures to be used on the same object. For example, a flashlight with a detailed handle.

  • Textures can only be seen from one side

  • Accepts a Emissive Map and contains a intensity slider

  • Has static displacement

  • UV scale + UV rotate

  • Secondary detail map scaling

Standard TwoSided + Detail + Emissive

  • Heavy weight

  • Similar to the Standard + Detail + Emissive

  • Textures can be seen from both sides

  • Accepts a Emissive Map and contains a intensity slider

  • Has static displacement

  • UV scale + UV rotate

  • Secondary detail map scaling

Four Layer Non-Specular

  • Heavy weight

  • The most basic texture blender. Allows up to four Albedo + Normal maps to be blended using one blend texture that uses red, green, blue, and black to determine where to place the diffuse textures. Most commonly used for terrain, such as to blend grass into dirt to create trails.

  • The colors for the blend map are as follows:

    • Black: Layer 1

    • Red: Layer 2

    • Green: Layer 3

    • Blue: Layer 4

  • UV Rotate - this affects all 4 map sets

  • UV Scale - this is controlled separately via 4 input boxes that affect each set independently denoted by X, Y, Z, W

  • Has static displacement

Standard Three Layer + Detail

  • Heavy weight

  • Similar to Four Layer Non-Specular, but allows the inclusion of normal, rough, metal, and a secondary set of detail maps in addition to standard sets.

  • The colors for the blend map are as follows:

    • Red: Layer 1

    • Green: Layer 2

    • Blue: Layer 3

  • UV Rotate - this affects all 3 map sets

  • UV Scale - this is controlled separately via 3 input boxes that affect each set independently denoted by X, Y, Z

  • Detail Scale - This affects the scale of the detail maps separately to the main set of maps

Emissive + UV animation

  • Feather weight

  • The most basic light-emitting texture. Allows you to control areas of the object that appear to emit light, and areas that remain dark. Useful for skyboxes, custom-shaped lights, or neon signs.

  • only contains emissive map and mask no roughness, normal or metal

  • Has the following editable properties:

    • Mask map: Behaves like an alpha mask, except for the RGB channels of the emissive material.

    • Emissive Intensity: Toggle to set the brightness or dimness of the emissive map.

    • Absorption: Determines how much of the light coming from behind the material is prevented from being transmitted through the material (i.e. absorbed). A value of 1.00 means 100% is absorbed - thus 0% is transmitted through the material and the material will appear ‘opaque’.

    • Uv Scale - Sets the size of the UV texture. Repeats the texture if higher than 1.0.

    • Flipbook - Frame: Choose which frame the step animation begins on.

    • Flipbook - Step Rate: Defines the number of frames per second to animate. Television and movies most often animate at 24 frames per second. If you set this value to 0, the textures will not animate and shows only the first frame.

    • Flipbook - Loop: Toggle to restart the flip book at the first frame after the number of frames in ‘Loop’ have been displayed. Useful when the number of frames in a flip book cannot be evenly divided across two or more rows of a texture.

    • Flipbook - UV Frames: When equally divided into rectangular frames, define the number of frames your texture contains from left to right (X) and top to bottom (Y). For example, a 10-frame animation that has two rows of five frames would have an X value of 5.0 and a Y value of 2.0.

    • UV Scroll - Rate: For scrolling animation only; define the speed at which you would like the texture to scroll over the surface of the object in the X and Y directions.

    • Scroll option: Toggle which maps will be subject to the scrolling effect.

    • ClampUV - Stops flip book frames repeating incorrectly and fits them to the face.

    • Has Animated displacement

    • Fluid distortion slider (wiggly texture)

Emissive Two Sided + UV Animation

  • Light weight

  • Similar to the Emissive + UV Animation but two sided and can be seen from both sides

  • UV scale

  • Has animated displacement

  • Fluid distortion slider (wiggly texture)

  • ClampUV - Stops flip book frames repeating incorrectly and fits them to the face.

Transmissive + Emissive

  • Heavy weight

  • Allows partially see-through areas on emissive surfaces. Does not force transparent areas to become fully transparent (such as with the Alpha Mask shaders). Useful for creating surfaces that can be seen through while adding some color and emissive glow, such as stained glass.

  • UV scale

  • Emissive intensity slider

Standard + Emissive + Stereographic

  • Heavy weight

  • Allows side-by-side or top-and-bottom 3D images to be viewed in VR. In desktop mode, only the image for the left eye is shown.

  • Orientation of the left and right images can be adjusted using the Rotation Factor property. The Rotation Factor setting is multiplied by 90 degrees as follows:

    • 0: "Wall-eyed" orientation, where the left image is meant for the left eye and the right image is meant for the right eye.

    • 1: Orientation where the top image is meant for the left eye and the bottom image is meant for the right eye.

    • 2: "Cross-eyed" orientation, where the right image is meant for the left eye and left image is meant for the right eye.

    • 3: Orientation where the bottom image is meant for the left eye and the top image is meant for the right eye.

    • UV scale

Standard + Emissive + UV Animation

  • Heavy weight

  • Similar to Emissive + UV but contains the standard set of maps also

  • Allows flip frame or smooth scrolling of a texture that can also emit light. Useful for animating texture lights that blink on and off or flickering neon signs, glowing effects on clothing etc.

  • The relevant settings are as follows:

    • Flipbook - Frame: Choose which frame the step animation begin

    • Flipbook - Step Rate: Defines the number of frames per second to animate. Television and movies most often animate at 24 frames per second. If you set this value to zero, the texture will not animate and will show only the first frame.

    • Flipbook - Loop: Toggle to restart the flip book at the first frame after the number of frames in ‘Loop’ have been displayed. Useful when the number of frames in a flip book cannot be evenly divided across two or more rows of a texture.

    • Flipbook - UV Frames: When equally divided into rectangular frames, define the number of frames your texture contains from left to right (X) and top to bottom (Y). For example, a 10-frame animation that has two rows of five frames would have an X value of 5.0 and a Y value of 2.0.

    • UV Scroll - Rate: For scrolling animation only; define the speed at which you would like the texture to scroll over the surface of the object in the X and Y directions.

    • Scroll option: Toggle which maps will be subject to the scrolling effect.

    • Fix Shimmering: Addresses shimmering artifacts that can occur when bright emissive materials are scrolling at high speed on thin objects.

    • Clamp UV - Stops flip book frames repeating incorrectly and fits them to the face.

    • Has animated displacement

    • Fluid distortion slider (wiggly texture)

Standard Two Sided + Emissive + UV Animation

  • Heavy weight

  • Similar to the Standard + Emissive + UV Animation but is visible from both sides

  • Has animated displacement

  • Fluid distortion slider (wiggly texture)

  • ClampUV - Stops flip book frames repeating incorrectly and fits them to the face.

Standard + Alpha Mask + UV Animation

  • Heavy weight

  • Has the standard set of maps but also allows Alpha and UV animation

  • Allows flip frame or smooth scrolling of a texture that allows Alpha Masks. Useful for making sprite-based assets.

  • The relevant settings are as follows:

    • Flipbook - Frame: Choose which frame the step animation begin

    • Flipbook - Step Rate: Defines the number of frames per second to animate. Television and movies most often animate at 24 frames per second. If you set this value to zero, the texture will not animate and will show only the first frame.

    • Flipbook - Loop: Toggle to restart the flip book at the first frame after the number of frames in ‘Loop’ have been displayed. Useful when the number of frames in a flip book cannot be evenly divided across two or more rows of a texture.

    • Flipbook - UV Frames: When equally divided into rectangular frames, define the number of frames your texture contains from left to right (X) and top to bottom (Y). For example, a 10-frame animation that has two rows of five frames would have an X value of 5.0 and a Y value of 2.0.

    • UV Scroll - Rate: For scrolling animation only; define the speed at which you would like the texture to scroll over the surface of the object in the X and Y directions.

    • Scroll option: Toggle which maps will be subject to the scrolling effect.

    • Has animated displacement

    • Fluid distortion slider (wiggly texture)

Standard Two Sided + Alpha Mask + UV Animation

  • Heavy weight

  • Similar to the Standard + Alpha Mask + UV Animation but is visible from both sides

  • Has the standard set of maps but also allows Alpha and UV animation

  • Has animated displacement

  • Fluid distortion slider (wiggly texture)

Media Surface

  • Heavy weight

  • A streaming surface used to display video media. This shader when combined with media based scripts is able to display web pages, streams and videos. Useful for theater or television screens.

  • Currently you can place multiple media surfaces in a world but they will all show the same stream.

  • Any avatars items worn using this will automatically display what is being played on the in world media stream.

  • UV Scale

  • Has all standard maps + Emissive map and intensity for when a media is not being played, this can show through on video and be used to create stylised screens such as ice and cracked/damaged screens.

Media Surface + Stereographic

  • Heavy weight

  • Similar to Media Surface, but capable of displaying stereographic video for a 3D effect while in VR. When in desktop mode, only the image for the left eye is shown.

  • Orientation of the left and right images can be adjusted using the Rotation Factor property. The Rotation Factor setting is multiplied by 90 degrees as follows:

    • 0: "Wall-eyed" orientation, where the left image is meant for the left eye and the right image is meant for the right eye.

    • 1: Orientation where the top image is meant for the left eye and the bottom image is meant for the right eye.

    • 2: "Cross-eyed" orientation, where the right image is meant for the left eye and left image is meant for the right eye.

    • 3: Orientation where the bottom image is meant for the left eye and the top image is meant for the right eye.

Media Surface + ChromaKey

  • Heavy weight

  • A Chromakey version of the Media Surface shader, this is used for removing a chosen key color from any media displayed on the surface i.e. Green/Blue screens, a live video of a DJ in front of a greenscreen could be used and keyed out to add to a events experience.

  • UV Scale.

  • Has all standard maps + Emissive map and intensity.

  • Includes multiple sliders to adjust the Keying.

  • Secondary color input field to choose Key Color.

Transparent

  • Light weight

  • Accepts a Albedo, Normal and Roughness map only. Creates an object that appears to be transparent. The amount of transparency is determined by the brightness of the colors in the albedo map; a totally white albedo map results in a colorless, totally transparent object whereas a totally black albedo map results in a black, opaque object. Scene lighting may still affect how the surface of the object looks while visiting the scene.

  • Only one transparent layer is visible any overlapping transparent shader behind the top one will be rendered completely invisible

  • UV scale

Transparent + Multibump

  • Heavy weight

  • Similar to Standard with an Albedo map, Normal map, and Roughness map, but is transparent and overlays and scrolls the Normal map at 3 additional perceived depths for a flowing water-like effect.\

    • Uv Scale - Sets the size of the UV texture. Repeats the texture if higher than 1.0.

    • Bump Scale - Sets the "roughness" of the normal map. Low values look nearly smooth, and high values look exceptionally rough or bumpy.

    • Octave Wavelength Decay - Set the perceived depth of the three scrolling normal maps. At low values the lower layers appear to be deep below surface, and at high values all three layers appear to be near the surface.

    • Octave Bump Decay - Controls how "rough" the sub-layers appear. At low values the layers appear smoother, and at high values they appear rougher.

    • Uv Scroll Rate - Sets how fast to scroll the normal map across the surface in the X and Y directions.

    • Has Static Displacement

    • Fluid distortion slider (wiggly texture)

Last updated