@quake2ts/engine 0.0.811 → 0.0.814
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/browser/index.global.js +14 -1
- package/dist/browser/index.global.js.map +1 -1
- package/dist/cjs/index.cjs +14 -1
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/esm/index.js +14 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/render/skybox.d.ts +1 -1
- package/dist/types/render/skybox.d.ts.map +1 -1
- package/dist/types/render/webgpu/pipelines/skybox.d.ts +4 -1
- package/dist/types/render/webgpu/pipelines/skybox.d.ts.map +1 -1
- package/package.json +5 -5
|
@@ -350,7 +350,20 @@ uniform vec2 u_scroll;
|
|
|
350
350
|
out vec3 v_direction;
|
|
351
351
|
|
|
352
352
|
void main() {
|
|
353
|
-
|
|
353
|
+
// Transform Quake-space position/direction to GL-space direction for cubemap sampling.
|
|
354
|
+
// Quake Basis: X(Fwd), Y(Left), Z(Up)
|
|
355
|
+
// GL Basis (Cubemap): -Z(Front), -X(Left), +Y(Top)
|
|
356
|
+
// Mapping:
|
|
357
|
+
// Quake X (1,0,0) -> GL -Z (0,0,-1)
|
|
358
|
+
// Quake Y (0,1,0) -> GL -X (-1,0,0)
|
|
359
|
+
// Quake Z (0,0,1) -> GL Y (0,1,0)
|
|
360
|
+
vec3 dir = vec3(-a_position.y, a_position.z, -a_position.x);
|
|
361
|
+
|
|
362
|
+
// Normalize just in case, though a_position is on a cube surface.
|
|
363
|
+
// Actually, for a cubemap lookup, normalization isn't strictly required by the hardware
|
|
364
|
+
// (it grabs the vector direction), but good practice if we modify it.
|
|
365
|
+
dir = normalize(dir);
|
|
366
|
+
|
|
354
367
|
dir.xy += u_scroll;
|
|
355
368
|
v_direction = dir;
|
|
356
369
|
gl_Position = u_viewProjectionNoTranslation * vec4(a_position, 1.0);
|