004, add posterized alt ramp-only version

This commit is contained in:
41666 2023-10-15 17:02:32 -04:00
parent 9981ef0f42
commit 0b6ce2137f
3 changed files with 10 additions and 5 deletions

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 654 B

View file

@ -12,18 +12,23 @@ import foxImg from "../meshes/fox/fox-tex.png";
import foxNormal from "../meshes/fox/fox-normal.png"; import foxNormal from "../meshes/fox/fox-normal.png";
import backdropImg from "./textures/backdrop.png"; import backdropImg from "./textures/backdrop.png";
import backdropNormalsImg from "./textures/backdrop-normals.png"; import backdropNormalsImg from "./textures/backdrop-normals.png";
import { createWhiteTexture } from "../renderer/helper-textures/white";
const useAlt = location.search.includes("alt1");
const app = new WebGLApp({ fov: 45 }); const app = new WebGLApp({ fov: 45 });
const camera = new Transform([0, 2, 4], etoq([-15, 0, 0])); const camera = new Transform([0, 2, 4], etoq([-15, 0, 0]));
const light = new Transform([10, 10, 10]); const light = new Transform([10, !useAlt ? 10 : -2, 10]);
const transform = new Transform(v3(0), etoq([0, 180 + 45, 0]), v3(0.1)); const transform = new Transform(v3(0), etoq([0, 180 + 45, 0]), v3(0.1));
const ramp = new Texture(app, rampTexture, { uvClamp: true }); const ramp = new Texture(app, rampTexture, { uvClamp: true });
const backdropTex = new Texture(app, backdropImg); const backdropTex = !useAlt
? new Texture(app, backdropImg)
: createWhiteTexture(app);
const backdropNormalsTex = new Texture(app, backdropNormalsImg); const backdropNormalsTex = new Texture(app, backdropNormalsImg);
const foxTex = new Texture(app, foxImg); const foxTex = !useAlt ? new Texture(app, foxImg) : createWhiteTexture(app);
const foxNormalTex = new Texture(app, foxNormal); const foxNormalTex = new Texture(app, foxNormal);
const ambientLight = rgbToFloat(35, 76, 37); const ambientLight = rgbToFloat(35, 76, 37);