Skip to content

Commit

Permalink
Better CrossGL formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
NripeshN committed Jul 30, 2024
1 parent 813ceae commit 0b6b3a1
Showing 1 changed file with 28 additions and 35 deletions.
63 changes: 28 additions & 35 deletions getting_start.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -64,41 +64,34 @@
"\n",
"```cpp\n",
"shader main {\n",
"\n",
"vertex {\n",
"\n",
"input vec3 position;\n",
"output vec2 vUV;\n",
"\n",
"void main()\n",
"{\n",
" vUV = position.xy * 10.0;\n",
" gl_Position = vec4(position, 1.0);\n",
"}\n",
"\n",
"}\n",
"\n",
"float perlinNoise(vec2 p) {\n",
" return fract(sin(dot(p, vec2(12.9898, 78.233))) * 43758.5453);\n",
"}\n",
"\n",
"fragment {\n",
"\n",
"input vec2 vUV;\n",
"output vec4 fragColor;\n",
"\n",
"\n",
"void main()\n",
"{\n",
" float noise = perlinNoise(vUV);\n",
" float height = noise * 10.0;\n",
" vec3 color = vec3(height / 10.0, 1.0 - height / 10.0, 0.0);\n",
" fragColor = vec4(color, 1.0);\n",
"}\n",
"\n",
"\n",
"}\n",
"\n",
" vertex {\n",
" input vec3 position;\n",
" output vec2 vUV;\n",
"\n",
" void main()\n",
" {\n",
" vUV = position.xy * 10.0;\n",
" gl_Position = vec4(position, 1.0);\n",
" }\n",
" }\n",
"\n",
" float perlinNoise(vec2 p) {\n",
" return fract(sin(dot(p, vec2(12.9898, 78.233))) * 43758.5453);\n",
" }\n",
"\n",
" fragment {\n",
" input vec2 vUV;\n",
" output vec4 fragColor;\n",
"\n",
"\n",
" void main()\n",
" {\n",
" float noise = perlinNoise(vUV);\n",
" float height = noise * 10.0;\n",
" vec3 color = vec3(height / 10.0, 1.0 - height / 10.0, 0.0);\n",
" fragColor = vec4(color, 1.0);\n",
" }\n",
" }\n",
"}\n",
"```\n",
"\n",
Expand Down

0 comments on commit 0b6b3a1

Please sign in to comment.