Skip to content

Commit 8fd53d7

Browse files
committed
Merge branch 'release/0.5.3'
2 parents e56587e + 2565985 commit 8fd53d7

30 files changed

+3726
-1852
lines changed

Changelog.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
# 0.5.3
2+
WebGL shadows rewritten entirely. No longer a limit on the number of walls it can consider when calculating shadows using the GPU. (Technically, may be limited by the number of attributes that can be passed to a shader, but that should be sufficiently large for most use cases.) WebGL shadows also should be a lot more performant because shadows are drawn to a texture which is then used for rendering---this avoids a lot of calculations in the fragment shader on the fly.
3+
4+
Lights now display their elevation when the lighting layer is active.
5+
6+
Token vision is now based on token height, which can be set using Wall Height module. Making a token prone reduces the token height and changes the shadows accordingly.
7+
18
# 0.5.2
29
GM can define a minimum and maximum elevation color in settings. The coloration in the elevation layer will be interpolated between the two colors, based on the scene minimum and the current maximum elevation in the scene.
310

module.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"manifestPlusVersion": "1.0.0",
99
"compatibility": {
1010
"minimum": "11.299",
11-
"verified": "11.302"
11+
"verified": "11.304"
1212
},
1313
"authors": [
1414
{

scripts/ElevationLayer.js

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ import {
2626
drawPolygonWithHoles,
2727
quotient256,
2828
mod256 } from "./util.js";
29-
import { Draw } from "./geometry/Draw.js";
3029
import { testWallsForIntersections } from "./clockwise_sweep.js";
3130
import { SCENE_GRAPH } from "./WallTracer.js";
3231
import { FILOQueue } from "./FILOQueue.js";
@@ -35,9 +34,12 @@ import { CoordinateElevationCalculator } from "./CoordinateElevationCalculator.j
3534
import { TokenPointElevationCalculator } from "./TokenPointElevationCalculator.js";
3635
import { TokenAverageElevationCalculator } from "./TokenAverageElevationCalculator.js";
3736
import { TravelElevationCalculator } from "./TravelElevationCalculator.js";
38-
import { EVQuadMesh, ElevationLayerShader } from "./ElevationLayerShader.js";
3937
import { ElevationTextureManager } from "./ElevationTextureManager.js";
4038

39+
import { Draw } from "./geometry/Draw.js";
40+
41+
import { ElevationLayerShader } from "./glsl/ElevationLayerShader.js";
42+
import { EVQuadMesh } from "./glsl/EVQuadMesh.js";
4143

4244
import "./perfect-vision/extract-async.js";
4345

@@ -586,6 +588,26 @@ export class ElevationLayer extends InteractionLayer {
586588
this.renderElevation();
587589

588590
this._initialized = true;
591+
592+
// Update the source shadow meshes with the elevation texture.
593+
const sources = [
594+
...canvas.effects.lightSources,
595+
...canvas.tokens.placeables.map(t => t.vision)
596+
];
597+
598+
for ( const src of sources ) {
599+
const ev = src[MODULE_ID];
600+
if ( !ev ) continue;
601+
if ( ev.shadowMesh ) {
602+
ev.shadowMesh.shader.uniforms.uTerrainSampler = canvas.elevation._elevationTexture;
603+
ev.shadowRenderer.update();
604+
}
605+
606+
if ( ev.shadowVisionLOSMesh ) {
607+
ev.shadowVisionLOSMesh.shader.uniforms.uTerrainSampler = canvas.elevation._elevationTexture;
608+
ev.shadowVisionLOSRenderer.update();
609+
}
610+
}
589611
}
590612

591613
/**

0 commit comments

Comments
 (0)