Skip to content
TheChatArchiveThe Chat Archive
Qwenqwen3-30b-a3b· Alibaba (Qwen)Hugging Face LMArena Human Preference 140K

please make a shadertoy shader that displays a red spiral that slow forms at the cursors…

From a Chatbot Arena battleThe same person sent this prompt to two anonymous models at once. Compare it with Qwenqwen3-235b-a22b’s answer.
  1. User

    please make a shadertoy shader that displays a red spiral that slow forms at the cursors position every 5 seconds

  2. Qwen Assistant

    Here's a Shadertoy shader that creates a red spiral that slowly forms at the cursor's position every 5 seconds. The spiral grows outward from the mouse location over time, resetting every 5 seconds.

    void mainImage(out vec4 fragColor, in vec2 fragCoord) {
        // Normalize coordinates
        vec2 uv = fragCoord / iResolution.xy;
        
        // Mouse position in screen coordinates
        vec2 mouse = iMouse.xy;
        
        // Calculate vector from mouse to current pixel
        vec2 pos = uv * iResolution.xy;
        vec2 dx = pos - mouse;
        float r = length(dx);
        float theta = atan(dx.y, dx.x);
        
        // Time within the 5-second cycle
        float t = mod(iTime, 5.0);
        
        // Spiral parameter: r = theta * t / 5.0
        float spiralParam = theta * t / 5.0;
        float diff = r - spiralParam;
        
        // Create a thin red line around the spiral path
        float alpha = smoothstep(0.0, 0.1, abs(diff));
        
        // Output red color with alpha
        fragColor = vec4(vec3(1.0, 0.0, 0.0) * alpha, 1.0);
    }
    

    How It Works:

    1. Mouse Position: The cursor's position (iMouse.xy) is used as the center of the spiral.
    2. Polar Coordinates: For each pixel, the distance (r) and angle (theta) from the mouse are calculated.
    3. Spiral Equation: The spiral is defined by r = theta * t / 5.0, where t is the time within the 5-second cycle. As t increases, the spiral expands outward.
    4. Visualizing the Spiral: The difference between the actual radius (r) and the spiral's expected radius (spiralParam) is used to determine how close the pixel is to the spiral path. A smoothstep function creates a thin red line around the spiral.

    Customization:

    • Thickness: Adjust the 0.1 in smoothstep(0.0, 0.1, ...) to make the spiral thicker or thinner.
    • Speed: Modify the t / 5.0 factor to control how quickly the spiral forms.
    • Appearance: Replace smoothstep with other functions (e.g., sin, abs) for different visual effects.

    This shader will reset the spiral every 5 seconds, creating a continuous loop of forming spirals at the cursor's location.

Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.