Reshade to force an HDR image as input

  • piltrafus
  • Topic Author
More
8 years 6 months ago #1 by piltrafus Reshade to force an HDR image as input was created by piltrafus
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.

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

  • crosire
More
8 years 6 months ago #2 by crosire Replied by crosire on topic Reshade to force an HDR image as input
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.
The following user(s) said Thank You: piltrafus

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

  • piltrafus
  • Topic Author
More
8 years 6 months ago #3 by piltrafus Replied by piltrafus on topic Reshade to force an HDR image as input
"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 following user(s) said Thank You: Aelius Maximus

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

  • crosire
More
8 years 6 months ago #4 by crosire Replied by crosire on topic Reshade to force an HDR image as input
Also keep in mind that this would degrade performance a lot!
The following user(s) said Thank You: Aelius Maximus

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

  • piltrafus
  • Topic Author
More
8 years 6 months ago #5 by piltrafus Replied by piltrafus on topic Reshade to force an HDR image as input
Well, finally all those 1000$ graphic cards would meet their fate.

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

  • csigg
More
8 years 6 months ago - 8 years 6 months ago #6 by csigg Replied by csigg on topic Reshade to force an HDR image as input
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: 8 years 6 months ago by csigg.

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

  • crosire
More
8 years 6 months ago #7 by crosire Replied by crosire on topic Reshade to force an HDR image as input

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.

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

  • csigg
More
8 years 6 months ago #8 by csigg Replied by csigg on topic Reshade to force an HDR image as input
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?

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

  • crosire
More
8 years 6 months ago - 8 years 6 months ago #9 by crosire Replied by crosire on topic Reshade to force an HDR image as input
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.
Last edit: 8 years 6 months ago by crosire.

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

  • csigg
More
8 years 6 months ago #10 by csigg Replied by csigg on topic Reshade to force an HDR image as input
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.

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

  • crosire
More
8 years 6 months ago #11 by crosire Replied by crosire on topic Reshade to force an HDR image as input

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.

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

  • Ederer
More
8 years 6 months ago #12 by Ederer Replied by Ederer on topic Reshade to force an HDR image as input
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.

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.