/*
====================================================================================================

    Copyright (C) 2025 Pyvtron VX Shaders - Pyvton

    All Rights Reserved unless otherwise explicitly stated.

    Before You Do Something With Pyvtron VX Shaders, You MUST Read This:

    You Must Read The License: https://pyvton.pages.dev/minecraft-shaders/pyvtron-shaders-license
    And Read The Agreement: https://pyvton.pages.dev/minecraft-shaders/pyvtron-shaders-agreement

====================================================================================================
*/


vec3 RGBcircling(float time, float phaseDiff, float rndfactor, float speed)
{
	time *= speed;
	time += phaseDiff * 3.0 * rndfactor;

	float timeR = clamp(abs(mod(time, phaseDiff * 3.0) - phaseDiff * 1.5), 0.0, 180.0);
	float timeG = clamp(abs(mod(time + phaseDiff, phaseDiff * 3.0) - phaseDiff * 1.5), 0.0, 180.0);
	float timeB = clamp(abs(mod(time + phaseDiff * 2.0, phaseDiff * 3.0) - phaseDiff * 1.5), 0.0, 180.0);

	vec3 RGB = vec3(cos(radians(timeR)), cos(radians(timeG)), cos(radians(timeB)));

	return RGB * 0.5 + 0.5;
}
