@luma.gl/shadertools 9.1.0-alpha.16 → 9.1.0-alpha.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/dist.dev.js +277 -344
- package/dist/dist.min.js +215 -314
- package/dist/index.cjs +276 -346
- package/dist/index.cjs.map +4 -4
- package/dist/index.d.ts +4 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -1
- package/dist/lib/shader-module/shader-module.d.ts +24 -14
- package/dist/lib/shader-module/shader-module.d.ts.map +1 -1
- package/dist/lib/shader-module/shader-module.js +11 -15
- package/dist/lib/shader-module/shader-pass.d.ts +4 -2
- package/dist/lib/shader-module/shader-pass.d.ts.map +1 -1
- package/dist/lib/utils/uniform-types.d.ts +11 -0
- package/dist/lib/utils/uniform-types.d.ts.map +1 -0
- package/dist/lib/utils/uniform-types.js +1 -0
- package/dist/modules/engine/picking/picking.d.ts +7 -7
- package/dist/modules/engine/picking/picking.d.ts.map +1 -1
- package/dist/modules/engine/picking/picking.js +2 -2
- package/dist/modules/engine/project/project.d.ts +9 -8
- package/dist/modules/engine/project/project.d.ts.map +1 -1
- package/dist/modules/lighting/gouraud-material/gouraud-material.d.ts +3 -57
- package/dist/modules/lighting/gouraud-material/gouraud-material.d.ts.map +1 -1
- package/dist/modules/lighting/gouraud-material/gouraud-material.js +9 -6
- package/dist/modules/lighting/lights/lighting-uniforms-glsl.d.ts +1 -1
- package/dist/modules/lighting/lights/lighting-uniforms-glsl.d.ts.map +1 -1
- package/dist/modules/lighting/lights/lighting-uniforms-glsl.js +35 -12
- package/dist/modules/lighting/lights/lighting.d.ts +55 -29
- package/dist/modules/lighting/lights/lighting.d.ts.map +1 -1
- package/dist/modules/lighting/lights/lighting.js +46 -35
- package/dist/modules/lighting/no-material/dirlight.d.ts +3 -3
- package/dist/modules/lighting/no-material/dirlight.d.ts.map +1 -1
- package/dist/modules/lighting/no-material/dirlight.js +1 -1
- package/dist/modules/lighting/pbr-material/pbr-fragment-glsl.d.ts +1 -1
- package/dist/modules/lighting/pbr-material/pbr-fragment-glsl.d.ts.map +1 -1
- package/dist/modules/lighting/pbr-material/pbr-fragment-glsl.js +56 -60
- package/dist/modules/lighting/pbr-material/pbr-material.d.ts +56 -98
- package/dist/modules/lighting/pbr-material/pbr-material.d.ts.map +1 -1
- package/dist/modules/lighting/pbr-material/pbr-material.js +14 -22
- package/dist/modules/lighting/pbr-material/pbr-projection.d.ts +10 -0
- package/dist/modules/lighting/pbr-material/pbr-projection.d.ts.map +1 -0
- package/dist/modules/lighting/pbr-material/pbr-projection.js +24 -0
- package/dist/modules/lighting/pbr-material/pbr-vertex-glsl.d.ts +1 -1
- package/dist/modules/lighting/pbr-material/pbr-vertex-glsl.d.ts.map +1 -1
- package/dist/modules/lighting/pbr-material/pbr-vertex-glsl.js +8 -16
- package/dist/modules/lighting/phong-material/phong-material.d.ts +5 -59
- package/dist/modules/lighting/phong-material/phong-material.d.ts.map +1 -1
- package/dist/modules/lighting/phong-material/phong-material.js +6 -4
- package/dist/modules/lighting/phong-material/phong-shaders-glsl.d.ts +1 -40
- package/dist/modules/lighting/phong-material/phong-shaders-glsl.d.ts.map +1 -1
- package/dist/modules/lighting/phong-material/phong-shaders-glsl.js +8 -87
- package/dist/modules-webgl1/project/project.d.ts +6 -4
- package/dist/modules-webgl1/project/project.d.ts.map +1 -1
- package/dist/passes/postprocessing/fxaa/fxaa.d.ts +1 -1
- package/dist/passes/postprocessing/fxaa/fxaa.d.ts.map +1 -1
- package/dist/passes/postprocessing/fxaa/fxaa.js +1 -1
- package/dist/passes/postprocessing/image-adjust-filters/brightnesscontrast.d.ts +0 -1
- package/dist/passes/postprocessing/image-adjust-filters/brightnesscontrast.d.ts.map +1 -1
- package/dist/passes/postprocessing/image-adjust-filters/brightnesscontrast.js +0 -1
- package/dist/passes/postprocessing/image-adjust-filters/huesaturation.d.ts +0 -1
- package/dist/passes/postprocessing/image-adjust-filters/huesaturation.d.ts.map +1 -1
- package/dist/passes/postprocessing/image-adjust-filters/huesaturation.js +0 -1
- package/dist/passes/postprocessing/image-adjust-filters/vibrance.d.ts +3 -0
- package/dist/passes/postprocessing/image-adjust-filters/vibrance.d.ts.map +1 -1
- package/dist/passes/postprocessing/image-adjust-filters/vibrance.js +3 -0
- package/dist/passes/postprocessing/image-blur-filters/tiltshift.d.ts +2 -2
- package/dist/passes/postprocessing/image-blur-filters/tiltshift.d.ts.map +1 -1
- package/dist/passes/postprocessing/image-blur-filters/triangleblur.d.ts +1 -1
- package/dist/passes/postprocessing/image-blur-filters/triangleblur.d.ts.map +1 -1
- package/dist/passes/postprocessing/image-blur-filters/zoomblur.d.ts +1 -1
- package/dist/passes/postprocessing/image-blur-filters/zoomblur.d.ts.map +1 -1
- package/dist/passes/postprocessing/image-fun-filters/colorhalftone.d.ts +1 -1
- package/dist/passes/postprocessing/image-fun-filters/colorhalftone.d.ts.map +1 -1
- package/dist/passes/postprocessing/image-fun-filters/dotscreen.d.ts +1 -1
- package/dist/passes/postprocessing/image-fun-filters/dotscreen.d.ts.map +1 -1
- package/dist/passes/postprocessing/image-fun-filters/edgework.d.ts +15 -11
- package/dist/passes/postprocessing/image-fun-filters/edgework.d.ts.map +1 -1
- package/dist/passes/postprocessing/image-fun-filters/edgework.js +24 -12
- package/dist/passes/postprocessing/image-fun-filters/hexagonalpixelate.d.ts +1 -1
- package/dist/passes/postprocessing/image-fun-filters/hexagonalpixelate.d.ts.map +1 -1
- package/dist/passes/postprocessing/image-fun-filters/magnify.d.ts +2 -2
- package/dist/passes/postprocessing/image-fun-filters/magnify.d.ts.map +1 -1
- package/dist/passes/postprocessing/image-warp-filters/bulgepinch.d.ts +1 -1
- package/dist/passes/postprocessing/image-warp-filters/bulgepinch.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/index.ts +9 -3
- package/src/lib/shader-module/shader-module.ts +31 -20
- package/src/lib/shader-module/shader-pass.ts +7 -4
- package/src/lib/utils/uniform-types.ts +66 -0
- package/src/modules/engine/picking/picking.ts +9 -9
- package/src/modules/engine/project/project.ts +10 -9
- package/src/modules/lighting/gouraud-material/gouraud-material.ts +14 -12
- package/src/modules/lighting/lights/lighting-uniforms-glsl.ts +35 -12
- package/src/modules/lighting/lights/lighting.ts +83 -54
- package/src/modules/lighting/no-material/dirlight.ts +3 -3
- package/src/modules/lighting/pbr-material/pbr-fragment-glsl.ts +56 -60
- package/src/modules/lighting/pbr-material/pbr-material.ts +40 -74
- package/src/modules/lighting/pbr-material/pbr-projection.ts +39 -0
- package/src/modules/lighting/pbr-material/pbr-vertex-glsl.ts +8 -16
- package/src/modules/lighting/phong-material/phong-material.ts +12 -12
- package/src/modules/lighting/phong-material/phong-shaders-glsl.ts +8 -88
- package/src/modules-webgl1/project/project.ts +8 -7
- package/src/passes/postprocessing/fxaa/fxaa.ts +2 -2
- package/src/passes/postprocessing/image-adjust-filters/brightnesscontrast.ts +0 -1
- package/src/passes/postprocessing/image-adjust-filters/huesaturation.ts +0 -1
- package/src/passes/postprocessing/image-adjust-filters/vibrance.ts +3 -0
- package/src/passes/postprocessing/image-blur-filters/tiltshift.ts +2 -2
- package/src/passes/postprocessing/image-blur-filters/triangleblur.ts +1 -1
- package/src/passes/postprocessing/image-blur-filters/zoomblur.ts +1 -1
- package/src/passes/postprocessing/image-fun-filters/colorhalftone.ts +1 -1
- package/src/passes/postprocessing/image-fun-filters/dotscreen.ts +1 -1
- package/src/passes/postprocessing/image-fun-filters/edgework.ts +26 -15
- package/src/passes/postprocessing/image-fun-filters/hexagonalpixelate.ts +1 -1
- package/src/passes/postprocessing/image-fun-filters/magnify.ts +2 -2
- package/src/passes/postprocessing/image-warp-filters/bulgepinch.ts +1 -1
- package/dist/modules/lighting/gouraud-material/gouraud-shaders-glsl.d.ts +0 -42
- package/dist/modules/lighting/gouraud-material/gouraud-shaders-glsl.d.ts.map +0 -1
- package/dist/modules/lighting/gouraud-material/gouraud-shaders-glsl.js +0 -134
- package/src/modules/lighting/gouraud-material/gouraud-shaders-glsl.ts +0 -137
|
@@ -2,13 +2,14 @@
|
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
// Copyright (c) vis.gl contributors
|
|
4
4
|
|
|
5
|
-
import
|
|
5
|
+
import {log} from '@luma.gl/core';
|
|
6
6
|
import {ShaderModule} from '../../../lib/shader-module/shader-module';
|
|
7
7
|
import {lightingUniformsGLSL} from './lighting-uniforms-glsl';
|
|
8
8
|
import {lightingUniformsWGSL} from './lighting-uniforms-wgsl';
|
|
9
|
+
import type {NumberArray3} from '@math.gl/core';
|
|
9
10
|
|
|
10
11
|
/** Max number of supported lights (in addition to ambient light */
|
|
11
|
-
const MAX_LIGHTS =
|
|
12
|
+
const MAX_LIGHTS = 3;
|
|
12
13
|
|
|
13
14
|
/** Whether to divide */
|
|
14
15
|
const COLOR_FACTOR = 255.0;
|
|
@@ -26,23 +27,22 @@ export type Light = AmbientLight | PointLight | DirectionalLight;
|
|
|
26
27
|
|
|
27
28
|
export type AmbientLight = {
|
|
28
29
|
type: 'ambient';
|
|
29
|
-
color?: Readonly<
|
|
30
|
+
color?: Readonly<NumberArray3>;
|
|
30
31
|
intensity?: number;
|
|
31
32
|
};
|
|
32
33
|
|
|
33
34
|
export type PointLight = {
|
|
34
35
|
type: 'point';
|
|
35
|
-
position: Readonly<
|
|
36
|
-
color?: Readonly<
|
|
36
|
+
position: Readonly<NumberArray3>;
|
|
37
|
+
color?: Readonly<NumberArray3>;
|
|
37
38
|
intensity?: number;
|
|
38
|
-
attenuation?:
|
|
39
|
+
attenuation?: Readonly<NumberArray3>;
|
|
39
40
|
};
|
|
40
41
|
|
|
41
42
|
export type DirectionalLight = {
|
|
42
43
|
type: 'directional';
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
color?: Readonly<NumberArray>;
|
|
44
|
+
direction: Readonly<NumberArray3>;
|
|
45
|
+
color?: Readonly<NumberArray3>;
|
|
46
46
|
intensity?: number;
|
|
47
47
|
};
|
|
48
48
|
|
|
@@ -59,13 +59,22 @@ export type LightingProps = {
|
|
|
59
59
|
|
|
60
60
|
export type LightingUniforms = {
|
|
61
61
|
enabled: number;
|
|
62
|
-
ambientLightColor: Readonly<
|
|
63
|
-
|
|
62
|
+
ambientLightColor: Readonly<NumberArray3>;
|
|
63
|
+
directionalLightCount: number;
|
|
64
|
+
pointLightCount: number;
|
|
64
65
|
lightType: number; // [];
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
66
|
+
lightColor0: Readonly<NumberArray3>;
|
|
67
|
+
lightPosition0: Readonly<NumberArray3>;
|
|
68
|
+
lightDirection0: Readonly<NumberArray3>;
|
|
69
|
+
lightAttenuation0: Readonly<NumberArray3>;
|
|
70
|
+
lightColor1: Readonly<NumberArray3>;
|
|
71
|
+
lightPosition1: Readonly<NumberArray3>;
|
|
72
|
+
lightDirection1: Readonly<NumberArray3>;
|
|
73
|
+
lightAttenuation1: Readonly<NumberArray3>;
|
|
74
|
+
lightColor2: Readonly<NumberArray3>;
|
|
75
|
+
lightPosition2: Readonly<NumberArray3>;
|
|
76
|
+
lightDirection2: Readonly<NumberArray3>;
|
|
77
|
+
lightAttenuation2: Readonly<NumberArray3>;
|
|
69
78
|
};
|
|
70
79
|
|
|
71
80
|
/** UBO ready lighting module */
|
|
@@ -81,33 +90,59 @@ export const lighting = {
|
|
|
81
90
|
|
|
82
91
|
uniformTypes: {
|
|
83
92
|
enabled: 'i32',
|
|
93
|
+
lightType: 'i32',
|
|
94
|
+
|
|
95
|
+
directionalLightCount: 'i32',
|
|
96
|
+
pointLightCount: 'i32',
|
|
97
|
+
|
|
84
98
|
ambientLightColor: 'vec3<f32>',
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
99
|
+
|
|
100
|
+
// TODO define as arrays once we have appropriate uniformTypes
|
|
101
|
+
lightColor0: 'vec3<f32>',
|
|
102
|
+
lightPosition0: 'vec3<f32>',
|
|
89
103
|
// TODO - could combine direction and attenuation
|
|
90
|
-
|
|
91
|
-
|
|
104
|
+
lightDirection0: 'vec3<f32>',
|
|
105
|
+
lightAttenuation0: 'vec3<f32>',
|
|
106
|
+
|
|
107
|
+
lightColor1: 'vec3<f32>',
|
|
108
|
+
lightPosition1: 'vec3<f32>',
|
|
109
|
+
lightDirection1: 'vec3<f32>',
|
|
110
|
+
lightAttenuation1: 'vec3<f32>',
|
|
111
|
+
lightColor2: 'vec3<f32>',
|
|
112
|
+
lightPosition2: 'vec3<f32>',
|
|
113
|
+
lightDirection2: 'vec3<f32>',
|
|
114
|
+
lightAttenuation2: 'vec3<f32>'
|
|
92
115
|
},
|
|
93
116
|
|
|
94
117
|
defaultUniforms: {
|
|
95
118
|
enabled: 1,
|
|
96
|
-
ambientLightColor: [0.1, 0.1, 0.1],
|
|
97
|
-
numberOfLights: 0,
|
|
98
119
|
lightType: LIGHT_TYPE.POINT,
|
|
99
|
-
|
|
100
|
-
|
|
120
|
+
|
|
121
|
+
directionalLightCount: 0,
|
|
122
|
+
pointLightCount: 0,
|
|
123
|
+
|
|
124
|
+
ambientLightColor: [0.1, 0.1, 0.1],
|
|
125
|
+
lightColor0: [1, 1, 1],
|
|
126
|
+
lightPosition0: [1, 1, 2],
|
|
101
127
|
// TODO - could combine direction and attenuation
|
|
102
|
-
|
|
103
|
-
|
|
128
|
+
lightDirection0: [1, 1, 1],
|
|
129
|
+
lightAttenuation0: [1, 0, 0],
|
|
130
|
+
|
|
131
|
+
lightColor1: [1, 1, 1],
|
|
132
|
+
lightPosition1: [1, 1, 2],
|
|
133
|
+
lightDirection1: [1, 1, 1],
|
|
134
|
+
lightAttenuation1: [1, 0, 0],
|
|
135
|
+
lightColor2: [1, 1, 1],
|
|
136
|
+
lightPosition2: [1, 1, 2],
|
|
137
|
+
lightDirection2: [1, 1, 1],
|
|
138
|
+
lightAttenuation2: [1, 0, 0]
|
|
104
139
|
},
|
|
105
140
|
source: lightingUniformsWGSL,
|
|
106
141
|
vs: lightingUniformsGLSL,
|
|
107
142
|
fs: lightingUniformsGLSL,
|
|
108
143
|
|
|
109
144
|
getUniforms
|
|
110
|
-
} as const satisfies ShaderModule<LightingProps, LightingUniforms>;
|
|
145
|
+
} as const satisfies ShaderModule<LightingProps, LightingUniforms, {}>;
|
|
111
146
|
|
|
112
147
|
function getUniforms(
|
|
113
148
|
props?: LightingProps,
|
|
@@ -155,43 +190,37 @@ function getLightSourceUniforms({
|
|
|
155
190
|
pointLights = [],
|
|
156
191
|
directionalLights = []
|
|
157
192
|
}: LightingProps): Partial<LightingUniforms> {
|
|
158
|
-
const lightSourceUniforms: Partial<LightingUniforms> = {
|
|
159
|
-
// lightType: new Array(MAX_LIGHTS).fill(0),
|
|
160
|
-
// lightColor: new Array(MAX_LIGHTS).fill([0, 0, 0]),
|
|
161
|
-
// lightPosition: new Array(MAX_LIGHTS).fill([0, 0, 0]),
|
|
162
|
-
// lightDirection: new Array(MAX_LIGHTS).fill([0, 0, 0]),
|
|
163
|
-
// lightAttenuation: new Array(MAX_LIGHTS).fill([0, 0, 0])
|
|
164
|
-
};
|
|
193
|
+
const lightSourceUniforms: Partial<LightingUniforms> = {};
|
|
165
194
|
|
|
166
195
|
lightSourceUniforms.ambientLightColor = convertColor(ambientLight);
|
|
167
196
|
|
|
168
|
-
let currentLight = 0;
|
|
197
|
+
let currentLight: 0 | 1 | 2 = 0;
|
|
169
198
|
|
|
170
199
|
for (const pointLight of pointLights) {
|
|
171
|
-
// lightSourceUniforms.lightType[currentLight] = LIGHT_TYPE.POINT;
|
|
172
|
-
// lightSourceUniforms.lightColor[currentLight] = convertColor(pointLight);
|
|
173
|
-
// lightSourceUniforms.lightPosition[currentLight] = pointLight.position;
|
|
174
|
-
// lightSourceUniforms.lightAttenuation[currentLight] = [pointLight.attenuation || 1, 0, 0];
|
|
175
200
|
lightSourceUniforms.lightType = LIGHT_TYPE.POINT;
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
lightSourceUniforms
|
|
201
|
+
|
|
202
|
+
const i = currentLight as 0 | 1 | 2;
|
|
203
|
+
lightSourceUniforms[`lightColor${i}`] = convertColor(pointLight);
|
|
204
|
+
lightSourceUniforms[`lightPosition${i}`] = pointLight.position;
|
|
205
|
+
lightSourceUniforms[`lightAttenuation${i}`] = pointLight.attenuation || [1, 0, 0];
|
|
179
206
|
currentLight++;
|
|
180
207
|
}
|
|
181
208
|
|
|
182
209
|
for (const directionalLight of directionalLights) {
|
|
183
|
-
// lightSourceUniforms.lightType[currentLight] = LIGHT_TYPE.DIRECTIONAL;
|
|
184
|
-
// lightSourceUniforms.lightColor[currentLight] = convertColor(directionalLight);
|
|
185
|
-
// lightSourceUniforms.lightPosition[currentLight] = directionalLight.position;
|
|
186
|
-
// lightSourceUniforms.lightDirection[currentLight] = directionalLight.direction;
|
|
187
210
|
lightSourceUniforms.lightType = LIGHT_TYPE.DIRECTIONAL;
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
lightSourceUniforms
|
|
211
|
+
|
|
212
|
+
const i = currentLight as 0 | 1 | 2;
|
|
213
|
+
lightSourceUniforms[`lightColor${i}`] = convertColor(directionalLight);
|
|
214
|
+
lightSourceUniforms[`lightDirection${i}`] = directionalLight.direction;
|
|
191
215
|
currentLight++;
|
|
192
216
|
}
|
|
193
217
|
|
|
194
|
-
|
|
218
|
+
if (currentLight > MAX_LIGHTS) {
|
|
219
|
+
log.warn('MAX_LIGHTS exceeded')();
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
lightSourceUniforms.directionalLightCount = directionalLights.length;
|
|
223
|
+
lightSourceUniforms.pointLightCount = pointLights.length;
|
|
195
224
|
|
|
196
225
|
return lightSourceUniforms;
|
|
197
226
|
}
|
|
@@ -221,8 +250,8 @@ function extractLightTypes(lights: Light[]): LightingProps {
|
|
|
221
250
|
|
|
222
251
|
/** Take color 0-255 and intensity as input and output 0.0-1.0 range */
|
|
223
252
|
function convertColor(
|
|
224
|
-
colorDef: {color?: Readonly<
|
|
225
|
-
):
|
|
253
|
+
colorDef: {color?: Readonly<NumberArray3>; intensity?: number} = {}
|
|
254
|
+
): NumberArray3 {
|
|
226
255
|
const {color = [0, 0, 0], intensity = 1.0} = colorDef;
|
|
227
|
-
return color.map(component => (component * intensity) / COLOR_FACTOR);
|
|
256
|
+
return color.map(component => (component * intensity) / COLOR_FACTOR) as NumberArray3;
|
|
228
257
|
}
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
// Copyright (c) vis.gl contributors
|
|
4
4
|
|
|
5
|
-
import type {Vector3Like
|
|
5
|
+
import type {Vector3Like} from '@math.gl/core';
|
|
6
6
|
import {ShaderModule} from '../../../lib/shader-module/shader-module';
|
|
7
7
|
|
|
8
8
|
export type DirlightProps = {
|
|
9
|
-
lightDirection?: Vector3Like
|
|
9
|
+
lightDirection?: Vector3Like;
|
|
10
10
|
};
|
|
11
11
|
|
|
12
12
|
export type DirlightUniforms = DirlightProps;
|
|
@@ -85,7 +85,7 @@ export const dirlight = {
|
|
|
85
85
|
lightDirection: 'vec3<f32>'
|
|
86
86
|
},
|
|
87
87
|
defaultUniforms: {
|
|
88
|
-
lightDirection:
|
|
88
|
+
lightDirection: [1, 1, 2]
|
|
89
89
|
},
|
|
90
90
|
getUniforms
|
|
91
91
|
} as const satisfies ShaderModule<DirlightProps, DirlightUniforms>;
|
|
@@ -13,12 +13,7 @@
|
|
|
13
13
|
export const fs = /* glsl */ `\
|
|
14
14
|
precision highp float;
|
|
15
15
|
|
|
16
|
-
uniform
|
|
17
|
-
// Projection
|
|
18
|
-
uniform vec3 u_Camera;
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
uniform pbrMaterial {
|
|
16
|
+
uniform pbrMaterialUniforms {
|
|
22
17
|
// Material is unlit
|
|
23
18
|
bool unlit;
|
|
24
19
|
|
|
@@ -50,40 +45,40 @@ uniform pbrMaterial {
|
|
|
50
45
|
vec4 scaleDiffBaseMR;
|
|
51
46
|
vec4 scaleFGDSpec;
|
|
52
47
|
// #endif
|
|
53
|
-
}
|
|
48
|
+
} pbrMaterial;
|
|
54
49
|
|
|
55
50
|
// Samplers
|
|
56
51
|
#ifdef HAS_BASECOLORMAP
|
|
57
|
-
uniform sampler2D
|
|
52
|
+
uniform sampler2D pbr_baseColorSampler;
|
|
58
53
|
#endif
|
|
59
54
|
#ifdef HAS_NORMALMAP
|
|
60
|
-
uniform sampler2D
|
|
55
|
+
uniform sampler2D pbr_normalSampler;
|
|
61
56
|
#endif
|
|
62
57
|
#ifdef HAS_EMISSIVEMAP
|
|
63
|
-
uniform sampler2D
|
|
58
|
+
uniform sampler2D pbr_emissiveSampler;
|
|
64
59
|
#endif
|
|
65
60
|
#ifdef HAS_METALROUGHNESSMAP
|
|
66
|
-
uniform sampler2D
|
|
61
|
+
uniform sampler2D pbr_metallicRoughnessSampler;
|
|
67
62
|
#endif
|
|
68
63
|
#ifdef HAS_OCCLUSIONMAP
|
|
69
|
-
uniform sampler2D
|
|
64
|
+
uniform sampler2D pbr_occlusionSampler;
|
|
70
65
|
#endif
|
|
71
66
|
#ifdef USE_IBL
|
|
72
|
-
uniform samplerCube
|
|
73
|
-
uniform samplerCube
|
|
74
|
-
uniform sampler2D
|
|
67
|
+
uniform samplerCube pbr_diffuseEnvSampler;
|
|
68
|
+
uniform samplerCube pbr_specularEnvSampler;
|
|
69
|
+
uniform sampler2D pbr_brdfLUT;
|
|
75
70
|
#endif
|
|
76
71
|
|
|
77
72
|
// Inputs from vertex shader
|
|
78
73
|
|
|
79
|
-
|
|
80
|
-
|
|
74
|
+
in vec3 pbr_vPosition;
|
|
75
|
+
in vec2 pbr_vUV;
|
|
81
76
|
|
|
82
77
|
#ifdef HAS_NORMALS
|
|
83
78
|
#ifdef HAS_TANGENTS
|
|
84
|
-
|
|
79
|
+
in mat3 pbr_vTBN;
|
|
85
80
|
#else
|
|
86
|
-
|
|
81
|
+
in vec3 pbr_vNormal;
|
|
87
82
|
#endif
|
|
88
83
|
#endif
|
|
89
84
|
|
|
@@ -151,8 +146,8 @@ vec3 getNormal()
|
|
|
151
146
|
#endif
|
|
152
147
|
|
|
153
148
|
#ifdef HAS_NORMALMAP
|
|
154
|
-
vec3 n =
|
|
155
|
-
n = normalize(tbn * ((2.0 * n - 1.0) * vec3(
|
|
149
|
+
vec3 n = texture(pbr_normalSampler, pbr_vUV).rgb;
|
|
150
|
+
n = normalize(tbn * ((2.0 * n - 1.0) * vec3(pbrMaterial.normalScale, pbrMaterial.normalScale, 1.0)));
|
|
156
151
|
#else
|
|
157
152
|
// The tbn matrix is linearly interpolated, so we need to re-normalize
|
|
158
153
|
vec3 n = normalize(tbn[2].xyz);
|
|
@@ -170,22 +165,22 @@ vec3 getIBLContribution(PBRInfo pbrInfo, vec3 n, vec3 reflection)
|
|
|
170
165
|
float mipCount = 9.0; // resolution of 512x512
|
|
171
166
|
float lod = (pbrInfo.perceptualRoughness * mipCount);
|
|
172
167
|
// retrieve a scale and bias to F0. See [1], Figure 3
|
|
173
|
-
vec3 brdf = SRGBtoLINEAR(
|
|
168
|
+
vec3 brdf = SRGBtoLINEAR(texture(pbr_brdfLUT,
|
|
174
169
|
vec2(pbrInfo.NdotV, 1.0 - pbrInfo.perceptualRoughness))).rgb;
|
|
175
|
-
vec3 diffuseLight = SRGBtoLINEAR(
|
|
170
|
+
vec3 diffuseLight = SRGBtoLINEAR(texture(pbr_diffuseEnvSampler, n)).rgb;
|
|
176
171
|
|
|
177
172
|
#ifdef USE_TEX_LOD
|
|
178
|
-
vec3 specularLight = SRGBtoLINEAR(
|
|
173
|
+
vec3 specularLight = SRGBtoLINEAR(texture(pbr_specularEnvSampler, reflection, lod)).rgb;
|
|
179
174
|
#else
|
|
180
|
-
vec3 specularLight = SRGBtoLINEAR(
|
|
175
|
+
vec3 specularLight = SRGBtoLINEAR(texture(pbr_specularEnvSampler, reflection)).rgb;
|
|
181
176
|
#endif
|
|
182
177
|
|
|
183
178
|
vec3 diffuse = diffuseLight * pbrInfo.diffuseColor;
|
|
184
179
|
vec3 specular = specularLight * (pbrInfo.specularColor * brdf.x + brdf.y);
|
|
185
180
|
|
|
186
181
|
// For presentation, this allows us to disable IBL terms
|
|
187
|
-
diffuse *=
|
|
188
|
-
specular *=
|
|
182
|
+
diffuse *= pbrMaterial.scaleIBLAmbient.x;
|
|
183
|
+
specular *= pbrMaterial.scaleIBLAmbient.y;
|
|
189
184
|
|
|
190
185
|
return diffuse + specular;
|
|
191
186
|
}
|
|
@@ -277,32 +272,32 @@ vec4 pbr_filterColor(vec4 colorUnused)
|
|
|
277
272
|
{
|
|
278
273
|
// The albedo may be defined from a base texture or a flat color
|
|
279
274
|
#ifdef HAS_BASECOLORMAP
|
|
280
|
-
vec4 baseColor = SRGBtoLINEAR(
|
|
275
|
+
vec4 baseColor = SRGBtoLINEAR(texture(pbr_baseColorSampler, pbr_vUV)) * pbrMaterial.baseColorFactor;
|
|
281
276
|
#else
|
|
282
|
-
vec4 baseColor =
|
|
277
|
+
vec4 baseColor = pbrMaterial.baseColorFactor;
|
|
283
278
|
#endif
|
|
284
279
|
|
|
285
280
|
#ifdef ALPHA_CUTOFF
|
|
286
|
-
if (baseColor.a <
|
|
281
|
+
if (baseColor.a < pbrMaterial.alphaCutoff) {
|
|
287
282
|
discard;
|
|
288
283
|
}
|
|
289
284
|
#endif
|
|
290
285
|
|
|
291
286
|
vec3 color = vec3(0, 0, 0);
|
|
292
287
|
|
|
293
|
-
if(
|
|
288
|
+
if(pbrMaterial.unlit){
|
|
294
289
|
color.rgb = baseColor.rgb;
|
|
295
290
|
}
|
|
296
291
|
else{
|
|
297
292
|
// Metallic and Roughness material properties are packed together
|
|
298
293
|
// In glTF, these factors can be specified by fixed scalar values
|
|
299
294
|
// or from a metallic-roughness map
|
|
300
|
-
float perceptualRoughness =
|
|
301
|
-
float metallic =
|
|
295
|
+
float perceptualRoughness = pbrMaterial.metallicRoughnessValues.y;
|
|
296
|
+
float metallic = pbrMaterial.metallicRoughnessValues.x;
|
|
302
297
|
#ifdef HAS_METALROUGHNESSMAP
|
|
303
298
|
// Roughness is stored in the 'g' channel, metallic is stored in the 'b' channel.
|
|
304
299
|
// This layout intentionally reserves the 'r' channel for (optional) occlusion map data
|
|
305
|
-
vec4 mrSample =
|
|
300
|
+
vec4 mrSample = texture(pbr_metallicRoughnessSampler, pbr_vUV);
|
|
306
301
|
perceptualRoughness = mrSample.g * perceptualRoughness;
|
|
307
302
|
metallic = mrSample.b * metallic;
|
|
308
303
|
#endif
|
|
@@ -329,7 +324,7 @@ vec4 pbr_filterColor(vec4 colorUnused)
|
|
|
329
324
|
vec3 specularEnvironmentR90 = vec3(1.0, 1.0, 1.0) * reflectance90;
|
|
330
325
|
|
|
331
326
|
vec3 n = getNormal(); // normal at surface point
|
|
332
|
-
vec3 v = normalize(
|
|
327
|
+
vec3 v = normalize(pbrProjection.camera - pbr_vPosition); // Vector from surface point to camera
|
|
333
328
|
|
|
334
329
|
float NdotV = clamp(abs(dot(n, v)), 0.001, 1.0);
|
|
335
330
|
vec3 reflection = -normalize(reflect(v, n));
|
|
@@ -351,47 +346,48 @@ vec4 pbr_filterColor(vec4 colorUnused)
|
|
|
351
346
|
v
|
|
352
347
|
);
|
|
353
348
|
|
|
349
|
+
|
|
354
350
|
#ifdef USE_LIGHTS
|
|
355
351
|
// Apply ambient light
|
|
356
352
|
PBRInfo_setAmbientLight(pbrInfo);
|
|
357
|
-
color += calculateFinalColor(pbrInfo,
|
|
353
|
+
color += calculateFinalColor(pbrInfo, lighting.ambientColor);
|
|
358
354
|
|
|
359
355
|
// Apply directional light
|
|
360
|
-
for(int i = 0; i <
|
|
361
|
-
if (i <
|
|
362
|
-
PBRInfo_setDirectionalLight(pbrInfo,
|
|
363
|
-
color += calculateFinalColor(pbrInfo,
|
|
356
|
+
for(int i = 0; i < lighting.directionalLightCount; i++) {
|
|
357
|
+
if (i < lighting.directionalLightCount) {
|
|
358
|
+
PBRInfo_setDirectionalLight(pbrInfo, lighting_getDirectionalLight(i).direction);
|
|
359
|
+
color += calculateFinalColor(pbrInfo, lighting_getDirectionalLight(i).color);
|
|
364
360
|
}
|
|
365
361
|
}
|
|
366
362
|
|
|
367
363
|
// Apply point light
|
|
368
|
-
for(int i = 0; i <
|
|
369
|
-
if (i <
|
|
370
|
-
PBRInfo_setPointLight(pbrInfo,
|
|
371
|
-
float attenuation = getPointLightAttenuation(
|
|
372
|
-
color += calculateFinalColor(pbrInfo,
|
|
364
|
+
for(int i = 0; i < lighting.pointLightCount; i++) {
|
|
365
|
+
if (i < lighting.pointLightCount) {
|
|
366
|
+
PBRInfo_setPointLight(pbrInfo, lighting_getPointLight(i));
|
|
367
|
+
float attenuation = getPointLightAttenuation(lighting_getPointLight(i), distance(lighting_getPointLight(i).position, pbr_vPosition));
|
|
368
|
+
color += calculateFinalColor(pbrInfo, lighting_getPointLight(i).color / attenuation);
|
|
373
369
|
}
|
|
374
370
|
}
|
|
375
371
|
#endif
|
|
376
372
|
|
|
377
373
|
// Calculate lighting contribution from image based lighting source (IBL)
|
|
378
374
|
#ifdef USE_IBL
|
|
379
|
-
if (
|
|
375
|
+
if (pbrMaterial.IBLenabled) {
|
|
380
376
|
color += getIBLContribution(pbrInfo, n, reflection);
|
|
381
377
|
}
|
|
382
378
|
#endif
|
|
383
379
|
|
|
384
|
-
|
|
380
|
+
// Apply optional PBR terms for additional (optional) shading
|
|
385
381
|
#ifdef HAS_OCCLUSIONMAP
|
|
386
|
-
if (
|
|
387
|
-
float ao =
|
|
388
|
-
color = mix(color, color * ao,
|
|
382
|
+
if (pbrMaterial.occlusionMapEnabled) {
|
|
383
|
+
float ao = texture(pbr_occlusionSampler, pbr_vUV).r;
|
|
384
|
+
color = mix(color, color * ao, pbrMaterial.occlusionStrength);
|
|
389
385
|
}
|
|
390
386
|
#endif
|
|
391
387
|
|
|
392
388
|
#ifdef HAS_EMISSIVEMAP
|
|
393
|
-
if (
|
|
394
|
-
vec3 emissive = SRGBtoLINEAR(
|
|
389
|
+
if (pbrMaterial.emissiveMapEnabled) {
|
|
390
|
+
vec3 emissive = SRGBtoLINEAR(texture(pbr_emissiveSampler, pbr_vUV)).rgb * pbrMaterial.emissiveFactor;
|
|
395
391
|
color += emissive;
|
|
396
392
|
}
|
|
397
393
|
#endif
|
|
@@ -401,15 +397,15 @@ vec4 pbr_filterColor(vec4 colorUnused)
|
|
|
401
397
|
#ifdef PBR_DEBUG
|
|
402
398
|
// TODO: Figure out how to debug multiple lights
|
|
403
399
|
|
|
404
|
-
// color = mix(color, F,
|
|
405
|
-
// color = mix(color, vec3(G),
|
|
406
|
-
// color = mix(color, vec3(D),
|
|
407
|
-
// color = mix(color, specContrib,
|
|
400
|
+
// color = mix(color, F, pbr_scaleFGDSpec.x);
|
|
401
|
+
// color = mix(color, vec3(G), pbr_scaleFGDSpec.y);
|
|
402
|
+
// color = mix(color, vec3(D), pbr_scaleFGDSpec.z);
|
|
403
|
+
// color = mix(color, specContrib, pbr_scaleFGDSpec.w);
|
|
408
404
|
|
|
409
|
-
// color = mix(color, diffuseContrib,
|
|
410
|
-
color = mix(color, baseColor.rgb,
|
|
411
|
-
color = mix(color, vec3(metallic),
|
|
412
|
-
color = mix(color, vec3(perceptualRoughness),
|
|
405
|
+
// color = mix(color, diffuseContrib, pbr_scaleDiffBaseMR.x);
|
|
406
|
+
color = mix(color, baseColor.rgb, pbrMaterial.scaleDiffBaseMR.y);
|
|
407
|
+
color = mix(color, vec3(metallic), pbrMaterial.scaleDiffBaseMR.z);
|
|
408
|
+
color = mix(color, vec3(perceptualRoughness), pbrMaterial.scaleDiffBaseMR.w);
|
|
413
409
|
#endif
|
|
414
410
|
|
|
415
411
|
}
|
|
@@ -4,61 +4,36 @@
|
|
|
4
4
|
|
|
5
5
|
/* eslint-disable camelcase */
|
|
6
6
|
|
|
7
|
-
import type {NumberArray} from '@math.gl/types';
|
|
8
7
|
import type {Texture} from '@luma.gl/core';
|
|
9
|
-
import type {
|
|
8
|
+
import type {
|
|
9
|
+
Vector2,
|
|
10
|
+
Vector3,
|
|
11
|
+
Vector4,
|
|
12
|
+
NumberArray2,
|
|
13
|
+
NumberArray3,
|
|
14
|
+
NumberArray4
|
|
15
|
+
} from '@math.gl/core';
|
|
10
16
|
|
|
11
17
|
import {ShaderModule} from '../../../lib/shader-module/shader-module';
|
|
12
18
|
import {lighting} from '../lights/lighting';
|
|
13
19
|
|
|
14
20
|
import {vs} from './pbr-vertex-glsl';
|
|
15
21
|
import {fs} from './pbr-fragment-glsl';
|
|
16
|
-
|
|
17
|
-
export type PBRMaterialProps = PBRMaterialBindings & {
|
|
18
|
-
unlit?: boolean;
|
|
19
|
-
|
|
20
|
-
// Base color map
|
|
21
|
-
baseColorMapEnabled?: boolean;
|
|
22
|
-
baseColorFactor?: Readonly<Vector4 | NumberArray>;
|
|
23
|
-
|
|
24
|
-
normalMapEnabled?: boolean;
|
|
25
|
-
normalScale?: number; // #ifdef HAS_NORMALMAP
|
|
26
|
-
|
|
27
|
-
emissiveMapEnabled?: boolean;
|
|
28
|
-
emissiveFactor?: Readonly<Vector3 | NumberArray>; // #ifdef HAS_EMISSIVEMAP
|
|
29
|
-
|
|
30
|
-
metallicRoughnessValues?: Readonly<Vector2 | NumberArray>;
|
|
31
|
-
metallicRoughnessMapEnabled?: boolean;
|
|
32
|
-
|
|
33
|
-
occlusionMapEnabled?: boolean;
|
|
34
|
-
occlusionStrength?: number; // #ifdef HAS_OCCLUSIONMAP
|
|
35
|
-
|
|
36
|
-
alphaCutoffEnabled?: boolean;
|
|
37
|
-
alphaCutoff?: number; // #ifdef ALPHA_CUTOFF
|
|
38
|
-
|
|
39
|
-
// IBL
|
|
40
|
-
IBLenabled?: boolean;
|
|
41
|
-
scaleIBLAmbient?: Readonly<Vector2 | NumberArray>; // #ifdef USE_IBL
|
|
42
|
-
|
|
43
|
-
// debugging flags used for shader output of intermediate PBR variables
|
|
44
|
-
// #ifdef PBR_DEBUG
|
|
45
|
-
scaleDiffBaseMR?: Readonly<Vector4 | NumberArray>;
|
|
46
|
-
scaleFGDSpec?: Readonly<Vector4 | NumberArray>;
|
|
47
|
-
};
|
|
22
|
+
import {pbrProjection} from './pbr-projection';
|
|
48
23
|
|
|
49
24
|
/** Non-uniform block bindings for pbr module */
|
|
50
|
-
type PBRMaterialBindings = {
|
|
25
|
+
export type PBRMaterialBindings = {
|
|
51
26
|
// Samplers
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
27
|
+
pbr_baseColorSampler?: Texture | null; // #ifdef HAS_BASECOLORMAP
|
|
28
|
+
pbr_normalSampler?: Texture | null; // #ifdef HAS_NORMALMAP
|
|
29
|
+
pbr_emissiveSampler?: Texture | null; // #ifdef HAS_EMISSIVEMAP
|
|
30
|
+
pbr_metallicRoughnessSampler?: Texture | null; // #ifdef HAS_METALROUGHNESSMAP
|
|
31
|
+
pbr_occlusionSampler?: Texture | null; // #ifdef HAS_OCCLUSIONMAP
|
|
57
32
|
|
|
58
33
|
// IBL Samplers
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
34
|
+
pbr_diffuseEnvSampler?: Texture | null; // #ifdef USE_IBL (samplerCube)
|
|
35
|
+
pbr_specularEnvSampler?: Texture | null; // #ifdef USE_IBL (samplerCube)
|
|
36
|
+
pbr_BrdfLUT?: Texture | null; // #ifdef USE_IBL
|
|
62
37
|
};
|
|
63
38
|
|
|
64
39
|
export type PBRMaterialUniforms = {
|
|
@@ -66,15 +41,15 @@ export type PBRMaterialUniforms = {
|
|
|
66
41
|
|
|
67
42
|
// Base color map
|
|
68
43
|
baseColorMapEnabled?: boolean;
|
|
69
|
-
baseColorFactor?: Readonly<Vector4 |
|
|
44
|
+
baseColorFactor?: Readonly<Vector4 | NumberArray4>;
|
|
70
45
|
|
|
71
46
|
normalMapEnabled?: boolean;
|
|
72
47
|
normalScale?: number; // #ifdef HAS_NORMALMAP
|
|
73
48
|
|
|
74
49
|
emissiveMapEnabled?: boolean;
|
|
75
|
-
emissiveFactor?: Readonly<Vector3 |
|
|
50
|
+
emissiveFactor?: Readonly<Vector3 | NumberArray3>; // #ifdef HAS_EMISSIVEMAP
|
|
76
51
|
|
|
77
|
-
metallicRoughnessValues?: Readonly<Vector2 |
|
|
52
|
+
metallicRoughnessValues?: Readonly<Vector2 | NumberArray2>;
|
|
78
53
|
metallicRoughnessMapEnabled?: boolean;
|
|
79
54
|
|
|
80
55
|
occlusionMapEnabled?: boolean;
|
|
@@ -85,14 +60,16 @@ export type PBRMaterialUniforms = {
|
|
|
85
60
|
|
|
86
61
|
// IBL
|
|
87
62
|
IBLenabled?: boolean;
|
|
88
|
-
scaleIBLAmbient?: Readonly<Vector2 |
|
|
63
|
+
scaleIBLAmbient?: Readonly<Vector2 | NumberArray2>; // #ifdef USE_IBL
|
|
89
64
|
|
|
90
65
|
// debugging flags used for shader output of intermediate PBR variables
|
|
91
66
|
// #ifdef PBR_DEBUG
|
|
92
|
-
scaleDiffBaseMR?: Readonly<Vector4 |
|
|
93
|
-
scaleFGDSpec?: Readonly<Vector4 |
|
|
67
|
+
scaleDiffBaseMR?: Readonly<Vector4 | NumberArray4>;
|
|
68
|
+
scaleFGDSpec?: Readonly<Vector4 | NumberArray4>;
|
|
94
69
|
};
|
|
95
70
|
|
|
71
|
+
export type PBRMaterialProps = PBRMaterialBindings & PBRMaterialUniforms;
|
|
72
|
+
|
|
96
73
|
/**
|
|
97
74
|
* An implementation of PBR (Physically-Based Rendering).
|
|
98
75
|
* Physically Based Shading of a microfacet surface defined by a glTF material.
|
|
@@ -101,23 +78,24 @@ export const pbrMaterial = {
|
|
|
101
78
|
props: {} as PBRMaterialProps,
|
|
102
79
|
uniforms: {} as PBRMaterialUniforms,
|
|
103
80
|
|
|
104
|
-
name: '
|
|
105
|
-
dependencies: [lighting],
|
|
81
|
+
name: 'pbrMaterial',
|
|
82
|
+
dependencies: [lighting, pbrProjection],
|
|
106
83
|
vs,
|
|
107
84
|
fs,
|
|
108
85
|
|
|
109
86
|
defines: {
|
|
110
|
-
LIGHTING_FRAGMENT: 1
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
87
|
+
LIGHTING_FRAGMENT: 1
|
|
88
|
+
// TODO defining these as 0 breaks shader
|
|
89
|
+
// HAS_NORMALMAP: 0
|
|
90
|
+
// HAS_EMISSIVEMAP: 0,
|
|
91
|
+
// HAS_OCCLUSIONMAP: 0,
|
|
92
|
+
// HAS_BASECOLORMAP: 0,
|
|
93
|
+
// HAS_METALROUGHNESSMAP: 0,
|
|
94
|
+
// ALPHA_CUTOFF: 0
|
|
95
|
+
// USE_IBL: 0
|
|
96
|
+
// PBR_DEBUG: 0
|
|
119
97
|
},
|
|
120
|
-
|
|
98
|
+
getUniforms: props => props,
|
|
121
99
|
uniformTypes: {
|
|
122
100
|
// Material is unlit
|
|
123
101
|
unlit: 'i32',
|
|
@@ -149,17 +127,5 @@ export const pbrMaterial = {
|
|
|
149
127
|
// #ifdef PBR_DEBUG
|
|
150
128
|
scaleDiffBaseMR: 'vec4<f32>',
|
|
151
129
|
scaleFGDSpec: 'vec4<f32>'
|
|
152
|
-
},
|
|
153
|
-
|
|
154
|
-
bindings: {
|
|
155
|
-
baseColorSampler: {type: 'texture', location: 8}, // #ifdef HAS_BASECOLORMAP
|
|
156
|
-
normalSampler: {type: 'texture', location: 9}, // #ifdef HAS_NORMALMAP
|
|
157
|
-
emissiveSampler: {type: 'texture', location: 10}, // #ifdef HAS_EMISSIVEMAP
|
|
158
|
-
metallicRoughnessSampler: {type: 'texture', location: 11}, // #ifdef HAS_METALROUGHNESSMAP
|
|
159
|
-
occlusionSampler: {type: 'texture', location: 12}, // #ifdef HAS_OCCLUSIONMAP
|
|
160
|
-
// IBL Samplers
|
|
161
|
-
diffuseEnvSampler: {type: 'texture', location: 13}, // #ifdef USE_IBL (samplerCube)
|
|
162
|
-
specularEnvSampler: {type: 'texture', location: 14}, // #ifdef USE_IBL (samplerCube)
|
|
163
|
-
brdfLUT: {type: 'texture', location: 15} // #ifdef USE_IBL
|
|
164
130
|
}
|
|
165
|
-
} as const satisfies ShaderModule<PBRMaterialProps, PBRMaterialUniforms>;
|
|
131
|
+
} as const satisfies ShaderModule<PBRMaterialProps, PBRMaterialUniforms, PBRMaterialBindings>;
|