Prevent ReShade form Recompiling for each 3D model

  • Aaron Grey
  • Topic Author
More
8 years 10 months ago - 8 years 10 months ago #1 by Aaron Grey Prevent ReShade form Recompiling for each 3D model was created by Aaron Grey
I started playing Project Zomboid again and suddenly had the crazy idea to try ReShade + SweetFX on this (predominantly) 2D OpenGL game with really good results: s15.postimg.org/hglasxtfv/Project_Zomboi...5_05_28_02_30_48.jpg

I used the ReShade (0.18.4) + SweetFX combo from here: sfx.thelazy.net/downloads/


Now there is a problem though, the game has recently updated to using 3D models and each time the game either loads a 3D player-, zombie-, or corpse-model, the message "Compile effect ... Successful!" appears in the upper left corner. I know you can get rid of the message itself, but the problem is that the SweetFX settings are briefly disabled for a split second each time the game loads a new 3D model somewhere around you, thus causing annoying flickering. Any ideas how I can prevent this from happening? :huh: I wouldn't mind, if all the effects weren't applied to the 3D models at all if that's what it takes.

Thank you for helping out! :cheer:
Last edit: 8 years 10 months ago by Aaron Grey.

Please Log in or Create an account to join the conversation.

  • crosire
More
8 years 10 months ago - 8 years 10 months ago #2 by crosire Replied by crosire on topic Prevent ReShade form Recompiling for each 3D model
Could you post a log with this happening (preferably also writing down one or two timestamps when such a recompile due to a model load appears)? =)
Last edit: 8 years 10 months ago by crosire.

Please Log in or Create an account to join the conversation.

  • Aaron Grey
  • Topic Author
More
8 years 10 months ago - 8 years 10 months ago #3 by Aaron Grey Replied by Aaron Grey on topic Prevent ReShade form Recompiling for each 3D model
I deleted my last log and made a fresh one that's just a minute long or so. It features the tutorial where you have a few recompiles at the very beginning.

So the structure of the tutorial is basically like this:

1) Game loads up in the very beginning.

2) I start the tutorial from the menu and the game loads one or two 3D models in the very beginning, presumably the player model and perhaps something else which is leading to the first recompiles.

3) Then there is another recompile at 14:15:52, when a zombie moan is made off-screen. You cannot find this zombie anywhere on the map, it is supposed to be just the soundbyte anyway but it seems the Zomboid devs made this by very briefly spawning a zombie in and out or something like that.

4) A really good bit where I know exactly what's happening in-game comes at 14:16:15: It happens 3 times in total, first when a real zombie is spawned into the map, the second time it happens when you actually see that zombie and the third time it happens when you kill it (at which point its 3D corpse model replaces it).

4) From 14:17:35 onwards the game rapidly starts spawning more and more and more zombie models and keeps them coming at you indefinitely until you die. I pressed escape just 3 or 4 seconds after they rapidly started spawning in, so the log wouldn't be endlessly long but basically what you see in the last seconds is what keeps happening at a very rapid pace as more and more zombies are spawned - and naturally the picture flickers pretty spastically during all that time.

Full log:
pastebin.com/BvR2jwx7

Thank you so much for looking into it, that's very nice of you :)
Last edit: 8 years 10 months ago by Aaron Grey.

Please Log in or Create an account to join the conversation.

  • crosire
More
8 years 10 months ago #4 by crosire Replied by crosire on topic Prevent ReShade form Recompiling for each 3D model
Looks like it's not directly related to the 3D model loading, but due to the game resetting the OpenGL context after each frame. That currently forces ReShade to perform cleanup, so it destroys all effects, only to reload them shortly after in the next frame or a few frames later. Might need to find a better solution for handling single OpenGL context games, without breaking the system for modern games, which usually use multiple contexts spread across multiple threads.

Please Log in or Create an account to join the conversation.

  • Aaron Grey
  • Topic Author
More
8 years 10 months ago - 8 years 10 months ago #5 by Aaron Grey Replied by Aaron Grey on topic Prevent ReShade form Recompiling for each 3D model
Hmm I think I understood what you're saying: So the cleanup process is basically constantly running even though I cannot visuall detect this redundant process in-game, however the process shows itself as flickering if the 3D models are loaded. Ideally a game like Zomboid schouldn't be making so many clean-ups in the first place though, is that what you're saying? Is there possibly some kind of quick and dirty hack you can think of that I might try out - something that simply "locks" and prevents ReShade from performing any sort of clean-up entirely after the effects have been loaded once?
Last edit: 8 years 10 months ago by Aaron Grey.

Please Log in or Create an account to join the conversation.

  • v00d00m4n
More
8 years 10 months ago - 8 years 10 months ago #6 by v00d00m4n Replied by v00d00m4n on topic Prevent ReShade form Recompiling for each 3D model
how about adding simple switch define шт reshade.fx that will tell reshade to use alternate behavior for such cases?

Something like

#define dont_refresh_on_context_reset_hack = true

?

So for most games it will keep working like it does now and for some poorly coded games like this alternate behavior can be forced by single line?
Last edit: 8 years 10 months ago by v00d00m4n.

Please Log in or Create an account to join the conversation.

  • crosire
More
8 years 10 months ago #7 by crosire Replied by crosire on topic Prevent ReShade form Recompiling for each 3D model
@Aaron Grey: Yes, that's pretty much it. OpenGL doesn't really forbid you to do it the way the games does it. It's valid, but it's rather ugly. Might work by doing a check on how many OpenGL contexts the game created and only clean up if there are more than one and otherwise leave it be until the end.
@v00d00m4n: I don't like hacky things. There are always better ways to do it properly. =)
The following user(s) said Thank You: Aaron Grey

Please Log in or Create an account to join the conversation.

  • Aaron Grey
  • Topic Author
More
8 years 10 months ago - 8 years 10 months ago #8 by Aaron Grey Replied by Aaron Grey on topic Prevent ReShade form Recompiling for each 3D model
Well Project Zomboid is still in alpha stage so it may change in the very distant future :)
Last edit: 8 years 10 months ago by Aaron Grey.

Please Log in or Create an account to join the conversation.

  • Aaron Grey
  • Topic Author
More
8 years 10 months ago #9 by Aaron Grey Replied by Aaron Grey on topic Prevent ReShade form Recompiling for each 3D model
Any idea how this might be solved yet? :side: I'd love to get it to work so I can uplad my preset on sfx.thelazy and make a guide on how to set it up on in the steam community forum.

Please Log in or Create an account to join the conversation.

  • TheChosenOne
More
7 years 2 months ago #10 by TheChosenOne Replied by TheChosenOne on topic Prevent ReShade form Recompiling for each 3D model
Still relevant :( . Tried it five minutes ago with ReShade 3.0.6

Please Log in or Create an account to join the conversation.

  • dumoju
More
5 years 3 months ago #11 by dumoju Replied by dumoju on topic Prevent ReShade form Recompiling for each 3D model
still happening, everytime a zombie appears the game update info and because of that reshade reload effects... please help us

Please Log in or Create an account to join the conversation.

  • seri14
More
5 years 3 months ago #12 by seri14 Replied by seri14 on topic Prevent ReShade form Recompiling for each 3D model
Please do not post duplicate content.
It will hinder to working that checking all articles.

Please Log in or Create an account to join the conversation.

We use cookies
We use cookies on our website. Some of them are essential for the operation of the forum. You can decide for yourself whether you want to allow cookies or not. Please note that if you reject them, you may not be able to use all the functionalities of the site.