docs.unity3d.com
    Show / Hide Table of Contents

    Sample Attribute Map

    Menu Path : Operator > Sampling > Attribute Map

    The Sample Attribute Map Operator enables you to sample an attribute map from a Point Cache.

    This Operator takes an attribute map and an index and outputs the value of the attribute at the index. This Operator also takes the number of points in the Point Cache. Warning: This Operator requires the number of points to work. If you don't input the number of points, or input an incorrect value, this Operator doesn't sample the attribute map correctly.

    Depending on the attribute map, the output attribute value type changes. You must explicitly specify the output type for this Operator or it produces undefined behavior. For information on how to do this, see Operator configuration.

    Operator settings

    Input Description
    Mode The wrap mode to use if the value of Index is out of range for the Map. The options are:
    • Clamp: Clamps the index between the first and last index of the Map.
    • Wrap: Wraps the index around to the other side of the Map.
    • Mirror: Mirrors the vertex list so out of range indices move back and forth through the Map.

    Operator properties

    Input Type Description
    Point Count uint The number of points present in the Point Cache
    Map Texture2D The attribute map that contains a field of the Point Cache. For example, the positions of each point.
    Index uint The index of the point to sample.
    Output Type Description
    Sample Configurable The content of the attribute map of the point specified by the input Index.
    Warning: You must explicitly specify the Type for this property so that it matches the type stored in the attribute map. For information on how to do this, see Operator configuration.

    Operator configuration

    To view this Operator’s configuration, click the cog icon in the Operator’s header. You can choose a type for the output from the Available Types.

    Available types

    You can use the following types for your input ports:

    • bool,
    • uint,
    • int,
    • float,
    • Vector2,
    • Vector3,
    • Vector4
    In This Article
    • Operator configuration
      • Available types
    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023