GL_Fog version 1.1.0

Many thanks.
Got to try it and it gives off an error right after loading a saved game (MV 1.6.1)
chau fog.png

I haven't got around yet at testing this more, to better figure out the general area from where this error is coming (engine compatibility, plugin conflict, plugin ordering, etc)
@Featherbrain, I've replicated the issue, and I'll have an update for this soon! apologies it took so long to get to..

@Meremem I'm not able to replicate this issue, can you try copy pasting one of the test plugin commands from the help file? It might be a mistyped parameter. If you still have the issue I may have to ask you to put together a demo where the issue is present.
can you try copy pasting one of the test plugin commands from the help file?
I've used the first test command
Code:
gl_fog color 191 127 178 speed 0.2 scrollX 0 scrollY 0 octaves 3
Spoiler
fog button.png
But that's not the issue, since the game crashes before I can push the button, because it crashes right after the game load, before the map is even loaded. Meaning it's not the plugin command to crash, but the whole script.

I've created a blank project with only the fog plugin active in it.
https://www.dropbox.com/s/5sqd52bpc71vlh0/Test_fog chaucer.zip?dl=0

The game doesn't crash there, meaning the loading crash is caused by some plugin conflict on my main project.
But a new and different issue comes up there, after the loading crash is overcomed.

Hey @Nolonar come have a look here, I'm getting the same cropping and stretching mystery bug as with your fog plugin. It seems you guys are using the same rendering method for the fog, or some same other part of code (maybe some of the math functions?) which triggers the mystery cropping bug on my side.
With the chaucer fog I could notice one further detail, the cropping and stretching bug was happening even before the fog was activated by an event (plugin command). Meaning it's not the fog itself to cause the stretching, but some of the setup code of the fog, which messes up the screen resolution on my side.

To sum it up:
-my main project (or blank project) + nolonar fog = screen cropping & stretching (fog works fine)
-my main project + chaucer fog = game crash on save load
-blank project + chaucer fog = same screen cropping & stretching as nolonar fog (fog works fine)
With chaucer fog the screen tearing happens also with no fog active, so long the plugin is ON the tearing happens.
With nolonar fog instead, the stretching happens only on maps with the fog active, while the stretching goes away, and the screen returns to normal, as soon as a fog-less map is entered.
While that same cropping bug doesn't show up for anyone else(it seems) but me

The mystery deepens 😔
Thanks guys, but don't spend too much time on this fog mystery bug, unless you've nothing better to do, it's really not worth it. Guess I'm forced to try the image fog plugins, even if these procedural fogs looked much more interesting and less burdensome to set up.
Thanks again for having looked into this.
Hey @Nolonar come have a look here, I'm getting the same cropping and stretching mystery bug as with your fog plugin. It seems you guys are using the same rendering method for the fog, or some same other part of code (maybe some of the math functions?) which triggers the mystery cropping bug on my side.

Thank you very much for directing my attention to this thread. At the very least, I've been able to fix a long-standing bug I had no idea how to fix before, which caused my fog to render on top of pictures when it shouldn't have. I've released this fix as version 1.4.4. If my hypothesis is correct, this would also (hopefully) fix your cropping and stretching issue. Since I can't reproduce your issue, however, I have to rely on you for testing if the issue is really resolved or not. I hope you don't mind.

Here's my analysis:

Yes, we both use shaders to render our fog, so shaders might be the cause of the bug. In fact, I believe the shaders are most likely the cause, because:
  • The bug only appears with N_WeatherFog when the fog is active.
  • The bug always appears with Chau_Fog even without fog.
  • N_WeatherFog only affects performance when the fog is active.
  • Chau_Fog affects performance even without fog.
  • N_WeatherFog adds its shader to the filter list only when the fog is active.
  • Chau_Fog adds its shader to the filter list as soon as it can.
So it appears the bug's timing coincides with the timing when we add our shaders to the game.

However, RPG Maker (both MV and MZ) also add a shader of their own. These are the ToneFilter (MV) and the ColorFilter (MZ) respectively. Both of which are responsible for the Tint Screen... event command, and both of which are always active, just like with Chau_Fog.

But since the bug only appears with our plugins, this means that RPG Maker is adding its shader differently from us.

Upon closer inspection, I've noticed that RPG Maker MV and MZ are both creating their ToneFilter and ColorFilter on the Spriteset_Base, which then adds the shader to its Sprite. N_WeatherFog, on the other hand, added its shader directly to the Spriteset_Map itself, which is the same as adding it directly to the Spriteset_Base. Chau_Fog, meanwhile adds its shader to the Spriteset_Map's Tilemap instead.

As a result, I suspected there was something about the Sprite that caused shaders to not break your setup. The answer (if my hypothesis is correct): filterArea.

The Sprite is in possession of a filterArea, which describes a mask where the shader should be applied. Outside of the filterArea the shader would be inactive. As it so happens, the Spriteset_Base does not have a filterArea. From what I understand, a missing filterArea simply means that the filter should be active everywhere, so I'm not sure why it being missing would cause cropping and stretching on your device. But it is the single most likely and relevant difference I've noticed between my fog shader and MV/MZ's tint shaders.

In any case, I've (hopefully) fixed the bug by adding my fog shader to the Spriteset_Map's Sprite, which also happened to fix the bug where the fog rendered on top of pictures.

With any luck, we've successfully identified and fixed your issue. But allow me to thank you once again for helping me fix a completely different bug I've been trying to track down for over a year.
Thanks Nolonar, the bug is solved for your fog script. Hopefully this code crossover may also be useful for chaucer here.

Now I've a working procedural fog plugin, but if you need, chaucer, I can still help here too.
I've attached a copy of my plugins.js list, from which it should be possible to see which other plugins may be conflicting with your fog plugin. When the save load crash happened, your fog plugin was at the end of the plugins list (and N_WeatherFog wasn't there, I added that later)
I've foud the save/load issue with the plugin I am already in the process of resolving this issue ^^ I am also resolving the issue @Featherbrain had, I'll have a new update available before the end of the day, also it looks like your aspect ratio is being skewed is that from my plugin? It's definitely an issue with the filter, I think I may have an idea as to where this is occuring, I'll look into this as well and see if I can figure something out.

Also @Nolonar about my fog impacting performance while not being active, this is untrue, even though my shader IS applied to every scene, if no fog is present I have taken measures to ensure performance is unaffected.

if the fog is not visible, then there are no extra calculations applied via the shader, it simply renders the scene per normal. 🙂

As well, about the filterArea, I do not believe this is the issue, because I have been manually applying a filter area to the sprites which my filter is applied, and if the issue is still occuring on my plugin as well it goes to say this can be ruled out.

Original thread: https://forums.rpgmakerweb.com/threads/gl_fog-version-1-1-0.117529/