@@ -58,7 +58,7 @@ bool drawOval(float2 polarUv, float2 polarCenter, float a, float b, bool reverse
5858 float2 p = polarUv - polarCenter;
5959 float oval = (p.x * p.x ) / (a * a) + (p.y * p.y ) / (b * b);
6060
61- float edge = smoothstep ( 1.0 , 1.0 - softness, oval);
61+ float edge = 1.0 - smoothstep ( 1.0 - softness, 1.0 , oval);
6262
6363 if (edge > 0.0 ) {
6464 float gradient = reverseGradient ? (1.0 - (p.x / a + 1.0 ) / 2.0 ) : ((p.x / a + 1.0 ) / 2.0 );
@@ -134,7 +134,9 @@ fragment float4 orbFragmentShader(VertexOut in [[stage_in]],
134134 );
135135
136136 float noise = flow (decomposed, radius * 0.03 - uniforms.animation * 0.2 ) - 0.5 ;
137- theta += noise * mix (0.5 , 1.0 , uniforms.outputVolume );
137+ float inputResponse = sqrt (uniforms.inputVolume );
138+ float angularStrength = mix (0.1 , 6.0 , inputResponse);
139+ theta += noise * angularStrength;
138140
139141 float4 color = float4 (1.0 , 1.0 , 1.0 , 1.0 );
140142
@@ -151,7 +153,7 @@ fragment float4 orbFragmentShader(VertexOut in [[stage_in]],
151153 for (int i = 0 ; i < 7 ; i++) {
152154 float noise = perlinTexture (float2 (fmod (centers[i] + uniforms.time * 0.05 , 1.0 ), 0.5 ));
153155 a = 0.5 + noise * 0.5 ; // Increased variance: goes from 0.0 to 1.0
154- b = noise * mix (4.5 , 3.0 , uniforms.inputVolume ); // Tall semi-minor axis
156+ b = noise * mix (4.5 , 3.0 , uniforms.outputVolume ); // Tall semi-minor axis
155157 bool reverseGradient = (i % 2 == 1 ); // Reverse gradient for every second oval
156158
157159 // Calculate the distance in polar coordinates
@@ -174,13 +176,13 @@ fragment float4 orbFragmentShader(VertexOut in [[stage_in]],
174176 float ringRadius1 = sharpRing (decomposed, uniforms.time * 0.1 );
175177 float ringRadius2 = smoothRing (decomposed, uniforms.time * 0.1 );
176178
177- float inputRadius1 = radius + uniforms.inputVolume * 0.3 ;
178- float inputRadius2 = radius + uniforms.inputVolume * 0.2 ;
179- float opacity1 = mix (0.3 , 0.8 , uniforms.inputVolume );
180- float opacity2 = mix (0.25 , 0.6 , uniforms.inputVolume );
179+ float outputRadius1 = radius + uniforms.outputVolume * 0.3 ;
180+ float outputRadius2 = radius + uniforms.outputVolume * 0.2 ;
181+ float opacity1 = mix (0.3 , 0.8 , uniforms.outputVolume );
182+ float opacity2 = mix (0.25 , 0.6 , uniforms.outputVolume );
181183
182- float ringAlpha1 = (inputRadius2 >= ringRadius1) ? opacity1 : 0.0 ;
183- float ringAlpha2 = smoothstep (ringRadius2 - 0.05 , ringRadius2 + 0.05 , inputRadius1 ) * opacity2;
184+ float ringAlpha1 = (outputRadius2 >= ringRadius1) ? opacity1 : 0.0 ;
185+ float ringAlpha2 = smoothstep (ringRadius2 - 0.05 , ringRadius2 + 0.05 , outputRadius1 ) * opacity2;
184186
185187 float totalRingAlpha = max (ringAlpha1, ringAlpha2);
186188
0 commit comments