elffriend-dnd / foundryvtt-imagefog Goto Github PK
View Code? Open in Web Editor NEWModule to allow GMs to set images as the fog layer.
License: MIT License
Module to allow GMs to set images as the fog layer.
License: MIT License
We should leverage the newly finalized manifest+ media
links to show screenshots of the fog effect to Bazaar users.
We still need to get a POC for the core functionality of this working.
Just a suggestion, not sure if this is out of the scope of what's easily possible using your method or the module's purpose.
Essentially this would be an identical option to what the module already adds to the scene, but for an image to be applied to darkness (or "explored" FoW that isn't currently being viewed by the players).
This would allow for battle/city maps which have roofs to actually hide their roofed version dynamically with the player's vision. It'd also make the current function of the module better when using it with maps that don't have global illumination on, as right now all explored territory shows the default black fog of war.
Upon upgrading to .8.6 this module does not work. Below is from the console when a scene is loaded:
FogImageLayer.js:91 Uncaught (in promise) TypeError: Cannot set property 'filters' of undefined
at FogImageLayer._updateUnexploredMaskTexture (FogImageLayer.js:91)
at FogImageLayer.init (FogImageLayer.js:40)
at foundryvtt-imageFog.js:54
at Function._call (eval at (libWrapper-errors.js:249), :4:14)
at Function.call (foundry.js:179)
at Canvas.draw (foundry.js:17430)
at async Scene.view (foundry.js:15405)
at async Game.initializeCanvas (foundry.js:4415)
at async Game.setupGame (foundry.js:4294)
at async Game._initializeGameView (foundry.js:5114)
Could this be caused due to the inclusion of "overhead roofs" as core capability in .8.6?
Not sure if this is an enhancement or even possible.
I set things up according to the instructions, but would like to see the grid on top of the fog.. is this possible ?
Thanks
So here's the progress so far.
It's easy enough to inject an image into the unexplored
container of the SightLayer
. The problem i've encountered is that the entire SightLayer has a filter applied which does two things:
Which means that the mechanism by which the sight layer obscures the background image is entirely by painting black on top of it.
The unexplored
area is painted black. The explored
area is painted grey. The current
area is painted white. When these are blurred together, the layer has areas of varying amounts of darkness which can then be set to BlendMode: Multiply and thus obscure the background image.
The challenge this presents to this project is that it's going to require converting the SightLayer to instead use masks, which can have a texture applied to them.
With this mod enabled, swapping between scenes too quickly can cause Foundry to stop being able to render any maps at all. Only fix I've found is restarting the Foundry client completely.
https://gitlab.com/tiwato/fog-manager
We should see how well this works with image fog.
This can be reproduced using Foundry 0.7.9 and Image Fog 1.2.0.
Create three scenes:
One with normal FOW using:
1.a) Background Image: "Ravaged Castle [40x50].webp"
1.b) Width: 3920
1.c) Height: 4900
Another one with Image Fog using:
2.a) Background Image: "MermaidInnFloor_Interior.webp"
2.b) Width: 1862
2.c) Height: 1568
2.d) Unexplored Fog Background Image: "MermaidInnFloor_Fog.webp"
Another one with normal FOW using:
3.a) Background Image: "MermaidInnFloor_Interior.webp"
3.b) Width: 1862
3.c) Height: 1568
From a newly loaded game, switching from scene 2 to 1 causes a performance hit, but switching from 3 to 1, or starting in 1 works correctly.
This is noticeable when holding the arrow buttons pressed in an install with no other modules.
This is a video of the issue:
There's an API in PotatoOrNot which lets modules recommend settings based on the potato-ness of the client. We should leverage this to recommend performanceMode
.
Seems this broke in 0.7.6
We're basically doubling the time it takes for sight updates (separate issue). So we should make double sure we aren't affecting the sight update time of scenes without a Fog Image set.
It would be neat to allow setting a smaller image which tiles across the fog image layer. Example.
I have a PR for adding an Image to Simple Fog's fog. We should make it a priority to finish it so that users of Simple Fog can enjoy this concept as well.
Double check Less Fog is supported in 0.7.5.
If so, respect the settings set in Less Fog for DM and Player Fog Alpha.
@Sky Today at 10:09 PM
@Calego (He/Him) Does Image Fog module have the option to apply a greyscale or sepia tone filter? Or would that have to be done outside of Foundry?
Definitely possible and easy enough of an idea. A few presets are easy with a ColorMatrixFilter:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.