Files
TunnelProofOfConcept/.cache/2c/7dfe824bb2fd601e4bc50003b664e6.json
2024-02-23 11:28:00 +01:00

1 line
9.5 KiB
JSON

{"id":"maiY","dependencies":[{"name":"/Users/marco/codeProjects/tunnel/package.json","includedInParent":true,"mtime":1702561850976}],"generated":{"js":"module.exports=\"#define GLSLIFY 1\\n// Input varying representing the texture coordinates\\nvarying vec2 vUv;\\n\\n// Time variable for animation\\nuniform float time;\\n\\nuniform sampler2D u_texture; // Texture samplers for the two textures\\nuniform sampler2D u_texture2; // Texture samplers for the two textures\\nuniform float transparency1; // Transparencies (opacities) for the two textures\\nuniform float transparency2; // Transparencies (opacities) for the two textures\\nuniform vec2 scale; // UV coordinates scaling\\nuniform vec2 offset; // UV coordinates offset\\nuniform float rotation; // Rotation angle for UV coordinates\\nuniform float turbulence; // Turbulence factor for UV coordinates distortion\\nuniform float colorOffset; // Offset for color modification\\nuniform float brightness; // Brightness adjustment\\nuniform float distortionFactorX; // Distortion factor along the X-axis\\nuniform float repeatX; // Texture repeat along the X-axis\\nuniform float repeatY; // Texture repeat along the Y-axis\\nuniform float aspectRatioCorrection; // Correction factor for texture aspect ratio\\nuniform float distortionFactorY; // Distortion factor along the Y-axis\\nuniform float waveSpeed; // Speed of the waving effect\\nuniform float globalScale; // Global scaling factor for UV coordinates\\nuniform float twist; // Twist factor for UV coordinates\\nuniform float waveFrequency; // Frequency of the waving effect\\nuniform float depthFactor; // Depth modulation factor for waving effect\\nuniform float glowIntensity; // Intensity of the glow effect\\nuniform float pulseSpeed; // Speed of the pulsation effect\\nuniform float colorR; // R color components for tinting\\nuniform float colorG; // G color components for tinting\\nuniform float colorB; // B color components for tinting\\n\\n// Hash function for generating pseudo-random numbers\\nfloat hash12(vec2 p) {\\n vec3 p3 = fract(vec3(p.xyx) * 0.1031);\\n p3 += dot(p3, p3.yzx + 33.33);\\n return fract((p3.x + p3.y) * p3.z);\\n}\\n\\nvoid main() {\\n // Get the texture coordinates\\n vec2 uv = vUv;\\n\\n // Apply scaling to the UV coordinates\\n uv *= scale;\\n\\n // Apply rotation to the UV coordinates\\n uv = vec2(\\n uv.x * cos(rotation) - uv.y * sin(rotation),\\n uv.x * sin(rotation) + uv.y * cos(rotation)\\n );\\n\\n // Apply offset to the UV coordinates\\n uv += offset;\\n\\n // Apply turbulence to the UV coordinates\\n uv += turbulence * sin(time * 0.1) * vec2(hash12(uv), hash12(uv * 2.0));\\n\\n // Apply color offset to UV coordinates\\n uv += colorOffset;\\n\\n // Adjust UV coordinates to account for the aspect ratio of the texture\\n uv *= vec2(aspectRatioCorrection, 1.0);\\n\\n // Encourage wrapping by using the fract function on the UV coordinates\\n uv = fract(uv);\\n\\n // Sample colors from the two textures\\n vec4 color1 = texture2D(u_texture, uv);\\n vec4 color2 = texture2D(u_texture2, uv);\\n\\n // Multiply texture colors by their respective transparencies (opacities)\\n color1 *= vec4(1.0, 1.0, 1.0, transparency1);\\n color2 *= vec4(1.0, 1.0, 1.0, transparency2);\\n\\n // Example: This wil render the first texture on 100% and the second texture will be on top\\n // vec4 finalColor = mix(color1 * transparency1, vec4(0.0), transparency2) + color2 * transparency2;\\n \\n \\n // Same as before but swapped layers\\n // vec4 finalColor = mix(color2 * transparency2, vec4(0.0), transparency1) + color1 * transparency1;\\n\\n vec4 finalColor;\\n\\n if (transparency1 >= 0.0) {\\n finalColor = mix(color1 * transparency1, vec4(0.0), transparency2) + color2 * transparency2;\\n } else if (transparency2 >= 0.0) {\\n finalColor = mix(color2 * transparency2, vec4(0.0), transparency1) + color1 * transparency1;\\n } \\n\\n // Modify finalColor based on brightness\\n finalColor.rgb *= brightness;\\n\\n // Pulsation effect\\n float pulse = 0.5 + 0.5 * sin(time * pulseSpeed);\\n finalColor.rgb += pulse * glowIntensity;\\n\\n // Waving effect\\n float wave = sin(time * waveSpeed + uv.y * waveFrequency);\\n uv.x += wave * depthFactor;\\n finalColor.rgb += wave * depthFactor;\\n\\n // Set the final color as the output\\n gl_FragColor = finalColor;\\n}\\n\";"},"sourceMaps":{"js":{"mappings":[{"source":"src/shaders/fragment.glsl","name":"module","original":{"line":1,"column":0},"generated":{"line":1,"column":0}},{"source":"src/shaders/fragment.glsl","name":"exports","original":{"line":1,"column":7},"generated":{"line":1,"column":7}},{"source":"src/shaders/fragment.glsl","original":{"line":1,"column":15},"generated":{"line":1,"column":15}}],"sources":{"src/shaders/fragment.glsl":"module.exports=\"#define GLSLIFY 1\\n// Input varying representing the texture coordinates\\nvarying vec2 vUv;\\n\\n// Time variable for animation\\nuniform float time;\\n\\nuniform sampler2D u_texture; // Texture samplers for the two textures\\nuniform sampler2D u_texture2; // Texture samplers for the two textures\\nuniform float transparency1; // Transparencies (opacities) for the two textures\\nuniform float transparency2; // Transparencies (opacities) for the two textures\\nuniform vec2 scale; // UV coordinates scaling\\nuniform vec2 offset; // UV coordinates offset\\nuniform float rotation; // Rotation angle for UV coordinates\\nuniform float turbulence; // Turbulence factor for UV coordinates distortion\\nuniform float colorOffset; // Offset for color modification\\nuniform float brightness; // Brightness adjustment\\nuniform float distortionFactorX; // Distortion factor along the X-axis\\nuniform float repeatX; // Texture repeat along the X-axis\\nuniform float repeatY; // Texture repeat along the Y-axis\\nuniform float aspectRatioCorrection; // Correction factor for texture aspect ratio\\nuniform float distortionFactorY; // Distortion factor along the Y-axis\\nuniform float waveSpeed; // Speed of the waving effect\\nuniform float globalScale; // Global scaling factor for UV coordinates\\nuniform float twist; // Twist factor for UV coordinates\\nuniform float waveFrequency; // Frequency of the waving effect\\nuniform float depthFactor; // Depth modulation factor for waving effect\\nuniform float glowIntensity; // Intensity of the glow effect\\nuniform float pulseSpeed; // Speed of the pulsation effect\\nuniform float colorR; // R color components for tinting\\nuniform float colorG; // G color components for tinting\\nuniform float colorB; // B color components for tinting\\n\\n// Hash function for generating pseudo-random numbers\\nfloat hash12(vec2 p) {\\n vec3 p3 = fract(vec3(p.xyx) * 0.1031);\\n p3 += dot(p3, p3.yzx + 33.33);\\n return fract((p3.x + p3.y) * p3.z);\\n}\\n\\nvoid main() {\\n // Get the texture coordinates\\n vec2 uv = vUv;\\n\\n // Apply scaling to the UV coordinates\\n uv *= scale;\\n\\n // Apply rotation to the UV coordinates\\n uv = vec2(\\n uv.x * cos(rotation) - uv.y * sin(rotation),\\n uv.x * sin(rotation) + uv.y * cos(rotation)\\n );\\n\\n // Apply offset to the UV coordinates\\n uv += offset;\\n\\n // Apply turbulence to the UV coordinates\\n uv += turbulence * sin(time * 0.1) * vec2(hash12(uv), hash12(uv * 2.0));\\n\\n // Apply color offset to UV coordinates\\n uv += colorOffset;\\n\\n // Adjust UV coordinates to account for the aspect ratio of the texture\\n uv *= vec2(aspectRatioCorrection, 1.0);\\n\\n // Encourage wrapping by using the fract function on the UV coordinates\\n uv = fract(uv);\\n\\n // Sample colors from the two textures\\n vec4 color1 = texture2D(u_texture, uv);\\n vec4 color2 = texture2D(u_texture2, uv);\\n\\n // Multiply texture colors by their respective transparencies (opacities)\\n color1 *= vec4(1.0, 1.0, 1.0, transparency1);\\n color2 *= vec4(1.0, 1.0, 1.0, transparency2);\\n\\n // Example: This wil render the first texture on 100% and the second texture will be on top\\n // vec4 finalColor = mix(color1 * transparency1, vec4(0.0), transparency2) + color2 * transparency2;\\n \\n \\n // Same as before but swapped layers\\n // vec4 finalColor = mix(color2 * transparency2, vec4(0.0), transparency1) + color1 * transparency1;\\n\\n vec4 finalColor;\\n\\n if (transparency1 >= 0.0) {\\n finalColor = mix(color1 * transparency1, vec4(0.0), transparency2) + color2 * transparency2;\\n } else if (transparency2 >= 0.0) {\\n finalColor = mix(color2 * transparency2, vec4(0.0), transparency1) + color1 * transparency1;\\n } \\n\\n // Modify finalColor based on brightness\\n finalColor.rgb *= brightness;\\n\\n // Pulsation effect\\n float pulse = 0.5 + 0.5 * sin(time * pulseSpeed);\\n finalColor.rgb += pulse * glowIntensity;\\n\\n // Waving effect\\n float wave = sin(time * waveSpeed + uv.y * waveFrequency);\\n uv.x += wave * depthFactor;\\n finalColor.rgb += wave * depthFactor;\\n\\n // Set the final color as the output\\n gl_FragColor = finalColor;\\n}\\n\";"},"lineCount":null}},"error":null,"hash":"159ea87aff41ecad3152d461b879b809","cacheData":{"env":{}}}