File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -273,6 +273,18 @@ public static partial class mathx
273273 /// <inheritdoc cref="bitwave(float4)" />
274274 [ MethodImpl ( IL ) ] public static float bitwave ( float x ) => floor ( math . fmod ( x , 2 ) ) ;
275275 #endregion
276+
277+ #region bitwave
278+
279+ /// <summary> Samples a square wave that goes between 0 and 1. </summary>
280+ [ MethodImpl ( IL ) ] public static float4 bitwave2 ( float4 x ) => ( int4 ) x & 1 ;
281+ /// <inheritdoc cref="bitwave2(float4)" />
282+ [ MethodImpl ( IL ) ] public static float3 bitwave2 ( float3 x ) => ( int3 ) x & 1 ;
283+ /// <inheritdoc cref="bitwave2(float4)" />
284+ [ MethodImpl ( IL ) ] public static float2 bitwave2 ( float2 x ) => ( int2 ) x & 1 ;
285+ /// <inheritdoc cref="bitwave2(float4)" />
286+ [ MethodImpl ( IL ) ] public static float bitwave2 ( float x ) => ( int ) x & 1 ;
287+ #endregion
276288
277289 #region triwave
278290 /// <summary> Samples a triangle wave between +0.5f and -0.5f. </summary>
You can’t perform that action at this time.
0 commit comments