UNPKG

5.51 kBTypeScriptView Raw
1import { Color } from "../../math/Color.js";
2import { Matrix3 } from "../../math/Matrix3.js";
3import { Vector2 } from "../../math/Vector2.js";
4
5// eslint-disable-next-line @typescript-eslint/naming-convention
6export interface IUniform<TValue = any> {
7 value: TValue;
8}
9
10export const UniformsLib: {
11 common: {
12 diffuse: IUniform<Color>;
13 opacity: IUniform<number>;
14 map: IUniform<unknown>;
15 mapTransform: IUniform<Matrix3>;
16 alphaMap: IUniform<unknown>;
17 alphaMapTransform: IUniform<Matrix3>;
18 alphaTest: IUniform<number>;
19 };
20 specularmap: {
21 specularMap: IUniform<unknown>;
22 specularMapTransform: IUniform<Matrix3>;
23 };
24 envmap: {
25 envMap: IUniform<unknown>;
26 envMapRotation: IUniform<Matrix3>;
27 flipEnvMap: IUniform<number>;
28 reflectivity: IUniform<number>;
29 ior: IUniform<number>;
30 refractRatio: IUniform<number>;
31 };
32 aomap: {
33 aoMap: IUniform<unknown>;
34 aoMapIntensity: IUniform<number>;
35 aoMapTransform: IUniform<Matrix3>;
36 };
37 lightmap: {
38 lightMap: IUniform<number>;
39 lightMapIntensity: IUniform<number>;
40 lightMapTransform: IUniform<Matrix3>;
41 };
42 bumpmap: {
43 bumpMap: IUniform<unknown>;
44 bumpMapTransform: IUniform<Matrix3>;
45 bumpScale: IUniform<number>;
46 };
47 normalmap: {
48 normalMap: IUniform<unknown>;
49 normalMapTransform: IUniform<Matrix3>;
50 normalScale: IUniform<Vector2>;
51 };
52 displacementmap: {
53 displacementMap: IUniform<unknown>;
54 displacementMapTransform: IUniform<Matrix3>;
55 displacementScale: IUniform<number>;
56 displacementBias: IUniform<number>;
57 };
58 emissivemap: {
59 emissiveMap: IUniform<unknown>;
60 emissiveMapTransform: IUniform<Matrix3>;
61 };
62 metalnessmap: {
63 metalnessMap: IUniform<unknown>;
64 metalnessMapTransform: IUniform<Matrix3>;
65 };
66 roughnessmap: {
67 roughnessMap: IUniform<unknown>;
68 roughnessMapTransform: IUniform<Matrix3>;
69 };
70 gradientmap: {
71 gradientMap: IUniform<unknown>;
72 };
73 fog: {
74 fogDensity: IUniform<number>;
75 fogNear: IUniform<number>;
76 fogFar: IUniform<number>;
77 fogColor: IUniform<Color>;
78 };
79 lights: {
80 ambientLightColor: IUniform<unknown[]>;
81 lightProbe: IUniform<unknown[]>;
82 directionalLights: {
83 value: unknown[];
84 properties: {
85 direction: {};
86 color: {};
87 };
88 };
89 directionalLightShadows: {
90 value: unknown[];
91 properties: {
92 shadowIntensity: number;
93 shadowBias: {};
94 shadowNormalBias: {};
95 shadowRadius: {};
96 shadowMapSize: {};
97 };
98 };
99 directionalShadowMap: IUniform<unknown[]>;
100 directionalShadowMatrix: IUniform<unknown[]>;
101 spotLights: {
102 value: unknown[];
103 properties: {
104 color: {};
105 position: {};
106 direction: {};
107 distance: {};
108 coneCos: {};
109 penumbraCos: {};
110 decay: {};
111 };
112 };
113 spotLightShadows: {
114 value: unknown[];
115 properties: {
116 shadowIntensity: number;
117 shadowBias: {};
118 shadowNormalBias: {};
119 shadowRadius: {};
120 shadowMapSize: {};
121 };
122 };
123 spotLightMap: IUniform<unknown[]>;
124 spotShadowMap: IUniform<unknown[]>;
125 spotLightMatrix: IUniform<unknown[]>;
126 pointLights: {
127 value: unknown[];
128 properties: {
129 color: {};
130 position: {};
131 decay: {};
132 distance: {};
133 };
134 };
135 pointLightShadows: {
136 value: unknown[];
137 properties: {
138 shadowIntensity: number;
139 shadowBias: {};
140 shadowNormalBias: {};
141 shadowRadius: {};
142 shadowMapSize: {};
143 shadowCameraNear: {};
144 shadowCameraFar: {};
145 };
146 };
147 pointShadowMap: IUniform<unknown[]>;
148 pointShadowMatrix: IUniform<unknown[]>;
149 hemisphereLights: {
150 value: unknown[];
151 properties: {
152 direction: {};
153 skycolor: {};
154 groundColor: {};
155 };
156 };
157 rectAreaLights: {
158 value: unknown[];
159 properties: {
160 color: {};
161 position: {};
162 width: {};
163 height: {};
164 };
165 };
166 ltc_1: IUniform<unknown>;
167 ltc_2: IUniform<unknown>;
168 };
169 points: {
170 diffuse: IUniform<Color>;
171 opacity: IUniform<number>;
172 size: IUniform<number>;
173 scale: IUniform<number>;
174 map: IUniform<unknown>;
175 alphaMap: IUniform<unknown>;
176 alphaTest: IUniform<number>;
177 uvTransform: IUniform<Matrix3>;
178 };
179 sprite: {
180 diffuse: IUniform<Color>;
181 opacity: IUniform<number>;
182 center: IUniform<Vector2>;
183 rotation: IUniform<number>;
184 map: IUniform<unknown>;
185 mapTransform: IUniform<Matrix3>;
186 alphaMap: IUniform<unknown>;
187 alphaTest: IUniform<number>;
188 };
189};