Update ShaderToy node to use new ShaderToy syntax

Can we have it so that the old (current) syntax also is valid ?

Yeah, it would be good if we could auto-detect the syntax. Otherwise people would be confused and older compositions would break.

How is this coming along? I’ve tried using various Fragment Shader from the Shadertoy website (editing them with the workaround), but without success: I always end up with a black screen. Thanks.

The workaround should include:

Change iTime to iGlobalTime  

Here’s a fragment that I can’t make work, even with the edits:

// Gold Noise

precision lowp    float;

float PHI = 1.61803398874989484820459 * 00000.1; // Golden Ratio   
float PI  = 3.14159265358979323846264 * 00000.1; // PI
float SQ2 = 1.41421356237309504880169 * 10000.0; // Square Root of Two

float gold_noise(in vec2 coordinate, in float seed)
{
	return fract(sin(dot(coordinate*(seed+PHI), vec2(PHI, PI)))*SQ2);
}

void main()
{
	gl_FragColor  = vec4(gold_noise(gl_FragCoord, iGlobalTime));
}

Any ideas?

The source: https://www.shadertoy.com/view/ltB3zD

@Kewl, remove the precision lowp float (that’s not supported on desktop OpenGL), and change gl_FragCoord to gl_FragCoord.xy.

Sorry, we don’t have the new syntax implemented yet, but are still planning to include it in the next major release.

Thanks for the time workaround. Added to the list.

2 Likes

Thanks!

Whats the status of the GLSL changes? Vuo 2.0? Thx
Update:
[Apparently the Shadertoy node now works with the changes described on the earlier post…kewl]

Another update: Apparently just those changes (modifying fragCoord, fragColor & iTime) dont seem sufficient to make a shadertoy example work in Vuo. Is there a list someplace of all the potentially required changes? Thx  

1 Like

Looking forward to updated syntax support and I agree some more information in the manual on how to adapt ShaderToys to work in Vuo would be great!

Yep, the new Shadertoy syntax will be supported in Vuo 2.0.

@eseftel, could you post the shader that’s not working for you?

From Shader - Shadertoy BETA with the required (I hope) changes for Vuo and a .png on Channel0

cloudTen.txt (5.28 KB)  

Aha, it’s a similar problem to this one — need to replace textureLod with texture2D. I’ll add that to the workaround steps above.

1 Like

Great thanks.that worked.

What about these? Don’t have a textureLod…from Shader - Shadertoy BETA & Shader - Shadertoy BETA  

afterRain.txt (5.95 KB)

magicWhale.txt (1.06 KB)

How does the Cloud Ten example show up on your computer @eseftel ?
No small noise clouds for me, more like smooth big clouds.

Magic Whale one I don’t know either,

For the After Rain, I don’t understand anything about GLSL but changing “texture” to “texture2D” at least I don’t get a black screen, but still a bit different (like sliced in the z-axis, due to texture → texture2D ? I don’t know ;).

 

afterRain 1.1.txt (6.15 KB)

@bodysoulspirit CloudTen shows up sort of ok, at least a starting point.
I don’t know much about GLSL myself (hence the reason I want to study and mess with these comps in Vuo) but changing texture to textture2D in the after rain comp caused Vuo to crash. repeatedly :-(

Sorry it crashed or you. Maybe upload the crash report so the team can look at it.

Ok so CloudTen look the same for me. Maybe because textureLod → texture2D ain’t the same parameter, and we need to make adjustments.
Hope the upcoming updated syntax will allow Shadertoys to look exactly the same in Vuo.

@eseftel — For After Rain, you do need to change texture to texture2D. (You can post the crash report if you want, but I doubt we’ll fix this since the issue will be moot soon.) For Magic Whale, change gl_FragCoord/iResolution.xy to gl_FragCoord.xy/iResolution.xy.

@Bodysoulspirit — Whatever the Shadertoy site shows in the iChannel slots, you have to put those images/videos/etc. into your Vuo composition for it to behave the same as on the site. You can download a package of Shadertoy input files here.  

AfterRain.vuo (8.67 KB)

MagicWhale.vuo (2.49 KB)

1 Like

@jstrecker aaah, I had the images, but from your composition I realized I was missing the repeat wrap mode for “After Rain” to look exactly the same.
Thank you.

@eseftel until the syntax update, if you don’t want to check for every word to replace, use joined compositions as work bases, it’s a cascade of Replace Text nodes that does the job for you (blue nodes). With the composition launched, you can remove the blue nodes & the updated code is saved to the Shadertoy node (it does not always work though, missing some ray marching syntax updates maybe).

PS : you still need to drag and drop your image onto the “Fetch Image” node to update the URL path (if images).

 

#BASE 1.2.vuo (5.71 KB)

#BASE + Buffer 1.2.vuo (9.78 KB)

2 Likes

Thanks very much guys - appreciate the help.

1 Like

Hello all,
Thanks for the replace text composition @Bodysoulspirit

I’m playing with this Bokeh code: https://www.shadertoy.com/view/Md3cWs
It works but only blurs/smears in one direction rather than creating the hexagonal bokeh (smearing in three directions I assume).
Any ideas what’s wrong with that?

Resolved in Vuo 2.0 beta.