Shadertoy iMouse Problem

Hello everyone
I converted this shader from the shadertoy site
It works fine on the site
But after conversion, a problem occurs
On the shadertoy site, when the mouse button is pressed and the mouse is moved, the line is drawn correctly
But in TouchDesigner, when the mouse button is pressed and the mouse is moved
The mouse movement path is not drawn, it just draws a straight line from the origin coordinates to the destination coordinates
I think the problem is in bufferD, where the mouse path should be stored, but I don’t know how to solve this problem
Thank you for your help.

Liquid Light_091450.zip (15.2 KB)

Hi,

Can you please link to the original shadertoy implementation?

Thanks

Yes sure

This is interesting, for some reason the project doesn’t load for me on Shadertoy.

Regardless, I see that you tried to solicit help from the developer there as well. I looked briefly at the TD project and it seems like you’re on the right track. The issue is that you’re using the position of the mouse when the button was first pressed down to compute the ‘previous mouse position’ property. This seems like something that would want to be evaluated from one frame to the next. The most straightforward way to get this would be to pass your mouse CHOP data through a delay CHOP set to a 1-2 frame delay.

Thanks for your help
I fixed that problem
I had to add two more buffers to that shader
One is the mouse_state shader and the other is the mouse_history shader
This fixed the problem