Move files
This commit is contained in:
parent
77e2013961
commit
339862a6ac
14 changed files with 23 additions and 48 deletions
|
|
@ -1,5 +1,5 @@
|
|||
import { settings } from '../settings';
|
||||
import { hsl } from '../utils/colors/hsl';
|
||||
import { hsl } from '../utils/hsl';
|
||||
import { last } from '../utils/last';
|
||||
import { Random } from '../utils/random';
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { settings } from '../settings';
|
||||
import { SettingsSlider, ValueScaling } from '../utils/settings-slider';
|
||||
import { SettingsSlider, ValueScaling } from './settings-slider';
|
||||
|
||||
export const setUpSettingsPage = (
|
||||
settingsPage: HTMLDivElement,
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { formatNumber } from './format-number';
|
||||
import { formatNumber } from '../utils/format-number';
|
||||
|
||||
export enum ValueScaling {
|
||||
Linear,
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
import { setUpFullScreenQuad } from '../../utils/graphics/full-screen-quad/full-screen-quad';
|
||||
import { setUpFullScreenQuad } from '../../utils/graphics/full-screen-quad';
|
||||
import { smartCompile } from '../../utils/graphics/smart-compile';
|
||||
import { CommonState } from '../common-state/common-state';
|
||||
import shader from './diffuse.wgsl';
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { setUpFullScreenQuad } from '../../utils/graphics/full-screen-quad/full-screen-quad';
|
||||
import { setUpFullScreenQuad } from '../../utils/graphics/full-screen-quad';
|
||||
import { smartCompile } from '../../utils/graphics/smart-compile';
|
||||
import { CommonState } from '../common-state/common-state';
|
||||
import { RenderSettings } from './render-settings';
|
||||
|
|
|
|||
|
|
@ -1,16 +0,0 @@
|
|||
import { rgb255 } from './rgb255';
|
||||
|
||||
import { vec3 } from 'gl-matrix';
|
||||
|
||||
export const hex = (hex: string): vec3 => {
|
||||
if (hex[0] === '#') {
|
||||
hex = hex.slice(1);
|
||||
}
|
||||
|
||||
const bigint = parseInt(hex, 16);
|
||||
const r = (bigint >> 16) & 255;
|
||||
const g = (bigint >> 8) & 255;
|
||||
const b = bigint & 255;
|
||||
|
||||
return rgb255(r, g, b);
|
||||
};
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
import { vec3 } from 'gl-matrix';
|
||||
|
||||
export const rgb255 = (r: number, g: number, b: number): vec3 =>
|
||||
vec3.fromValues(r / 255, g / 255, b / 255);
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
import { vec4 } from 'gl-matrix';
|
||||
|
||||
export const rgba = (r: number, g: number, b: number, a: number): vec4 =>
|
||||
vec4.fromValues(r, g, b, a);
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
import { vec4 } from 'gl-matrix';
|
||||
|
||||
export const rgba255 = (r: number, g: number, b: number, a: number): vec4 =>
|
||||
vec4.fromValues(r / 255, g / 255, b / 255, a / 255);
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
import { smartCompile } from '../smart-compile';
|
||||
import shader from './full-screen-quad.wgsl';
|
||||
import { smartCompile } from './smart-compile';
|
||||
|
||||
export const setUpFullScreenQuad = (
|
||||
device: GPUDevice
|
||||
|
|
@ -26,7 +26,22 @@ export const setUpFullScreenQuad = (
|
|||
return {
|
||||
buffer,
|
||||
vertex: {
|
||||
module: smartCompile(device, shader),
|
||||
module: smartCompile(
|
||||
device,
|
||||
/* wgsl */ `
|
||||
struct VertexOutput {
|
||||
@builtin(position) position: vec4<f32>,
|
||||
@location(0) uv: vec2<f32>,
|
||||
}
|
||||
|
||||
@vertex
|
||||
fn vertex(
|
||||
@location(0) position: vec2<f32>,
|
||||
@location(1) uv: vec2<f32>
|
||||
) -> VertexOutput {
|
||||
return VertexOutput(vec4(position, 0.0, 1.0), uv);
|
||||
}`
|
||||
),
|
||||
entryPoint: 'vertex',
|
||||
buffers: [
|
||||
{
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
struct VertexOutput {
|
||||
@builtin(position) position: vec4<f32>,
|
||||
@location(0) uv: vec2<f32>,
|
||||
}
|
||||
|
||||
@vertex
|
||||
fn vertex(
|
||||
@location(0) position: vec2<f32>,
|
||||
@location(1) uv: vec2<f32>
|
||||
) -> VertexOutput {
|
||||
return VertexOutput(vec4(position, 0.0, 1.0), uv);
|
||||
}
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
import { setUpFullScreenQuad } from './full-screen-quad/full-screen-quad';
|
||||
import { setUpFullScreenQuad } from './full-screen-quad';
|
||||
import { smartCompile } from './smart-compile';
|
||||
|
||||
const textureCache = new Map<string, GPUTexture>();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue