mirror of
https://github.com/storytold/spark.git
synced 2026-10-11 21:40:48 +00:00
20 lines
483 B
TypeScript
20 lines
483 B
TypeScript
import * as THREE from "three";
|
|
|
|
import splatDefines from "./shaders/splatDefines.glsl";
|
|
import splatFragment from "./shaders/splatFragment.glsl";
|
|
import splatVertex from "./shaders/splatVertex.glsl";
|
|
|
|
let shaders: Record<string, string> | null = null;
|
|
|
|
export function getShaders(): Record<string, string> {
|
|
if (!shaders) {
|
|
// @ts-ignore
|
|
THREE.ShaderChunk.splatDefines = splatDefines;
|
|
shaders = {
|
|
splatVertex,
|
|
splatFragment,
|
|
};
|
|
}
|
|
return shaders;
|
|
}
|