quake2ts 0.0.234 → 0.0.236
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/package.json +1 -1
- package/packages/client/dist/browser/index.global.js +33 -5
- package/packages/client/dist/browser/index.global.js.map +1 -1
- package/packages/client/dist/cjs/index.cjs +31 -3
- package/packages/client/dist/cjs/index.cjs.map +1 -1
- package/packages/client/dist/esm/index.js +31 -3
- package/packages/client/dist/esm/index.js.map +1 -1
- package/packages/client/dist/tsconfig.tsbuildinfo +1 -1
- package/packages/engine/dist/browser/index.global.js +44 -13
- package/packages/engine/dist/browser/index.global.js.map +1 -1
- package/packages/engine/dist/cjs/index.cjs +39 -4
- package/packages/engine/dist/cjs/index.cjs.map +1 -1
- package/packages/engine/dist/esm/index.js +39 -4
- package/packages/engine/dist/esm/index.js.map +1 -1
- package/packages/engine/dist/tsconfig.tsbuildinfo +1 -1
- package/packages/engine/dist/types/render/bsp/geometry.d.ts +1 -0
- package/packages/engine/dist/types/render/bsp/geometry.d.ts.map +1 -1
- package/packages/engine/dist/types/render/bsp/renderer.d.ts.map +1 -1
- package/packages/engine/dist/types/render/bsp/surface.d.ts.map +1 -1
- package/packages/engine/dist/types/render/bspPipeline.d.ts +4 -2
- package/packages/engine/dist/types/render/bspPipeline.d.ts.map +1 -1
- package/packages/game/dist/browser/index.global.js +2 -2
- package/packages/game/dist/browser/index.global.js.map +1 -1
- package/packages/game/dist/cjs/index.cjs +18 -2
- package/packages/game/dist/cjs/index.cjs.map +1 -1
- package/packages/game/dist/esm/index.js +18 -2
- package/packages/game/dist/esm/index.js.map +1 -1
- package/packages/game/dist/tsconfig.tsbuildinfo +1 -1
- package/packages/game/dist/types/combat/weapons/firing.d.ts.map +1 -1
- package/packages/game/dist/types/combat/weapons/state.d.ts +1 -0
- package/packages/game/dist/types/combat/weapons/state.d.ts.map +1 -1
- package/packages/game/dist/types/entities/playerStats.d.ts.map +1 -1
- package/packages/game/dist/types/entities/projectiles.d.ts +1 -1
- package/packages/game/dist/types/entities/projectiles.d.ts.map +1 -1
- package/packages/game/dist/types/inventory/items.d.ts.map +1 -1
- package/packages/shared/dist/browser/index.global.js +1 -1
- package/packages/shared/dist/browser/index.global.js.map +1 -1
- package/packages/shared/dist/cjs/index.cjs +1 -0
- package/packages/shared/dist/cjs/index.cjs.map +1 -1
- package/packages/shared/dist/esm/index.js +1 -0
- package/packages/shared/dist/esm/index.js.map +1 -1
- package/packages/shared/dist/tsconfig.tsbuildinfo +1 -1
- package/packages/shared/dist/types/items/weapons.d.ts +1 -0
- package/packages/shared/dist/types/items/weapons.d.ts.map +1 -1
- package/packages/tools/dist/tsconfig.tsbuildinfo +1 -1
|
@@ -2393,11 +2393,13 @@ const int MAX_DLIGHTS = ${MAX_DLIGHTS};
|
|
|
2393
2393
|
|
|
2394
2394
|
in vec2 v_texCoord;
|
|
2395
2395
|
in vec2 v_lightmapCoord;
|
|
2396
|
+
in float v_lightmapStep;
|
|
2396
2397
|
in vec3 v_position;
|
|
2397
2398
|
|
|
2398
2399
|
uniform sampler2D u_diffuseMap;
|
|
2399
2400
|
uniform sampler2D u_lightmapAtlas;
|
|
2400
2401
|
uniform vec4 u_lightStyleFactors;
|
|
2402
|
+
uniform vec4 u_styleLayerMapping; // 0, 1, 2... or -1 if invalid
|
|
2401
2403
|
uniform float u_alpha;
|
|
2402
2404
|
uniform bool u_applyLightmap;
|
|
2403
2405
|
uniform bool u_warp;
|
|
@@ -2431,9 +2433,35 @@ void main() {
|
|
|
2431
2433
|
vec3 totalLight = vec3(1.0);
|
|
2432
2434
|
|
|
2433
2435
|
if (u_applyLightmap) {
|
|
2434
|
-
|
|
2435
|
-
|
|
2436
|
-
|
|
2436
|
+
// Multi-style lightmap accumulation
|
|
2437
|
+
vec3 light = vec3(0.0);
|
|
2438
|
+
bool hasLight = false;
|
|
2439
|
+
|
|
2440
|
+
vec2 lmBase = warpCoords(v_lightmapCoord);
|
|
2441
|
+
|
|
2442
|
+
// Loop unrolled-ish
|
|
2443
|
+
for (int i = 0; i < 4; i++) {
|
|
2444
|
+
// We can access vec4 components by index in newer GLSL ES, or use direct access
|
|
2445
|
+
float layer = u_styleLayerMapping[i];
|
|
2446
|
+
float factor = u_lightStyleFactors[i];
|
|
2447
|
+
|
|
2448
|
+
if (layer >= -0.5) { // Valid layer (check >= 0 approx)
|
|
2449
|
+
// Offset V by layer * step
|
|
2450
|
+
// Since we packed vertically
|
|
2451
|
+
vec2 offset = vec2(0.0, layer * v_lightmapStep);
|
|
2452
|
+
light += texture(u_lightmapAtlas, lmBase + offset).rgb * factor;
|
|
2453
|
+
hasLight = true;
|
|
2454
|
+
}
|
|
2455
|
+
}
|
|
2456
|
+
|
|
2457
|
+
// If no valid lightmaps found (e.g. unlit surface?), default to full bright?
|
|
2458
|
+
// Or if u_applyLightmap is true, there should be at least one style.
|
|
2459
|
+
// Fallback to 1.0 if accumulator is empty?
|
|
2460
|
+
// In Q2, unlit surfs are fullbright (or use minlight).
|
|
2461
|
+
// If hasLight is false, it means no styles are active.
|
|
2462
|
+
if (!hasLight) light = vec3(1.0);
|
|
2463
|
+
|
|
2464
|
+
totalLight = light; // Dynamic lights add on top or multiply? Q2 adds.
|
|
2437
2465
|
|
|
2438
2466
|
// Add dynamic lights
|
|
2439
2467
|
for (int i = 0; i < MAX_DLIGHTS; i++) {
|