Any idea on intergrate reshade in to a Source Mod

  • Posts: 3
9 months 4 weeks ago - 9 months 4 weeks ago #1 by G33KiDoS
I'm trying to get ReShade renders before the VGUI draws.

I removed the d3d9 Present hook, and manually call the on_present in the CViewRender::RenderView.
But this not works as I expected, the game started flickering. Althrough in some frames, the ReShade worked as I expected:


In other frames, the game is totally black screen or just not changed at all

Could I get any help on anyone? thanks!

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

  • Posts: 3666
9 months 4 weeks ago #2 by crosire
"runtime_d3d9::on_present()" calls "update_and_render_effects()". That is where the effect rendering is happening and is the one you best move wherever you want that to happen. Most of the other logic in "on_present()" is required to run at the end of the frame.
The following user(s) said Thank You: G33KiDoS

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

  • Posts: 3
9 months 3 weeks ago #3 by G33KiDoS
Thanks for you reply!

But this happens if I only call the update_and_render_effects:


I guess that could caused by the game is actually not rendering objects in that function, It just adds everything to a render queue.
What do you think about that.

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

  • Posts: 3666
9 months 3 weeks ago #4 by crosire
There is a bit more you need to do. Most importantly call "_app_state.capture()" before calling "update_and_render_effects()" and call "_app_state.apply_and_release()" afterwards, so that all D3D states are reset to what the engine expects. Also don't forget "_device->BeginScene()" and "_device->EndScene()" (although I think those are NOPs these days).

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

  • Posts: 3
9 months 3 weeks ago #5 by G33KiDoS
It started flickering again :(

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