Is it possible to make Effect take a screenshot?

  • DrakePhoenix
  • Topic Author
More
7 years 3 months ago - 7 years 3 months ago #1 by DrakePhoenix Is it possible to make Effect take a screenshot? was created by DrakePhoenix
Hi everyone,

I've been working with ReShade 1.1 for a while now and am finally updating to the newest version (ReShade 3.0.5 as of this moment). I'm relearning a little bit of stuff for the new modular setup for ReShade 3 and as part of that I'm picking up some old works in progress, updating them for use with ReShade 3, and continuing some unfinished work on them.

For a part of that, one thing I am trying to work on is meant to compare one frame to another, but not necessarily 2 consecutive frames. This may not be possible with the current set up for ReShade, but if it is, then I want to try and get a few things working for that.

Now from MotionBlur I know that I can (at least temporarily) save one frame to a RenderTarget texture and then call that texture later. How long does this persist? I believe that it only persists from one frame to the next, because each frame is processed through the effects again, and the effect would then save and overwrite the texture each time.

So what I'm thinking of possibly trying is to make my effect save a screenshot output. I know we can load image files (or at least used to be able to) using the syntax:
texture   textureName  < string source = "relativeFilePath/fileName.extension";  	> {Width = specifiedWidth;Height = specifiedHeight;Format = textureFormat;};
But I think that this would have the same problem as simply using an internal texture, in that it would be overwritten each frame when the effect is processed. And then it would have the added problem of the slowness of saving a screenshot.

Nevertheless, if it is possible to make an effect save a texture (screenshot, basically), and save it to a file output, I'd like to know how to do this.

Also, is there currently any way to save basic data, such as a text parameter of some sort, to an external file and load it back in? Is there any way to preserve variable data from one runtime to another through file IO?

Any info/insight regarding these issues is appreciated.

Thanks,
Drake
Last edit: 7 years 3 months ago by DrakePhoenix.

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

  • crosire
More
7 years 3 months ago #2 by crosire Replied by crosire on topic Is it possible to make Effect take a screenshot?
Texture are stored for as long as ReShade is loaded and are not overwritten unless you explicitly tell ReShade to do so (e.g. by writing to it in a render pass). They persist frames. It is not possible to save texture data to a file however. Only way to achieve this would be to add a toggable technique that simply prints the texture content to the screen, so you can save it via a screenshot.

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

  • DrakePhoenix
  • Topic Author
More
7 years 3 months ago #3 by DrakePhoenix Replied by DrakePhoenix on topic Is it possible to make Effect take a screenshot?
OK, then. But the problem I see with the persistence of textures is that as soon as an effect Technique that assigns content/value to a texture runs again, then it will change/update the texture. Since effects run every frame, how do get a texture to persist content for more than one frame change? Per REFERENCE.md there doesn't appear to be a way to access time-based functions to try and make a delayed process based on something like the mod of current system time being equal to a certain value (for one otherwise possible option in C++ or C#). The apparent limitations of HLSL are annoying me a little, but nothing to be done I suppose. Unless you have any suggestions.

Anyway, thank you for the response and the info.

Drake

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

  • crosire
More
7 years 3 months ago #4 by crosire Replied by crosire on topic Is it possible to make Effect take a screenshot?
You can achieve something along those lines by setting a timeout on the technique that should do single-frame-processing. This will ensure it's only called once and then immediately disabled.
technique WriteToTextureOnce < enabled = true; timeout = 1; >
{
    pass { ... }
}
The following user(s) said Thank You: DrakePhoenix

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

  • DrakePhoenix
  • Topic Author
More
7 years 3 months ago #5 by DrakePhoenix Replied by DrakePhoenix on topic Is it possible to make Effect take a screenshot?
Ah, ok, that makes sense then.

Thanks very much crosire :)

Drake

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.