Thx david, small steps here, but going somewhere.
My approach now is to convert and tweak every number in shader to find where i can ad new uniforms…
It seems to work.
Hi David, how u doing?
I think I need your help here, new encounter is the letter O
what does it usually stand for?
I figured out I with your method, now not sure. it its output gl-FragCoord.xy?
letter O =??
layout(location = 0) out vec4 fragColor;
uniform vec3 iResolution; // viewport resolution (in pixels)
uniform float iTime; // shader playback time (in seconds)
uniform float iTimeDelta; // render time (in seconds)
uniform int iFrame; // shader playback frame
uniform float iChannelTime[4]; // channel playback time (in seconds)
uniform vec3 iChannelResolution[4]; // channel resolution (in pixels)
uniform vec4 iMouse; // mouse pixel coords. xy: current (if MLB down), zw: click
uniform sampler2D sTDInput0;
uniform sampler2D sTDInput1; // input channel. XX = 2D/Cube
uniform vec4 iDate; // (year, month, day, time in seconds)
uniform float iSampleRate; // sound sample rate (i.e., 44100)
vec2 I = gl_FragCoord.xy; ???
void main()
{
vec2 P = (I-.5iResolution.xy)/2e2;
vec3 R = vec3(P,sqrt(1.-dot(P,P)));
O = mix(texture.xy(sTDInput0,.01iTime+.3R.xy/sqrt(R.z))max(R.x.3+R.y.9+R.z*.1+.5,.1),
vec4(.6,.4,.3,1)/dot(P,P*.5),pow(1.-sqrt(max(1.-dot(P,P),0.)),2.));
}
If you look at the shader on shadertoy, the O variable is declared as the output variable for mainImage(). So this is presumabl the output color for the pixel. What gl_FragColor used to be. So O should be replaced with whatever you have declared your output color. By default in the GLSL TOP the shader has it declared as fragColor.
Hi Malcom!
void main()
{
vec2 P = (gl_FragCoord.xy-.5iResolution.xy)/2e2;
vec3 R = vec3(P,sqrt(1.-dot(P,P)));
fragColor = mix(texture.xy(sTDInput0,.01iTime+.3R.xy/sqrt(R.z))max(R.x.3+R.y.9+R.z*.1+.5,.1),
vec4(.6,.4,.3,1)/dot(P,P*.5),pow(1.-sqrt(max(1.-dot(P,P),0.)),2.));
}
like this?
It makes a c99999 error, sorry its almost like i’m dyslexic when it come to code. I tried all sorts here with vec4 in front of fragColor, without… could it be its actually impossible on that particular shader? (you tried it?) I’m loosing the plot here.
You might be missing the ‘out vec4 fragColor’ above void main.
Also ‘sTDInput0’ should be sTDInputs[0]… and well there are some other variables used that should fixed (iResolution → uTDOutputInfo.res.xy, iTime should be added as an uniform.
greenpattern, don’t feel too down about the difficulty in ones like this, they were made for a competition that had maximum character counts of like ~300 characters, which is why all the variable names are stupid and single letters.
Like Malcolm mentioned, sometimes you can get clues by seeing where else the variable is being used/routed to. In the case of O, it was in the mainImage() as the “out”, so you could use our regular fragColor. You’ll just have to move through ones this like with a bit slower expectation or ignore any shaders with [SH*] in the title, because they’ll be from the competition.
Thx for support, No, you know I’m just joking here,I like to dramatize.hehe
It’s not first shader that resists. Actually I’ve got serious collection of converted shader going on here, and starting to be able to plug different inputs to use some precise effect needed, this is great, fun comes back when its all connected to touch designer and all works speed of light.
Now next quest is to make little galaxy ever seen before layering these modified shaders special planets.
The SH* ones are indeed quite cryptic, though still possible to use if you redeclare the input/output and i* variables.
The ‘unknown for touch’ variables in this shader are c, u, iResolution, iTime and iChannel0.
c would be the output color (since its located in mainImage(out vec4 c, vec2 u))
u would be the input coordinate, this is in pixels in shadertoy. (so not the uv coordinates)
iResolution, the resolution of the TOP in pixels.
iTime, current time
iChannel0, first input top.
So to convert this you’ll get something like:
// create an uniform variable and set it to something like 'absTime.seconds'
uniform float uTime;
void main() {
// This is the output resolution of the current glsl TOP
vec3 iResolution = vec3(uTDOutputInfo.res.zw,1);
// vUV.st is the uv coordinate of the TOP, multiply this with the
// resolution to get the pixel coordinate
vec2 u = vUV.st*iResolution.xy;
// Declaring iTime to be our new uniform
float iTime = uTime;
// First input TOP would be declared as this
sampler2D iChannel0 = sTD2DInputs[0];
...