diff --git a/bg.webp b/bg.webp new file mode 100644 index 0000000..ab06ba2 Binary files /dev/null and b/bg.webp differ diff --git a/index.html b/index.html index b9da3b0..6994526 100644 --- a/index.html +++ b/index.html @@ -4,9 +4,31 @@ Shaders are Fun + - +
+

+ + + Stitchy's Shaders + + +

+
+ +
+
+ +
+
diff --git a/main.mjs b/main.mjs index 50e225c..97772b8 100644 --- a/main.mjs +++ b/main.mjs @@ -2,8 +2,8 @@ import "https://cdnjs.cloudflare.com/ajax/libs/gl-matrix/3.4.2/gl-matrix-min.js" import { initShader } from "./shader.mjs"; import { calcRotationMatrix } from "./algebra.mjs"; -const CANVAS_WIDTH = 700; -const CANVAS_HEIGHT = 700; +const CANVAS_WIDTH = 800; +const CANVAS_HEIGHT = 800; let TIME = 0; let camera_pos = [0, 0, 0]; let mouse_pos = [0, 0]; diff --git a/raymarcher.glsl b/raymarcher.glsl index c9aa4f6..747c18f 100644 --- a/raymarcher.glsl +++ b/raymarcher.glsl @@ -20,7 +20,7 @@ const float PI = 3.1415; //const vec3 camera_pos = vec3(0.); const vec3 color1 = vec3(0.494, 0.361, 0.678); -const vec3 color2 = vec3(0.827, 0.945, 0.875); +const vec3 color2 = vec3(0.18, 0.945, 0.975); // Scene Object (sphere) diff --git a/shader.mjs b/shader.mjs index c522800..6f3ec5b 100644 --- a/shader.mjs +++ b/shader.mjs @@ -15,7 +15,7 @@ export async function initShader(c_width, c_height) { gl.bindVertexArray(vao); // manipulating bitfield for canvas - gl.clearColor(1, 1, 0, 1); + gl.clearColor(0.18, 1, 1, 1); gl.clear(gl.COLOR_BUFFER_BIT); // Array of verticies for gpu to render diff --git a/style.css b/style.css new file mode 100644 index 0000000..e57052e --- /dev/null +++ b/style.css @@ -0,0 +1,36 @@ +:root { + --text-color: #a1a; + --bg-color: #51fefe; +} +body { + margin: 0px; + padding: 0px; + background-image: url("./bg.webp"); + background-attachment: fixed; + overflow: hidden; +} + +main { + color: var(--text-color); + text-align: center; + margin: 1rem; +} + +svg { + color: var(--text-color); + stroke: #a1a; +} + +.render { + padding: 0px; + margin: 0px; + border: var(--text-color) 4px solid; + display: inline-flex; +} + +button { + color: var(--text-color); + background-color: var(--bg-color); + border: 4px var(--text-color) solid; + padding: 0.5rem 2rem; +}