Square Wave | Visual Effect Graph | 10.2.2
image/svg+xml
docs.unity3d.com
  • Manual
  • Scripting API
  • Changelog
  • License
    Show / Hide Table of Contents
    • Visual Effect Graph
    • Requirements
    • Getting Started
      • Visual Effect Graph Assets
      • Visual Effect Graph Window
    • Graph Logic & Philosophy
      • Systems
      • Contexts
      • Blocks
      • Operators
      • Properties
      • Events
      • Attributes
      • Subgraph
      • Blackboard
      • Sticky Notes
      • Project Settings
      • Preferences
    • The Visual Effect Component
      • C# Component API
      • Using Visual Effects with Timeline
      • Property Binders
      • Event Binders
      • Output Event Handlers
    • Pipeline Tools
      • Exposed​Property Helper
      • Vector Fields
      • Point Caches
      • Point Cache Bake Tool
      • Spawner Callbacks
      • Mesh Sampling
    • Node Library
      • Context
        • Event
        • GPU Event
        • Initialize Particle
        • Output Mesh
        • Output Distortion
        • Output Decal
        • Output Line
        • Output Particle Mesh
        • Output Point
        • Output Primitive
        • Shared Output Settings
          • Global Settings
          • Lit Output Settings
        • Spawn
        • Update Particle
        • Block
          • Attribute
            • Curve
            • Derived
              • Calculate Mass from Volume
            • Map
            • Set
          • Collision
            • Collide with AABox
            • Collide with Cylinder
            • Collide with Depth Buffer
            • Collide with Plane
            • Collide with Signed Distance Field
            • Collide with Sphere
          • Flipbook
            • Flipbook Player
          • Force
            • Conform to Signed Distance Field
            • Conform to Sphere
            • Force
            • Gravity
            • Linear Drag
            • Turbulence
            • Vector Force Field
          • GPU Event
            • Trigger Event Always
            • Trigger Event On Die
            • Trigger Event Rate
          • Implicit
            • Integration : Update Position
            • Integration : Update Rotation
          • Kill
            • Kill (AABox.​md)
            • Kill (Sphere.​md)
          • Orientation
            • Connect Target
            • Orient
          • Output
            • Camera Fade
            • Subpixel Anti-Aliasing
          • Position
            • Set Position (Depth.​md)
            • Set Position (Shape : AABox.​md)
            • Set Position (Shape : Circle.​md)
            • Set Position (Shape : Cone.​md)
            • Set Position (Shape : Cone.​md)
            • Set Position (Shape : Sphere.​md)
            • Set Position (Sequential.​md)
            • Tile/Warp Positions
          • Size
            • Screen Space Size
          • Spawn
            • Constant Spawn Rate
            • Periodic Burst
            • Single Burst
            • Variable Spawn Rate
            • Attribute
              • Set Spawn Event \<attribute>
            • Custom
              • Increment Strip Index On Start
              • Set Spawn Time
              • Spawn Over Distance
          • Velocity
            • Velocity from Direction & Speed (Change Speed.​md)
            • Velocity from Direction & Speed (New Direction.​md)
            • Velocity from Direction & Speed (Random Direction.​md)
            • Velocity from Direction & Speed (Spherical.​md)
            • Velocity from Direction & Speed (Tangent.​md)
      • Operator
        • Attribute
          • Age Over Lifetime
          • Get Attribute: age
          • Get Attribute: alive
          • Get Attribute: alpha
          • Get Attribute: angle
          • Get Attribute: angular​Velocity
          • Get Attribute: axis​X
          • Get Attribute: axis​Y
          • Get Attribute: axis​Z
          • Get Attribute: color
          • Get Attribute: direction
          • Get Attribute: lifetime
          • Get Attribute: mass
          • Get Attribute: old​Position
          • Get Attribute: particle​Count​In​Strip
          • Get Attribute: particle​Id
          • Get Attribute: particle​Index​In​Strip
          • Get Attribute: pivot
          • Get Attribute: position
          • Get Attribute: scale
          • Get Attribute: seed
          • Get Attribute: size
          • Get Attribute: spawn​Index
          • Get Attribute: spawn​Time
          • Get Attribute: strip​Index
          • Get Attribute: target​Position
          • Get Attribute: tex​Index
          • Get Attribute: velocity
          • Get Custom Attribute
        • Bitwise
          • And
          • Complement
          • Left Shift
          • Or
          • Right Shift
          • Xor
        • Builtin
          • Delta Time
          • Frame Index
          • Local to World
          • Main Camera
          • System Seed
          • Total Time
          • World to Local
        • Camera
          • Viewport to World Point
          • World to Viewport Point
        • Color
          • Color Luma
          • HSV to RGB
          • RBG to HSV
        • Inline
          • AABox
          • Animation​Curve
          • Arc​Circle
          • Arc​Cone
          • Arc​Sphere
          • Arc​Torus
          • bool
          • Camera
          • Circle
          • Color
          • Cone
          • Cubemap
          • Cubemap​Array
          • Cylinder
          • Direction
          • Flip​Book
          • float
          • Gradient
          • int
          • Line
          • Matrix4x4
          • Mesh
          • Oriented​Box
          • Plane
          • Position
          • Sphere
          • Terrain​Type
          • Texture2D
          • Texture2DArray
          • Texture3D
          • Torus
          • Transform
          • uint
          • Vector
          • Vector2
          • Vector3
          • Vector4
        • Logic
          • And
          • Branch
          • Compare
          • Nand
          • Nor
          • Not
          • Or
          • Probability Sampling
          • Switch
        • Math
          • Arithmetic
            • Absolute
            • Add
            • Divide
            • Fractional
            • Inverse Lerp
            • Lerp
            • Modulo
            • Multiply
            • Negate
            • One Minus
            • Power
            • Reciprocal
            • Sign
            • Smoothstep
            • Square Root
            • Step
            • Subtract
          • Clamp
            • Ceiling
            • Clamp
            • Discretize
            • Floor
            • Maximum
            • Minimum
            • Round
            • Saturate
          • Constants
            • Epsilon
            • Pi
          • Coordinates
            • Polar to Rectangular
            • Rectangular to Polar
            • Rectangular to Spherical
            • Spherical to Rectangular
          • Exp
            • Exp
          • Geometry
            • Area (Circle.​md)
            • Change Space
            • Distance (Line.​md)
            • Distance (Plane.​md)
            • Distance (Sphere.​md)
            • Invert​TRS (Matrix.​md)
            • Transform (Direction.​md)
            • Transform (Matrix.​md)
            • Transform (Position.​md)
            • Transform (Vector.​md)
            • Transform (Vector4.​md)
            • Transpose (Matrix.​md)
            • Volume (Axis Aligned Box.​md)
            • Volume (Cone.​md)
            • Volume (Cylinder.​md)
            • Volume (Oriented Box.​md)
            • Volume (Sphere.​md)
            • Volume (Torus.​md)
          • Log
            • Log
          • Remap
            • Remap
            • Remap [0..​1] => [-1..​1]
            • Remap [-1..​1] => [0..​1]
          • Trigonometry
            • Acos
            • Asin
            • Atan
            • Atan2
            • Cosine
            • Sine
            • Tangent
          • Vector
            • Append Vector
            • Construct Matrix
            • Cross Product
            • Distance
            • Dot Product
            • Length
            • Look At
            • Normalize
            • Rotate 2D
            • Rotate 3D
            • Sample Bezier
            • Squared Distance
            • Squared Length
            • Swizzle
          • Wave
            • Sawtooth Wave
            • Sine Wave
            • Square Wave
            • Triangle Wave
        • Noise
          • Cellular Curl Noise
          • Cellular Noise
          • Perlin Curl Noise
          • Perlin Noise
          • Value Curl Noise
          • Value Noise
        • Random
          • Random Number
        • Sampling
          • Get Texture Dimensions
          • Load Texture2D
          • Load Texture2DArray
          • Load Texture3D
          • Position (Depth.​md)
          • Sample Curve
          • Sample Gradient
          • Sample Signed Distance Field
          • Sample Texture2D
          • Sample Texture2DArray
          • Sample Texture3D
          • Sample Texture​Cube
          • Sample Texture​Cube​Array
        • Utility
          • Point Cache
    • Reference
      • Standard Attributes
      • Types
        • AABox
        • Arc​Circle
        • Arc​Cone
        • Arc​Sphere
        • Arc​Torus
        • Camera
        • Circle
        • Cone
        • Cylinder
        • Direction
        • Line
        • Oriented​Box
        • Plane
        • Position
        • Sphere
        • Terrain​Type
        • Torus
        • Transform
        • Vector
    • Manual
    • Node Library
    • Operator
    • Math
    • Wave
    • Square Wave

    Square Wave

    Menu Path : Operator > Math > Wave > Square Wave

    The Square Wave Operator allows you to generate a value which alternates between a minimum and a maximum value at steady intervals based on a provided input and a set frequency.

    If Frequency is set to 1, the blue dot remains at Min with an Input value from 0 to almost 0.5. Then, with an Input value from 0.5 to almost 1, the dot remains at Max. After that, the wave repeats.

    You can use this Operator to instantaneously switch between two values at a steady rate. This can be useful if you want to periodically toggle a behavior on and off. For example, if you want to apply a force at steady intervals.

    Operator properties

    Input Type Description
    Input Configurable The value this Operator evaluates to generate the output value.
    Frequency Configurable The rate at which the Input value switches between Min and Max. Larger values make the wave repeat itself more.
    Min Configurable The minimum value that Out can be.
    Max Configurable The maximum value that Out can be.
    Output Type Description
    Out Matches Input The value this Operator generates between Min and Max based the Input and Frequency.

    Operator configuration

    To view the Operator's configuration, click the cog icon in the Operator's header.

    Property Description
    Input The value type for the Input port. For the list of types this property supports, see Available types.
    Frequency The value type for the Frequency port. For the list of types this property supports, see Available types.
    Min The value type for the Min port. For the list of types this property supports, see Available types.
    Max The value type for the Max Port. For the list of types this property supports, see Available types.

    Available types

    You can use the following types for your Input, Min, and Max ports:

    • float
    • Vector
    • Vector2
    • Vector3
    • Vector4
    • Position
    • Direction
    In This Article
    • Operator properties
    • 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