Convertion of shaders based on reaction diffusion

Hello. I’ve had a lot of free time lately because of quarantine in my city, so i was having fun with converting shaders to TD, and I’m getting consistently good results with anything but shaders based on reaction diffusion.
For example, Shader - Shadertoy BETA
No errors during shader compilation, and here’s the result i get


Here’s the project file shader_ViscousFingering_ by_Cornusammonis.toe (5.3 KB)

As you can see, instead of a beautiful reaction diffusion there is this weird motion from bottom left to top right of the screen. Similar stuff happens with other shaders based on that effect. Is there any solution to this?

Hey,

This was more of a hunch but first I changed the Pixel Format of the Noise TOP on the common page to 32 bit. With the direction going from the bottom left to the top right, I then assumed this has to have something to do with the noise values, so I changed the Offset parameter of the Noise from 0.5 to 0 which changes the value range from 0 - 1 to -0.5 - 0.5

The Noise Type parameter I switched to a Random (GPU) and toggled off the Monochrome parameter to get a colored noise. Further I’m using the same noise1 as the initial input to the Feedback and the Glsl TOP.

On the GLSL TOP, I changed the Input Extend Mode UV parameter to Repeat to avoid the effects around the edges of the image.

FInally, but this is not necessary, just good to know, I went into the shader:

// vec2 vUv = fragCoord.xy / iResolution.xy; ==> this is predefined as vUV.st in TouchDesigner so a texture lookup would be:
// vec3 uv =    texture(iChannel0, vUV.st).xyz;

//  the "size" of a pixel can be retrieved in TouchDesigner via the uTD2DInfos array
// vec2 texel = 1. / iResolution.xy; 
vec2 texel = uTD2DInfos[0].res.xy

so in the end you don’t need the iResolution uniform.

You probably have seen this page already, but a good overview of GLSL TOPs can be found here and specifics on the Info arrays under the Build In Uniforms section.

Hope this helps
Cheers
Markus

2 Likes

It worked, thank you so much! I’ll definitely check the links.