Materials editing and shaders

Instead of using the Phong shader in your 3D modeling tool, you can use the Materials Settings panel to apply shaders and texture maps to objects. 

Accessing Materials Settings

Access Materials Settings when uploading an object in edit mode

  1. Click Import > 3D Model in the top toolbar. See Uploading items in Sansar.
  2. When the Import 3D Model panel appears, you will need to select a .fbx file first to upload. Under 3D model file, click Browse and choose a 3D model (.fbx or .obj) from your computer.
  3. Once a file is selected, click the Materials Settings button to access the Materials Settings panel.
    Import_3D_model_panel.png
    The upload panel once a .fbx file has been selected from your local drive. 

Access Materials Settings for an object that is already in a scene

You can access Materials Settings on objects that have been placed in a scene. Note that you cannot currently take objects from a scene back into your inventory, so there is no way to save and reuse changes you make to an object in this way:

  1. Find the object in the Scene Objects panel.
  2. Right-click the object's name and choose Materials...
Note: When changing materials settings for an object that is already in a scene, those changes are previewed on the object. The changes are reverted if you close the Materials Settings panel by clicking Cancel.

 

Access_materials_settings_on_existing_object.png
Accessing the Materials Settings panel for an object that is already in the scene.

Materials Settings panel overview

Materials_settings_with_callouts.png

The Materials Settings panel.

Loaded materials

The Loaded materials list shows the materials applied to the model at the time of upload. If no materials are assigned, a single default material is applied to all parts of the model. Select each material to assign a shader and texture maps to each.

Use shader

The Use shader dropdown lists all shaders that can be applied to the currently selected object part. Each shader is ideal for a different application, and comes with its own subset of possible texture maps:

Examples_shaders.png
Example usage of StandardStandard+Alpha Mask, and Standard+Emissive shaders.
  • Standard- Good for most objects that don't require transparency or glowing effects; this option provides better performance than Standard + Alpha Mask or Standard + Emissive.
  • Standard + Alpha Mask - Very similar to Standard, but allows the use of a black or white alpha mask in order to provide transparency.
  • Standard + Emissive - Similar to Standard + Alpha Mask, but allows you to add an emissive map to provide a glow effect.
  • Standard + Detail - The same as Standard, but allows you to define additional, more detailed maps that gradually fades in as the camera approaches. This can be used for high-frequency surface details, such as the bumpy surface of an orange.
  • Standard Detail + Alpha Mask - As with Standard + Detail, allows you to define additional detailed maps that become visible as the camera approaches. Allows you to use a black and white alpha mask for transparency.
  • Standard + Detail + Emissive - As with Standard + Detail, allows you to define additional detailed maps that become visible as the camera approaches. Allows you to define emissive maps to provide a glow effect.
  • Four layer Non-Specular - Allows you to define up to four albedo maps and four normal maps to be blended together using a blend map. This allows you to create a layered effect useful for creating things like terrain or aging, damaged walls. The colors for the blend map are as follows:
    • Black: Layer 1
    • Red: Layer 2
    • Green: Layer 3
    • Blue: Layer 4
  • Standard Three Layer + Detail - Similar to Four layer Non-Specular, but also allows Roughness, Metalness, and detail maps, and only three of each instead of four.
  • Transmissive + Emissive - Allows you to create objects that include both alpha channel transparency and an emissive map. Objects seen through the transparent surface of this object appear tinted with the transparent surface's color, as though seen through stained glass.
  • Standard + Emissive + Stereographic - Show 3D images by using a side-by-side 3D texture. The 3D texture is only properly visible in VR mode, and the 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:
    • - "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 right image is meant for the right eye.
    • 2 - "Cross-eyed" orientation, where the left image is meant for the left eye and the right image is meant for the left eye.
    • 3 - Orientation where the bottom image is meant for the left eye and the top image is meant for the right eye.
  • Standard + Emissive + UV Animation - Allows for one of two types of UV animation: Flipbook, which steps through a set of defined frames in a texture (such as a sprite sheet), and Scrolling, which smoothly scrolls the texture across the surface of the object. The relevant settings are as follows:
    • 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 - 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.
  • Standard + Alpha Mask + UV Animation - The same as Standard + Emissive + UV Animation, but replaced the emissive map with the ability to use an alpha mask, allowing for transparent, animated images.
  • Media Surface - Allows this object to function as a media surface. You may also choose to set other maps for this shader, but be aware that they can visually interfere with media playback.
  • Media Surface + Stereographic - Create a media surface that shows 3D media by defining a media URL that shows side-by-side 3D. The 3D texture is only properly visible in VR mode, and the 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:
    • - "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 right image is meant for the right eye.
    • 2 - "Cross-eyed" orientation, where the left image is meant for the left eye and the right image is meant for the left eye.
    • 3 - Orientation where the bottom image is meant for the left eye and the top image is meant for the right eye.
  • Standard + Transparent - Only accepts an albedo map, UV scale, and tint inputs. 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.

Applying maps

Applying_maps.png
Choose one of the object's existing texture maps or click the Browse button to choose one from your computer.

For each kind of map supported by a shader, you may choose any of the object's existing textures from the dropdown, or choose Custom Texture File. If you choose a custom texture, click Browse to choose a suitable texture from your computer to use as the map.

Tips

Here are a few tips to help you get the most out of materials and shaders:

  • The maximum texture resolution is 4096 x 4096 pixels. 
  • When in doubt, use the simplest shader you can. If you don't need an alpha mask, don't use a shader with that feature. The Standard shader is the fastest, most efficient shader available.
  • Sansar uses a custom physically based renderer (PBR) and doesn't use specular maps. However, Sansar does use roughness and metalness maps to define the specular highlights of an object.
  • When applying maps on an object that is already in the scene, a preview of the result is shown on the object in the scene. If you choose to cancel your changes, the object reverts back to its previous maps.

Known changes

  • As of July 18th, 2018, the Tint attribute, which affects the color of a surface, now affects emissive surfaces. Previously, Tint attribute only affected non-emissive surfaces. This means that emissive textures (e.g. a light bulb) can now be colored via “Tint”. However, these changes may affect existing content where the Tint value had been changed from the default value. 
Was this article helpful?
31 out of 38 found this helpful
Have more questions? Submit a request

0 Comments

Article is closed for comments.