quake2ts 0.0.510 → 0.0.512

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.
@@ -5924,6 +5924,7 @@ uniform vec4 u_styleLayerMapping; // 0, 1, 2... or -1 if invalid
5924
5924
  uniform float u_alpha;
5925
5925
  uniform bool u_applyLightmap;
5926
5926
  uniform bool u_warp;
5927
+ uniform bool u_lightmapOnly;
5927
5928
  uniform float u_time;
5928
5929
 
5929
5930
  uniform int u_renderMode; // 0: Textured, 1: Solid, 2: Solid Faceted
@@ -5939,7 +5940,10 @@ void main() {
5939
5940
 
5940
5941
  if (u_renderMode == 0) {
5941
5942
  // TEXTURED MODE
5942
- vec4 base = texture(u_diffuseMap, v_texCoord);
5943
+ vec4 base = vec4(1.0);
5944
+ if (!u_lightmapOnly) {
5945
+ base = texture(u_diffuseMap, v_texCoord);
5946
+ }
5943
5947
 
5944
5948
  vec3 totalLight = vec3(1.0);
5945
5949
 
@@ -6056,6 +6060,7 @@ var BspSurfacePipeline = class {
6056
6060
  this.uniformAlpha = this.program.getUniformLocation("u_alpha");
6057
6061
  this.uniformApplyLightmap = this.program.getUniformLocation("u_applyLightmap");
6058
6062
  this.uniformWarp = this.program.getUniformLocation("u_warp");
6063
+ this.uniformLightmapOnly = this.program.getUniformLocation("u_lightmapOnly");
6059
6064
  this.uniformDiffuse = this.program.getUniformLocation("u_diffuseMap");
6060
6065
  this.uniformLightmap = this.program.getUniformLocation("u_lightmapAtlas");
6061
6066
  this.uniformTime = this.program.getUniformLocation("u_time");
@@ -6084,7 +6089,8 @@ var BspSurfacePipeline = class {
6084
6089
  alpha,
6085
6090
  warp,
6086
6091
  dlights = [],
6087
- renderMode
6092
+ renderMode,
6093
+ lightmapOnly
6088
6094
  } = options;
6089
6095
  const state = deriveSurfaceRenderState(surfaceFlags, timeSeconds);
6090
6096
  const styles = resolveLightStyles(styleIndices, styleValues);
@@ -6102,6 +6108,7 @@ var BspSurfacePipeline = class {
6102
6108
  const applyLightmap = !state.sky && lightmapSampler !== void 0 && !finalWarp;
6103
6109
  this.gl.uniform1i(this.uniformApplyLightmap, applyLightmap ? 1 : 0);
6104
6110
  this.gl.uniform1i(this.uniformWarp, finalWarp ? 1 : 0);
6111
+ this.gl.uniform1i(this.uniformLightmapOnly, lightmapOnly ? 1 : 0);
6105
6112
  this.gl.uniform1f(this.uniformTime, timeSeconds);
6106
6113
  this.gl.uniform1i(this.uniformDiffuse, diffuseSampler);
6107
6114
  this.gl.uniform1i(this.uniformLightmap, lightmapSampler ?? 0);