Welcome, Guest.
Username: Password: Remember me

TOPIC: Reshade to force an HDR image as input

Reshade to force an HDR image as input 1 year 2 months ago #1

  • piltrafus
  • piltrafus's Avatar
  • Offline
  • Posts: 73
  • Thank you received: 15
Crosire mentioned this in another post:
"... The color buffer ReShade can grab is usually LDR though...
...if the game uses a backbuffer format with more than 8bit per color channel and only a very small amount of games do that."

If a 16bit or 32bit source image was used many shaders could benefit from it. Color correction would be of much higher quality. Less banding and artifacts,etc. It would also expand the posibilities of any shader affecting the lighting of the game. Bloom and flares could use values higher than 1 as a threshold, etc.
I guess we all know the benefits of having it, so the real issue is if its possible to do it.
Maybe Is hard to get it on a generic tool like reshade without doing specific game tweaks? Is it a planned feature for future versions? Was it clamped to 8bit for an specific reason like anti cheating?

Could reshade try to force capture an HDR buffer? maybe its similar to the way the depth buffer is captured?. A generic solution that works in most games?

I'll appreciate any info on this,
Thanks.
The administrator has disabled public write access.

Reshade to force an HDR image as input 1 year 2 months ago #2

  • crosire
  • crosire's Avatar
  • Offline
  • Posts: 2452
  • Thank you received: 1392
Possible in theory. While the backbuffer itself cannot hold more than 10bits per channel, I could replace it with a normal texture and making the game believe that is the real backbuffer. So only ReShade would actually write to the real backbuffer. But that's a lot of work.
Cheers, crosire =)
The administrator has disabled public write access.
The following user(s) said Thank You: piltrafus

Reshade to force an HDR image as input 1 year 2 months ago #3

  • piltrafus
  • piltrafus's Avatar
  • Offline
  • Posts: 73
  • Thank you received: 15
"Possible in theory...But that's a lot work"
sounds like a challenge to me :)

I understand that it may seem unnecessary to most people to have access to the HDR output of the game. However it would turn Reshade in a much more powerful tool. Equal in quality to professional comp software with the added benefit of "realtime" procesing.

Anyway. I've send some motivation token$ your way as a sign of gratitude.
Great work on Reshade. Keep it up if you can. Thanks.
The administrator has disabled public write access.
The following user(s) said Thank You: Aelius Maximus

Reshade to force an HDR image as input 1 year 2 months ago #4

  • crosire
  • crosire's Avatar
  • Offline
  • Posts: 2452
  • Thank you received: 1392
Also keep in mind that this would degrade performance a lot!
Cheers, crosire =)
The administrator has disabled public write access.
The following user(s) said Thank You: Aelius Maximus

Reshade to force an HDR image as input 1 year 2 months ago #5

  • piltrafus
  • piltrafus's Avatar
  • Offline
  • Posts: 73
  • Thank you received: 15
Well, finally all those 1000$ graphic cards would meet their fate.
The administrator has disabled public write access.

Reshade to force an HDR image as input 1 year 2 months ago #6

Would you consider supporting HDR with some help from the application? For example, the app could name the texture resources which contain the color before post processing as floating point. ReShade could look for some specific resource names (velocity buffer would be another example) and use them as input directly instead of grabbing the back buffer.

I could help with that for UE4, which is actually where I'm currently experimenting with ReShade.
Last Edit: 1 year 2 months ago by csigg.
The administrator has disabled public write access.

Reshade to force an HDR image as input 1 year 2 months ago #7

  • crosire
  • crosire's Avatar
  • Offline
  • Posts: 2452
  • Thank you received: 1392
csigg wrote:
Would you consider supporting HDR with some help from the application?
Yes, I would. Question is how to mark them. "ID3D11DeviceChild::SetPrivateData" would be an option for D3D11 for instance.
Cheers, crosire =)
The administrator has disabled public write access.

Reshade to force an HDR image as input 1 year 2 months ago #8

Yes, I was thinking of SetPrivateData(WKPDID_D3DDebugObjectName, ...) when I wrote resource naming. Would that be difficult to make textures (or the SRVs) accessible from the shader code by their resource name?
The administrator has disabled public write access.

Reshade to force an HDR image as input 1 year 2 months ago #9

  • crosire
  • crosire's Avatar
  • Offline
  • Posts: 2452
  • Thank you received: 1392
The main problem I see is identifying the right textures. ReShade can only check textures that are at some point in the frame bound as rendertarget. Anything else is ignored. Plus there needs to be a way for the shader code to request a specific texture from the game and it at best needs to be cross-API (so in D3D9, 10, 11 and OpenGL), which complicates things further.
Cheers, crosire =)
Last Edit: 1 year 2 months ago by crosire.
The administrator has disabled public write access.

Reshade to force an HDR image as input 1 year 1 month ago #10

What I had in mind was that the shader code could request a specific texture by name. Similar to 'RFX_backbufferColor' and 'RFX_depthColor' which as far as I understand are hardcoded names. The names for the other textures would correspond to the names specified through SetPrivateData for the shader resource views. To be honest, I don't know if something similar exists for D3D9/10/OpenGL (resource naming).

That would mean that textures (or more specifically SRV) with name could no longer be ignored, even if they aren't ever bound as render target.

One issue I see with this approach is that it requires game developers to name SRVs and those names are not going to be consistent across games, which would make effect authoring somewhat game specific.

Anyway, I have a little D3D11 app that displays a color and depth HDR image. The corresponding textures/SRVs are names "ColorBuffer", "ColorBufferSRV", "DepthBuffer", and "DepthBufferSRV". What's the best way to get that to you (if you are interested)? If you would prefer to have source, let me know.
The administrator has disabled public write access.

Reshade to force an HDR image as input 1 year 1 month ago #11

  • crosire
  • crosire's Avatar
  • Offline
  • Posts: 2452
  • Thank you received: 1392
csigg wrote:
Similar to 'RFX_backbufferColor' and 'RFX_depthColor' which as far as I understand are hardcoded names.
They are not. That's the beauty of ReShade's shader language (remember, it's not HLSL, even though it looks very similar). Nothing is hardcoded. Special textures are requested via semantics:
texture myBackBufferColor : COLOR;
texture myDepthBuffer : DEPTH;

First idea would be annotations, like done with all the special uniform values:
uniform float myTimer < source = "timer"; >;

However, these can only be resolved after ReShade parsed and compiled the shader and are handlded API independent. So something only working on D3D11 cannot be done here, it would need to support all APIs.
Cheers, crosire =)
The administrator has disabled public write access.

Reshade to force an HDR image as input 1 year 1 month ago #12

  • Ederer
  • Ederer's Avatar
  • Offline
  • Posts: 9
  • Thank you received: 3
I would appreciate a high dynamic range.
Maybe, to reduce performance not too much, there could be one single special effect, like "Exposure correction" or sth. like that. Only this specific effect would use the 32bit input to make adjustment to clipped highlights etc, but it will output an 8bit image, and all following effects will stay 8bit as well.
The administrator has disabled public write access.