dev7355608 / perfect-vision

Foundry VTT Module: Lighting Drawings and Vision Limitation.
https://foundryvtt.com/packages/perfect-vision
MIT License
53 stars 10 forks source link

Incompatibility with elevated vision #281

Closed Zamrod closed 1 year ago

Zamrod commented 2 years ago

Expected Behavior

Both modules should work together.

Current Behavior

The canvas fails to load entirely while the two modules are enabled.

Steps to Reproduce

  1. Enable both modules

Context



This is *not* a libWrapper bug.

Find information about these packages here:
- Module Perfect Vision: https://github.com/dev7355608/perfect-vision
- Module Elevated Vision: https://github.com/caewok/fvtt-elevated-vision

Report this conflict here:
- Module Perfect Vision: https://github.com/dev7355608/perfect-vision/issues

Ask the community for support:
- FoundryVTT Discord's #modules-troubleshooting channel: https://discord.gg/foundryvtt
- FoundryVTT Reddit: https://www.reddit.com/r/FoundryVTT

== Technical Details:
Detected by libWrapper.
Package IDs= perfect-vision, elevatedvision
Error= Failed to wrap 'CanvasVisibility.prototype.refresh' for module perfect-vision with type OVERRIDE. An OVERRIDE wrapper for the same method has already been registered by module elevatedvision.

[Detected 1 package: perfect-vision]
    at 🎁register [as register] (libWrapper-api.js:558:12)
    at Object.fn (visibility.js:46:16)
    at #call (foundry.js:688:20)
    at Hooks.callAll (foundry.js:645:17)
    at Game.setupGame (foundry.js:7725:11)
    at Game._initializeGameView (foundry.js:8820:16)
    at Game._initializeView (foundry.js:8796:21)
    at Game.initialize (foundry.js:7630:16)```

```Error: (572,26): error: no function with name 'locationInWallShadow'

[Detected 3 packages: perfect-vision, elevatedvision, lib-wrapper]
    at emval_allocator_1 (eval at o (glsl-optimizer.js:68:266), <anonymous>:8:11)
    at o (glsl-optimizer.js:68:438)
    at 002886c2:0x229c6
    at 002886c2:0x525b1
    at 002886c2:0x2e3a1
    at Object.optimize (eval at Ua (glsl-optimizer.js:24:242), <anonymous>:10:10)
    at optimizeGLSL (pixi.js:13:26)
    at processShaderSource (pixi.js:30:24)
    at e.set (pixi.js:51:46)
    at new e (core.min.mjs:8:78477)
    at e.from (core.min.mjs:8:79848)
    at AdaptiveBackgroundShader.create (foundry.js:49650:34)
    at 🎁call_wrapped [as call_wrapped] (libWrapper-wrapper.js:511:22)
    at AdaptiveBackgroundShader.createAdaptiveLightingShader (lighting.js:61:18)
    at 🎁call_wrapper [as call_wrapper] (libWrapper-wrapper.js:620:16)
    at 🎁AdaptiveLightingShader.create#perfect-vision (point-source-shader.js:525:20)
    at 🎁call_wrapper [as call_wrapper] (libWrapper-wrapper.js:620:16)
    at 🎁AdaptiveLightingShader.create#0 (libWrapper-wrapper.js:189:20)
    at LightSource._createMesh (point-source-mesh.js:45:78)
    at 🎁PointSource.prototype._createMesh#0 (libWrapper-wrapper.js:187:52)
    at LightSource._createMeshes (foundry.js:48113:28)
    at 🎁call_wrapped [as call_wrapped] (libWrapper-wrapper.js:511:22)
    at 🎁LightSource.prototype._createMeshes#perfect-vision (delimiter-effects.js:10:13)
    at 🎁LightSource.prototype._createMeshes#0 (libWrapper-wrapper.js:187:52)
    at LightSource._initializeMeshes (foundry.js:47803:12)
    at LightSource.initialize (foundry.js:48079:10)
    at AmbientLight.updateSource (foundry.js:42285:19)
    at 🎁call_wrapped [as call_wrapped] (libWrapper-wrapper.js:511:22)
    at AmbientLight.updateLightSource (ambient-light.js:57:9)
    at 🎁AmbientLight.prototype.updateSource#0 (libWrapper-wrapper.js:187:52)
    at AmbientLight._draw (foundry.js:42205:10)
    at AmbientLight.draw (foundry.js:24869:16)
    at foundry.js:30447:26
    at EmbeddedCollection.map (commons.js:2869:26)
    at LightingLayer._draw (foundry.js:30445:32)
    at LightingLayer.draw (foundry.js:29972:16)
    at async InterfaceCanvasGroup.draw (foundry.js:28407:9)
    at async InterfaceCanvasGroup.draw (foundry.js:38649:5)
    at async Canvas.draw (foundry.js:23403:11)
    at async Scene.view (foundry.js:20727:7)
    at async Game.initializeCanvas (foundry.js:7909:20)
    at async Game.setupGame (foundry.js:7747:5)
    at async Game._initializeGameView (foundry.js:8820:5)
    at async Game.initialize (foundry.js:7630:5)```

### Version

v4.0.5

### Foundry VTT Version

v10.284

### Operating System

Windows

### Browser / App

Native App (Electron)

### Game System

dnd5e (2.0.2)

### Relevant Modules

Elevated Vision (0.0.2), libWrapper (1.12.8.0)
caewok commented 2 years ago

Updates in Elevated Vision v0.1.0 address some of this. The errors are gone, and lighting with shadows is working. But vision with shadows is not working. (Vision works, it just ignores the elevation information.) At the moment, I am not clear on why that part is not working...

caewok commented 2 years ago

Elevated Vision v0.1.5 addresses compatibility. I recommend closing this issue and opening new issues if you experience bugs with v0.1.5 and Perfect Vision. Thanks!