Providing game data to ReShade

  • doodlum
  • Topic Author
More
1 month 1 week ago #21 by doodlum Replied by doodlum on topic Providing game data to ReShade
Rendering before a shader means rendering into its SRV rather than its RTV. Looking further at things, I think I got your code wrong. It's always rendering before, just it's rendering into the RTV so very often an injected effect will just do nothing. I think I'll rewrite that then, and store a map of RTV->SRV pairs which are created and destroyed when needed. Further to that, a way to render directly after Draw might be ideal too. The API seems to have made assumptions about what people are doing with events, so before/after is not specifiable.

I will test that snippet you posted, thanks.

For credits, I used what is specified in the licence supplied by Shader Toggler. I can remove your real name but I want to get the licence as best I can without including a licence file in the archive itself. I guess I could add a button or dropdown to present the full licence within ReShade and leave in simplified credits elsewhere.

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

  • crosire
More
1 month 1 week ago #22 by crosire Replied by crosire on topic Providing game data to ReShade
It's not possible to render into a SRV: A SRV is a view to a texture for shader binding. You can only render into RTVs (that's their purpose).
Any rendering a game does happens at draw calls ("addon_event::draw" and friends), everything else is just state updates and doesn't actually execute anything. The draw events are called before the actual draw the game requested is executed, but allow you to overwrite them, so you can always perform work both before (in the callback, returning false) and after (calling "cmd_list->draw()" with the passed in arguments in the callback, then doing the work and returning true), the API works both ways.

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

  • doodlum
  • Topic Author
More
1 month 1 week ago - 1 month 1 week ago #23 by doodlum Replied by doodlum on topic Providing game data to ReShade
Sorry, I meant creating an RTV from the underlying texture and caching that.

Ahh the latter sounds like it should work perfectly, thanks.
Last edit: 1 month 1 week ago by doodlum. Reason: edit

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

  • doodlum
  • Topic Author
More
1 month 1 week ago #24 by doodlum Replied by doodlum on topic Providing game data to ReShade
Looks like getting views might be pushing the boundaries of what can be done that is renderer-agnostic within the API, since it ultimately returns opaque handles.

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

  • crosire
More
1 month 1 week ago #25 by crosire Replied by crosire on topic Providing game data to ReShade
They aren't entirely opaque, those handles are well defined in most cases: For RTVs for example, in D3D11 it's a ID3D11RenderTargetView pointer, in D3D12 it's a D3D12_CPU_DESCRIPTOR_HANDLE to a RTV descriptor. The add-on API just makes it possible to create them without having to worry about which graphics API is actually being used, but if so inclined one can also get/create them through other means and simply pass those to the add-on API (by reinterpret casting to reshade::api::resource_view).

To be graphics API-agnostic it's preferable to rely more on the add-on API though, otherwise will have a bunch of `if (device->get_api() == ...) ... else ...` code paths, yeah ...

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

  • doodlum
  • Topic Author
More
1 week 6 days ago - 1 week 6 days ago #26 by doodlum Replied by doodlum on topic Providing game data to ReShade
..
Last edit: 1 week 6 days ago by doodlum. Reason: Resolved

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 site, while others help us to improve this site and the user experience (tracking cookies). 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.