diff --git a/05/draw-multi-shaping-func.frag b/examples/05/draw-multi-shaping-func.frag similarity index 71% rename from 05/draw-multi-shaping-func.frag rename to examples/05/draw-multi-shaping-func.frag index 4b36bab..dea95e5 100644 --- a/05/draw-multi-shaping-func.frag +++ b/examples/05/draw-multi-shaping-func.frag @@ -18,17 +18,17 @@ float plot(vec2 st, float pct){ } void main() { - vec2 st = gl_FragCoord.xy/u_resolution; + vec2 st = gl_FragCoord.xy / u_resolution; //backgoud gradient vec3 bkcolor = vec3(st.x); // Plot a lines - float pct1 = plot(st,st.x); + float pct1 = plot(st, st.x); float pct2 = plot(st,pow(st.x, 0.5)); float pct3 = plot(st, pow(st.x, 2.0)); - vec3 color = (1.0-pct1)*(1.0-pct2)*(1.0-pct3)*bkcolor+pct1*vec3(1.0,0.0,0.0)+pct2*vec3(0.0,1.0,0.0) + pct3*vec3(0.0, 1.0, 1.0); + vec3 color = (1.0 - pct1) * (1.0 - pct2) * (1.0 - pct3) * bkcolor + pct1 * vec3(1.0, 0.0, 0.0) + pct2 * vec3(0.0, 1.0, 0.0) + pct3 * vec3(0.0, 1.0, 1.0); - gl_FragColor = vec4(color,1.0); + gl_FragColor = vec4(color, 1.0); } diff --git a/05/stepwise.frag b/examples/05/stepwise.frag similarity index 100% rename from 05/stepwise.frag rename to examples/05/stepwise.frag diff --git a/examples/README.md b/examples/README.md index 882fe3c..e935cb8 100644 --- a/examples/README.md +++ b/examples/README.md @@ -26,8 +26,8 @@ The following is a list of examples present in this book. - [Iñigo Quiles's Parabola](../edit.html#05/parabola.frag) - [Iñigo Quiles's Power Curve](../edit.html#05/pcurve.frag) - [Easing functions](../edit.html#05/easing.frag) - - [Stepwise function](../edit.html#05/stepwise.frag) - - [Drawing multiple shaping functions](../edit.html#05/draw-multi-shaping-func.frag) + - [Stepwise function](../edit.html#examples/05/stepwise.frag) + - [Drawing multiple shaping functions](../edit.html#examples/05/draw-multi-shaping-func.frag) * [Color](../06/) - [Mix](../edit.html#06/mix.frag)