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.