Simple Displacement
Last updated
Last updated
These example textures provided below can be used for any purpose and in any combination for static and animated displacement within Sansars material editor.
The simple displacement in Sansar uses "Red, Green, Blue, White and Black" or "RGB" to define each direction of vertices on mesh in 3D space, if using PNG textures you can only displace in a Positive direction, if you wish to utilise negative direction you will need to create EXR maps, covered more in Advanced Displacement.
Displacement is influenced by the UV layout of a model. When applying displacement to items from the store for which you don't have access to the original files, the outcome may differ due to the significance of the model's UV layout and export settings.
This is a texture map that the shader reads the color information to determine the displacement strength and direction of the corresponding vertex.
Red = X axis direction
Green = Y axis direction
Blue = Z axis direction
White = All directions in the positive
Black = No displacement
Think of this as a mask slot or as a 'strength'
functional as a greyscale mask, black being full strength and white being no displacement, this is the opposite to how other masks work within the shaders.
Avatar items are able to utilise the new displacement to create animated clothing and accessories, it is recommended to create a test within a edit world scene to be able to see what settings are required.
While in world edit:
Open the Materials edit window
Right click the object you want to add displacement to.
You should see a pop-up menu appear, choose "Materials..." alternately you can use the short-cut "Ctrl + M" while your object is selected.
Choose the shader and locate the map slots
Select the shader you would like to use in the top right drop down menu.
Make sure the shader you are using supports the displacement you require (static or animated) by scrolling down to see if it has the right texture map slots or checking the Shader info page.
You are looking for the Displacement Map and Displacement Factor slots.
See "Texture Settings" screenshot that is also provided in the folder for reference.
Add Texture Maps to the Displacement Map and Factor slots.
Add any texture you like from the provided folder into the "Displacement Map" slot to see your object displace, you can also create your own!
White in this Displacement Map slot acts as full strength, while black acts as zero strength.
The displacement may initially be quite strong and distorted but can be adjusted further down the shader under "Displacement Scale" or with a factor map.
Optionally you can use the second slot "Displacement Factor" as a simple black and white mask.
Black by default in this Displacement Factor slot acts as full strength, while White acts as zero strength, the inverse to the Displacement Map menu.
Example: The gradient textures included in this pack will go from white (masked out) to black (full strength displacement)
All values in between black and white act as a sliding scale between the two values which determine the level of displacement strength.
Tweak and adjust displacement settings
Scroll down until you see "Displacement Scale" input boxes
This is where you can have greater control over the strength and turn on or off each direction, you can use these to compensate for a model rotation set by export.
To turn off a direction, type in 0 when using black and white texture maps.
I recommend trying values like 0.5 or 0.05 to get more subtle or toned down results.
Choose between Local or UV Tangent space
Displacement is defined by Local and Tangent Space for its direction, Local space is determined by the models export setting (this can differ from the editor Gizmo). UV Tangent Space is determined by the face direction of the mesh.
Scroll down and find the "Displacement in LocalSpace" tick box, you toggle this on and off to see which result is preferable for your needs as it affects what direction the mesh is being displaced.
Choose additional settings
If using an animated shader the Factor and Map can also be animated either together or one or the other instead of remaining static this can be used to create interesting effects like bubbling water, flowing grass or leaves, waving flags, etc.
For simple UV scrolling displacement animations, you can scroll the Map and Factor like other maps in sansar to achieve animated effects. "TextureSettings2" screenshot has also been provided in the folder for future reference.
It is possible to use Flipbook sprite sheets to create an animated displacement that can be used to create more advanced looking assets, even mimicking particles, you need to create a sprite map of 'keyframed' displacement that you can use the regular flipbook settings to change between.
A new 'Blend Displacement Flipbook' checkbox has been added that interpolates between frames creating a smoother animation