4lex4nder / ReshadeEffectShaderToggler

Reshade 5+ addin to apply Reshade effects to render targets of shader groups based on a key press. It allows you to configure these groups from within the addin as well.
MIT License
88 stars 9 forks source link

Possible to edit game RTs? #36

Open MaxG2D opened 8 months ago

MaxG2D commented 8 months ago

Would it be possible to not just read game render targets, but also write to them, if not by custom ReShade shader, then by doing at least some slight post processing like brightness\contrast? For example, I can easily find a water shader buffer in Fallout 4, bind that texture and increase it's HDR specular values, by multiplying the green channel input, but I have no idea how I could actually write that edited texture back to original input RT.

4lex4nder commented 8 months ago

Not sure I completely understand the question, but applying effects happens to the render targets bound to the selected game shaders of the group. This would technically be editing.

MaxG2D commented 8 months ago

I'm mean in a sense that when one render target is used as an input in creating another render target, say, specular texture used when creating HDR backbuffer. Sure, I can apply shaders to that specular texture, and display it in the final output, but I can not write to that shader as if I was editing the native game code, so that the engine actually renders co-depended RTs with edited specular RT.

4lex4nder commented 8 months ago

I see, you basically mean applying effects to a shader's shader resources (textures/ render targets it's sampling from)? Then yes, that is currently not possible (unless there's some shader 0 writing to a render target that's used as an input for shader 1, in which case you can apply effects to shader 0's render targets). Gonna keep this open for tracking.

elbadcode commented 2 weeks ago

you can use 3dmigoto for this if its a dx11 or earlier game. REST and reshade in general sees 3dmigoto fixed shaders as game shaders. Of course the difficulty is that shaders don't have the same name and while I'm working out a way to deal with that for now you would have to manually hunt in both processes. interop here is something I'm looking at so I'll refer back if I solve it. Otherwise if this is a feature you want to implement in REST you should check out how 3dmigoto does shader fixes