Skip to content

Commit f90e0bd

Browse files
Merge pull request modelcontextprotocol#375 from jonathanhefner/fix-shadertoy-readme-json
Use escaped newlines in ShaderToy README JSON examples
2 parents 47a5787 + 9b1da10 commit f90e0bd

1 file changed

Lines changed: 2 additions & 20 deletions

File tree

examples/shadertoy-server/README.md

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,7 @@ _Tool input:_
9090

9191
```json
9292
{
93-
"fragmentShader": "void mainImage(out vec4 fragColor, in vec2 fragCoord) {
94-
vec2 uv = fragCoord / iResolution.xy;
95-
fragColor = vec4(uv, 0.5 + 0.5*sin(iTime), 1.0);
96-
}"
93+
"fragmentShader": "void mainImage(out vec4 fragColor, in vec2 fragCoord) {\n vec2 uv = fragCoord / iResolution.xy;\n fragColor = vec4(uv, 0.5 + 0.5*sin(iTime), 1.0);\n}"
9794
}
9895
```
9996

@@ -122,22 +119,7 @@ _Tool input:_
122119

123120
```json
124121
{
125-
"fragmentShader": "void mainImage(out vec4 fragColor, in vec2 fragCoord) {
126-
vec2 uv = (fragCoord - 0.5 * iResolution.xy) / iResolution.y;
127-
float segments = 6.0;
128-
float zoom = 1.0 + 0.3 * sin(iTime * 0.2);
129-
float angle = atan(uv.y, uv.x) + iTime * 0.3;
130-
float r = length(uv) * zoom;
131-
angle = mod(angle, 6.28 / segments);
132-
angle = abs(angle - 3.14 / segments);
133-
vec2 p = vec2(cos(angle), sin(angle)) * r;
134-
p += iTime * 0.1;
135-
float v = sin(p.x * 10.0) * sin(p.y * 10.0);
136-
v += sin(length(p) * 15.0 - iTime * 2.0);
137-
v += sin(p.x * 5.0 + p.y * 7.0 + iTime);
138-
vec3 col = 0.5 + 0.5 * cos(v * 2.0 + vec3(0.0, 2.0, 4.0) + iTime);
139-
fragColor = vec4(col, 1.0);
140-
}"
122+
"fragmentShader": "void mainImage(out vec4 fragColor, in vec2 fragCoord) {\n vec2 uv = (fragCoord - 0.5 * iResolution.xy) / iResolution.y;\n float segments = 6.0;\n float zoom = 1.0 + 0.3 * sin(iTime * 0.2);\n float angle = atan(uv.y, uv.x) + iTime * 0.3;\n float r = length(uv) * zoom;\n angle = mod(angle, 6.28 / segments);\n angle = abs(angle - 3.14 / segments);\n vec2 p = vec2(cos(angle), sin(angle)) * r;\n p += iTime * 0.1;\n float v = sin(p.x * 10.0) * sin(p.y * 10.0);\n v += sin(length(p) * 15.0 - iTime * 2.0);\n v += sin(p.x * 5.0 + p.y * 7.0 + iTime);\n vec3 col = 0.5 + 0.5 * cos(v * 2.0 + vec3(0.0, 2.0, 4.0) + iTime);\n fragColor = vec4(col, 1.0);\n}"
141123
}
142124
```
143125

0 commit comments

Comments
 (0)