Sansar Docs
  • 🚀Welcome to Sansar
  • 📚GLOSSARY
  • 🎏Patch Notes
  • 😇Work in Progress
  • ⚠️Creative Commons License
  • Support
    • General Troubleshooting
      • General FAQ
      • The Sansar Cache
      • The Sansar Log
    • Contact Support
  • Sansar Basics
    • Installation And Compatibility
      • Installing Sansar
      • System Requirements
      • Sansar Compatibility FAQ
      • Sansar on Mac
      • Body Tracking Vive
      • Configuring Firewalls
    • Account Management
      • Account Set Up
      • Avatar Name and ID
      • Adding Payment Method
      • Discord FAQ
      • Steam Integration
      • Subscription FAQ
    • Controls
      • Avatar Hand Gestures in VR
      • FreeCam and CineCam
      • Game Controller Buttons
      • HTC VIVE controls
      • Keyboard Shortcuts for Editing a Scene
      • Keyboard Shortcuts for Styling Your Avatar
      • Keyboard Shortcuts for Visiting an Experience
      • Mouselook Mode
      • Oculus Rift Controls
      • Vive Index Controls
    • Settings
      • General Settings
    • VR Settings
      • VR Settings Menu
      • Calibrating Height in VR
  • Exploring in Sansar
    • Navigate and Explore
      • The Codex
      • Instances
      • Interactive objects
      • The Main Menu
      • The Nexus
      • Portals
      • Quests
      • Quick Start: Exploring in Sansar
    • Socialize And Connect
      • Chat Panel
      • Experience Points, Levels, and Titles.
      • Finding People in Sansar
      • Identifying Interacting With Avatars
      • The People panel
      • User profiles
    • Attending events
      • Deploying Unpublished Event to Event World
      • Adding Events to Your Calendar
      • Attending Events in Sansar
      • Avatar Broadcasting FAQ
      • Creating Your Own Events
      • Redemption Codes
      • Tipping
    • Share Content
      • Streaming Sansar
      • Taking a photo
  • Avatar Creation
    • Avatar Basics
      • Avatar 2.0 FAQ
      • Customizing Your Avatar
      • Avatar Emotes
      • The Avatar Editor
    • Dressing The Avatar
      • Fitting Designer Clothing to your Avatar
      • Setting Custom Emotes
      • Wearing Accessories
      • Wearing Rigged Clothing
    • Managing Avatar Items
      • Importing Avatar-Related Items
      • Editing an inventory item's name
      • Editing an inventory item's image
      • Deleting avatar looks from your inventory
      • Importing a custom emote animation
      • Managing your avatar looks inventory items
    • Avatar Resources
      • Avatar Reference Files
      • Blender - Avatar files
      • Blender - Using Decimate Tool
      • Exporting Custom Avatars From Blender
      • Sansar Skeleton Skinning Details
      • Using Animation Skeleton
  • Creating In Sansar
    • Importing Things to Sansar
      • Supported file types
      • AABB Bounding Box and Item Restrictions
      • Importing Audio
      • Importing a Custom Avatar
      • Importing World Items
      • Importing Collision Volumes
      • Importing Accessories
      • Importing Clothing
      • Importing Emotes
      • Importing Hair
      • Importing Custom Scripts
      • Importing a Skybox
      • Troubleshooting Import Errors
    • Shaders and Materials
      • Shaders Information
      • Materials Information
      • VAT Shader Guides
        • VAT Shader Basics
        • VAT Technical Info
      • Displacement Guides
        • Simple Displacement
        • Advanced Displacement
    • Marvelous Designer Info
      • Marvelous Designer Integration
      • Marvelous Designer Creator Resources
      • Marvelous Import and Export
      • MD Limitations
    • Shader Scripting
    • Materials editing and shaders
    • Creator Tools
      • Creating a World
      • Creating Quests
      • Diagnostics Toolbar
      • Importing Items to Sansar
      • My Worlds Panel
    • Managing Worlds
      • Quick start: Creating experiences in Sansar
      • Deleting an experience or scene
      • Deploying a new scene to an existing experience
      • Editing a scene
      • Experience memos
      • Linking A Scene To A World
      • Managing your scenes and worlds
      • Moderation Tools for World Owners
      • Publishing Options for Your Experiences
      • Renaming a scene
      • Saving and Building A Scene
      • Sharing Your Experiences
      • Visiting your own experience
    • Part Of The World Editor
      • Object Stats Toolbar
      • Object Components
      • Parenting objects
      • Scene Item Inventory
      • Scene Objects Panel
      • Collision Volumes
      • Scene Settings
      • System objects
      • Object Motion Types
    • Working With Scripts
      • Working With Scripts
      • Working With Trigger Volume
      • Referencing Scene Components
      • Intro to Scripting in Sansar
      • Using the Script Console
      • Setting Script Parameters
      • Adding Scripts to an Object
      • Configuring Teleport Scripts
      • Simple Script User Guide
    • Working With Audio and Video
      • Working With Audio
      • Creating Media surface
      • Streaming Web Audio
      • Audio Emitter
      • Sansar Audio FAQ
      • Using Media Streams
      • Ambisonic Sounds
      • High Quality Spacial Audio
      • Audio Resource - Room Tones
      • Previewing Audio and Video in a Scene
      • Using Audio Materials
    • Working With Lights
      • Working With Lights
      • Light Types
      • Global Illumination
  • Sansar Store
    • Using the Sansar Store
      • The Sansar Store
      • Buying Items From The Store
      • Redelivering Lost Purchases
    • Buying and Selling Sansar Dollars
      • Gifting Sansar Dollars
      • Buying Sansar Dollars
      • Converting Sansar Dollars
      • Processing US Dollar Credit
    • Selling Your Content
      • Hidden Store Listings
      • Selling Items in Sansar Store
      • Selling Items in an Experience
      • Allowing Resale Of Items
      • Buyers Permissions
  • Guidelines and Moderation
    • Guidelines and Policies
      • Terms of service
      • Sansar's Discord Server Rules
      • Community Standards
      • Content Guidelines
      • World Publishing Guidelines
      • Store Listing Guidelines
      • Store Banner Guidelines
      • Event Guidelines
      • Privacy Policy
      • Sansar Freeware License Agreement
      • Intellectual Property Infringement Notification
      • Cookie Policy
    • Moderation and Reporting
      • Abuse and Griefing
      • Blocking Avatars
      • Muting Avatars
      • Reporting abuse
      • Reporting issues and bugs
      • Security issues
  • Script API Docs
    • General Information
      • External Script Repository's
      • Sansar Script API
      • Script API Updates
      • Restricted API's
    • Example Scripts
      • Example Scripts in Sansar
      • Cannonball
      • Follow The Path
      • Random Movement
      • Reflective Detector
      • Simple Script
      • Sound Randomizer
      • Stats Example
      • Teleport Hotkeys
      • Visitor Tracker
      • Mover Examples
    • Sansar Namespace
      • Namespace
      • Color
      • Mathf
      • Quarterion
      • Vector
      • Vector Extensions
    • Sansar.Script Namespace
      • AddEntryAttribute
      • CancelData
      • ComponentID
      • CoroutineException
      • Default Attributes
      • Editor Visible Attribute
      • Entries Attribute
      • Event Data
      • ICoroutine
      • IEvent Subscription
      • Instance Interface
      • Locked Attribute
      • Log
      • MaxEntriesAttribute
      • Memory
      • MinEntriesAttribute
      • NonReflectiveAttribute
      • ObjectID
      • OperationCompleteEvent
      • RangeAttribute
      • Reflective
      • Script.Base
      • Script Event Data
      • Script Handle
      • ScriptID
      • SessionID
      • Simple Script Event Data
      • ThrottleException
      • Timer
      • Tooltip Attribute
    • MetaData Namespace
      • Assembly MetaData
      • Script MetaData
    • Sansar Script Testing Namespace
      • Assertion Failure Exception
      • Assertions
    • Sansar Utility Namespace
      • GenericEnumerable <T>
      • GenericEnumerable<T>.GetItem
      • JSON Serialization Data
      • JSON Serialization Data 1
      • JSON Serializer
      • JSON Serializer Options
    • Sansar Simulation Namespace
      • Agent Info
      • Animation
      • Audio Component
      • Camera Control Mode
      • Character Tracker
      • Chat
      • Client
      • Cluster
      • Command Action and Data
      • Component Type
      • Control Point Type
      • Held Object
      • HTTP
      • Interaction
      • Light
      • Media Action
      • Mesh Component
      • Modal Dialogue
      • Move Mode and Mover
      • Objective
      • PlayHandle
      • PlaySettings
      • PlayStatus
      • Quest
      • RayCastHit
      • Rigid Body
      • Scene
      • Scene Public
      • Simple Script
      • Sit Event Type
      • Sit Object Data
      • Sound Resource
      • Stream Channel
      • Tutorial Hint
      • UI
      • User Data
Powered by GitBook
On this page
  • What are VATs?
  • Sansar VAT Tool
  • Using the Tool
  • VAT Limits
  • Creating VAT Animated Assets
  • Non-Vertex-Based Keyframed Animations
  1. Creating In Sansar
  2. Shaders and Materials
  3. VAT Shader Guides

VAT Shader Basics

PreviousVAT Shader GuidesNextVAT Technical Info

Last updated 1 month ago

What are VATs?

A VAT (Vertex Animation Texture) is a shader and texture map combo technique used in 3D graphics to achieve efficient vertex animation without the use of bones. It's particularly useful for complex or deformable objects and animations that would otherwise require too many bones to be efficient.

The VAT shader requires access to the object's source file to create the required textures. This contrasts with the Displacement shader, where it’s possible to create maps by understanding the UV layout of an asset.

NOTES:

  • VAT only affects the appearance of the visual mesh and not its collision.

  • Sansar VATs are implemented differently from those in other external engines. A tool is available for most users (details below), while advanced users can see for more.

  • The VAT shader requires the creator to have access to the object's source file to generate the necessary textures, as it relies on a secondary UV map to control animation. In contrast, the Displacement shader can work with maps created by understanding the UV layout of an asset, even without access to the source file. The advantage of the VAT shader is that its color maps are separate from the animation maps.

  • VAT maps are not considered human-editable. While technically possible to edit them, it is not straightforward.


Sansar VAT Tool

A Blender addon has been created to assist in making VAT assets. to download the free tool for Blender 3.4 and above. The tool is untested on earlier versions.

Using the Tool

After downloading the latest release of the tool, install it in Blender like any other addon. (User Preferences -> Addons -> Install from File) and then select the .zip file.

Once installed, you should see the Sansar Tools addon in the sidebar.

  • Frame Range: Specify the first and last frame for export, as well as the frame step size. A smaller step size captures more frames of animation. Sansar includes some interpolation between frames.

  • Generate Mesh: If checked, the mesh to be uploaded to Sansar is generated along with the displacement and normal maps. If unchecked, only the textures are generated.

  • Encode Map as Z-Curve: If checked, the generated images store the data in Z-order (Morton Code), which optimizes caching inside Sansar. Additionally, the first pixel encodes the number of vertices and frames. This option is required for generating Sansar assets. If disabled, the images store the data such that the vertices are columns and the frames are rows, making them compatible with other engines.

  • Export Files: Exports both images and the mesh (if generated) to the specified path and filename prefix.


VAT Limits

Constraints on Vertices and Frames

The maximum number of vertices and frames is limited by two factors:

  1. Precision of Encoding: This independently limits the number of vertices and frames.

  2. Available Pixels in an 8K Texture: This limits the product of the number of vertices multiplied by the number of frames.

Exact Limits:

  • Maximum number of vertices: 16,773,120 (after split normals).

  • Maximum number of frames: 4,096.

  • Maximum product of vertices and frames: 67,108,863.

Example:

  • If you want 4,096 frames, the number of vertices must be limited to 16,383.

  • Halving the number of frames allows you to double the number of vertices, continuing this trade-off up to the maximum allowed vertices.

  • 4,096 pixels are used for encoding, so factor this into your calculations.


Creating VAT Animated Assets

This is a basic guide to creating VAT assets. The Blender tool converts keyframed animation into a usable mesh and texture set for Sansar VAT. All objects will be combined into a single mesh with the tool, so ensure individual objects are scaled and transforms are applied.

  • Your objects need a clean UV layout to create a VAT map. Ensure no overlapping vertices before creating the VAT UV. Once done, you can modify UV Map 1 as needed.

  • Animate your object using any method (shape keys, bones, vertex-based animation with Blender’s AnimAll addon, object animation, etc.).

  • Ensure your UV unwrap has no overlapping vertices (e.g., from mirroring).

  • After finalizing your keyframes, select your objects, set the frame Start, End, and step rate in the Sansar addon.

  • Choose the export path and filename prefix, then click the process button. The tool will create the mesh and textures required for import into Sansar.

  • The generated mesh is essential for Sansar VAT and must be used as your import model.

In Sansar:

  1. Import the VAT Mesh files.

  2. Set up the shader using the provided VatMap and VatNormals.

  3. Adjust the step rate in the editor to see the animation. There is a chance you may need to save the material to see this correctly and allow the processing of the texture to complete.

  4. Add other material maps (albedo, roughness, etc.) and save.


Non-Vertex-Based Keyframed Animations

For animations not inherently keyframed (e.g., cloth simulations), use workarounds like Point Cache .mdd import/export or Blender's Bake to Keyframes modifier. These methods generate usable keyframes.

Steps:

  1. Apply the scale, location, and rotation to the object (Ctrl-A).

  2. In User Preferences -> Add-ons, enable:

    • Import/Export NewTek MDD Format

  3. Export your animation using File -> Export -> Lightwave Point Cache (.mdd).

  4. Delete unsupported modifiers (e.g., Cloth Sim in Physics).

  5. Re-import the .mdd file (File -> Import -> Lightwave Point Cache).

The object will now have keyframes and shape keys, making it compatible with the VAT tool.

VAT Technical Info
CLICK HERE