Welcome, Guest.
Username: Password: Remember me

TOPIC: A few suggestions that would improve usability.

A few suggestions that would improve usability. 1 year 8 months ago #1

  • PetkaGtA
  • PetkaGtA's Avatar
  • Offline
  • Posts: 13
  • Thank you received: 21
So far ReShade impressed me a lot(really beautiful tool to create post-process stuff) but here is a list of improvements that would come handy:
1) Technique execution order, so user can specify when technique will be executed.
2) Projection and View matrix access(via IDirect3DDevice9::GetTransform and analogues in opengl)
3) Not sure that it's supported atm, but getting default in-game mrt buffers would be really nice(something like "texture texInGameNormalBuffer : COLOR1;")
The administrator has disabled public write access.

A few suggestions that would improve usability. 1 year 8 months ago #2

  • crosire
  • crosire's Avatar
  • Offline
  • Posts: 2451
  • Thank you received: 1391
Thanks a lot! Here are my thoughts on these, I'm open for discussion =):

  1. Sounds like a good idea. Would probably be another technique annotation (something like "index"). But I'm not sure if it is worth the hassl, since you can implement technique reordering with the preprocessor yourself fairly easy.
  2. That unfortunately would only work for old games which are using the fixed function pipeline. And it would only work if the last drawing call used the scene transformation matrices. The modern shader based pipeline has no way of retrieving that information, since everybody can determine himself, how he wants to pass it to the shaders. One of the main goals of ReShade is to be as generic as possible, so that doesn't fit very well.
  3. The data you get in the texture marked with the "COLOR" semantic is not the data in the game rendertarget bound to index zero. It gets the contents of the backbuffer (the buffer containing the data which is about to be presented to the screen), of which there only exists one (with the exception for 3D rendering and triple buffering). ReShade currently runs at the very end of a frame, it's not even guaranteed the game has bound the backbuffer to one of the rendertarget slots at that point, actually more likely it has unbound all the rendertargets, since rendering finished.
Cheers, crosire =)
Last Edit: 1 year 8 months ago by crosire.
The administrator has disabled public write access.

A few suggestions that would improve usability. 1 year 8 months ago #3

  • PetkaGtA
  • PetkaGtA's Avatar
  • Offline
  • Posts: 13
  • Thank you received: 21
That unfortunately would only work for old games which are using the fixed function pipeline.
That's interesting, well so it's possible to do that as an option?
And btw is Depth buffer linearized by default? or I should use that code?(worked so far)
fDepth=2.0 / (-99.0 * fDepth + 101.0);
The administrator has disabled public write access.

A few suggestions that would improve usability. 1 year 8 months ago #4

  • crosire
  • crosire's Avatar
  • Offline
  • Posts: 2451
  • Thank you received: 1391
PetkaGtA wrote:
That's interesting, well so it's possible to do that as an option?
I don't think it'll get you the right values in the usual case. Games usually render their 2D HUD last, which obviously uses a different transformation matrix than rendering the 3D scene would require and it would be this matrix you get (always assuming the game uses the fixed function pipeline, no modern game does that, Direct3D10+ and OpenGL3+ don't even have it anymore). I'll add it to the TODO list and test it with a few games to see if anything useful comes out of it. If so, then yes, I'd add that as an option for those old games where it works. If no, then well, wouldn't make much sense in adding it then.

If anybody has some ideas on how one could get generic access to the transformation matrices, then please share =).

PetkaGtA wrote:
And btw is Depth buffer linearized by default?
Nope, it's the raw depthbuffer data. Linearization has to be done in the shader.
Cheers, crosire =)
Last Edit: 1 year 8 months ago by crosire.
The administrator has disabled public write access.

A few suggestions that would improve usability. 1 year 8 months ago #5

  • PetkaGtA
  • PetkaGtA's Avatar
  • Offline
  • Posts: 13
  • Thank you received: 21
Okay after working with ReShade a bit more I come up with some more ideas:
1) Add debug messages for technique/pass like average time in ms.
2) More debug info like memory usage and memory usage per texture(so we could gain more performance from our shaders).
3) Sometimes I get messages of errors in shaders like this
D:\Games\Dark Souls II\Game\Shader@0x191A7B50(97,52): warning X4008: floating point division by zero
and it's hard to determine where error is cause this shader doesn't exist(only in memory perhaps), maybe adding ability to quote strings from code would help?
The administrator has disabled public write access.

A few suggestions that would improve usability. 1 year 8 months ago #6

  • crosire
  • crosire's Avatar
  • Offline
  • Posts: 2451
  • Thank you received: 1391
1 and 2 are certainly something that should be added, yes.

About 3: Those are warnings the internal HLSL or GLSL compiler output, after ReShade compiled its shader language into HLSL/GLSL. ReShade adds them to the error output, because as you experienced there are a few that ReShade's compiler does not yet handle itself. So correct, the line numbers there point to internal shaders that exist in memory. But: If you enable tracelogging (rename the created .log to .tracelog) ReShade will write these internal shaders into the log, so you can examine them there and figure out the matching line in your code.
The generated code can be found right under the "Compiling shader '<Function>':" lines. These warnings point into one of those. So just copy the code into another editor window, jump to the line in the error (note that for each pass combination separate shaders are created, so you might need to try multiple of these until you find the one the error originates from), and you should be able to figure out where to find that line in your original source code.
Cheers, crosire =)
Last Edit: 1 year 8 months ago by crosire.
The administrator has disabled public write access.

A few suggestions that would improve usability. 1 year 8 months ago #7

  • crosire
  • crosire's Avatar
  • Offline
  • Posts: 2451
  • Thank you received: 1391
0.17.0 now has technique performance timers in the "#pragma reshade showstatistics" overlay, as well as some information about the used textures.
Cheers, crosire =)
Last Edit: 1 year 8 months ago by crosire.
The administrator has disabled public write access.
The following user(s) said Thank You: jas01, PetkaGtA